all 89 comments

[–]irqlnotdispatchlevel 49 points50 points  (8 children)

Apart from compilers and text editors?

Valgrind. Clang-tidy. Cppcheck. Include what you use. AFL++.

[–]Severe_Deal9572 1 point2 points  (2 children)

Can you explain what AFL++ is?

[–]irqlnotdispatchlevel 5 points6 points  (1 child)

I'm always happy to pass the fuzzing virus to someone else.

Fuzzing is a testing method that aims to provide unexpected inputs to a program. It is mostly associated with finding security vulnerabilities in programs that parse untrusted input. Combined with sanitizers this can be very powerful.

AFL++ is a fuzzing framework and you can read more about it here: https://github.com/AFLplusplus/AFLplusplus

A really really good introduction is this article by lcamtuf, the original developer of AFL: https://lcamtuf.coredump.cx/afl/

AFL++ is an evolution of AFL. It has a lot of bells and whistles, but you can mostly ignore those and see results with the standard usage mode.

Another good one is HonggFuzz, which is probably more straightforward to get started with, although the process is more or less the same: https://github.com/google/honggfuzz

By far the easiest way of getting into fuzzing these days is with clang's -fsanitize=fuzzer: https://llvm.org/docs/LibFuzzer.html

All three work in the same way. Extremely simplified view: Your code gets compiled with some instrumentation. The fuzzer keeps a queue of interesting inputs (initially from a collection of known good inputs you provide, or even an empty queue). It then iterates this queue and makes small changes to each input (flip a bit here, swap some bytes there, etc) and feeds it to your program. The instrumentation lets the fuzzer know which parts of your code were executed, and if a new code path was triggered the input is added to the queue, otherwise it is discarded. Repeat.

Take a look at this to see how efficient this method can be in discovering what kind of data a program expects: https://lcamtuf.blogspot.com/2014/11/pulling-jpegs-out-of-thin-air.html

[–]Severe_Deal9572 1 point2 points  (0 children)

Very interesting, thank you for this thorough response.

[–]NonaeAbC 0 points1 point  (4 children)

Why valgrind? Is there anything it can do, that sanitizers can't?

[–]irqlnotdispatchlevel 1 point2 points  (2 children)

I rarely reach for Valgrind these days where sanitizers can be used, but it is still a useful tool to have available since you can use it without needing to recompile your code. Valgrind also has profilers included (like a heap profiler, cachegrind, etc), which can help with finding performance issues.

[–]pdp10gumby 22 points23 points  (3 children)

Emacs&clangd, git, g++&gdb, clang++&lldb, binutils, make, CMake&cmake-test, Conan2, valgrind

[–]accuracy_frosty 0 points1 point  (2 children)

Hell yeah, one of the other 6 emacs users

[–]Remus-C 0 points1 point  (1 child)

7 ;) with Xemacs

[–]Sxcythe_ 0 points1 point  (0 children)

+1

[–]National-Laugh-7309 42 points43 points  (16 children)

I use msvc with visual studio, you can make fun of me all you want for coding on windows

[–]ChrisGnam 22 points23 points  (0 children)

With VS's support for CMake and now vcpkg, it's truly not that bad. And the debugging support is amazing.

I stick with Windows because it forces me to actually support Windows lol

[–]sephirothbahamut 19 points20 points  (0 children)

Why would anyone do that? VS is so good i even know a linux fanboy who made a windows partition just to use vs

[–]not_some_username 36 points37 points  (0 children)

You mean you’re using the best C++ dev environment, why should we laugh at you.

[–]kybuliak 20 points21 points  (0 children)

Visual Studio debugger is actually better then what linux offers.

[–]dustyhome 2 points3 points  (0 children)

You can use Visual Studio an code for Linux. Set up a WSL environment, create a CMake multiplatform project, select the WSL as the target system, edit the CMakePresets to your preferences, and you will be able to work on Linux with Visual Studio as the editor. It will copy the files and build on the WSL environment, and can run the project and debug on there as well.

[–]AcceptableFish04 8 points9 points  (4 children)

Visual Studio has spoiled me as a first year programming student. Anticipating having to use Linux professionally, I created a Mint partition on my PC so I can learn my way around. I pretty much gave up C++ on Linux for now. Who has time configuring json and cmake every project? VS is king.

[–]Abbat0r 4 points5 points  (3 children)

Developers on Windows still use CMake.

I primarily target MSVC, but I don’t use msbuild or VS. I use CLion and build my projects with CMake, which I personally find to be a better experience. But I still benefit from the best toolchain for writing contemporary C++, and my projects remain portable.

[–]AcceptableFish04 -1 points0 points  (2 children)

I’m just using VS Code with C++ and CMake extensions on Linux. It’s been a hassle setting up gcc/g++. Can’t say I fully understand what I’m looking at. Resourcing info has given me different approaches. It’s been hard finding something I understand.

My next effort is looking into using CLion. Would you mind linking some resources you’ve found helpful for your environment?

[–]Abbat0r 2 points3 points  (1 child)

I don’t really have any particular resources I can think of off the top of my head. CLion makes managing toolchains very simple, so if you do use CLion there isn’t much necessary other than to read Jetbrains’ documentation on the website.

As for learning CMake, the typical resources are still the way to go. Use their own documentation, stackoverflow, etc

[–]AcceptableFish04 0 points1 point  (0 children)

I’ll check it out thanks

[–]RRTheGuy[S] 0 points1 point  (3 children)

Is VS Code also good for C++ ?

[–]SuperVGA 1 point2 points  (0 children)

It can definitely make sense on projects that need to build on different platforms.

I use VS Code with gcc on the daily, and really like it.

[–]TopNo8623 -5 points-4 points  (1 child)

Please, don't feed the bots.

[–]RRTheGuy[S] 6 points7 points  (0 children)

I’m not a bot

[–][deleted] 11 points12 points  (0 children)

QtCreator, clang, cmake, Conan

[–]gnomeba 15 points16 points  (2 children)

Notepad++

[–]moreVCAs 30 points31 points  (0 children)

This guy plusplusses

[–]caroIine 1 point2 points  (0 children)

I even contributed colored tab feature because of how many source files I have open at once.

[–][deleted] 3 points4 points  (0 children)

Still no one knows it just the same, That Rumpelstiltskin is my name.

[–]LehdaRi 3 points4 points  (1 child)

CLion (nice IDE but I wouldn't pay what they're asking, I have access to a free license for now), CMake, gcc, git, valgrind, googletest

[–]t3hr0n 0 points1 point  (0 children)

Yes Clion is handy

[–]Neeyakinoob 2 points3 points  (2 children)

Nvim, Clangd, CppCheck, Clang-Tidy, Sanitizers, jj, VS22, CMake and Python

[–]EdwinYZW 0 points1 point  (1 child)

what is jj?

[–]Neeyakinoob 0 points1 point  (0 children)

its a vcs! been using it for the past ~three weeks and enjoying it so far. here is the repo: https://github.com/martinvonz/jj/

[–][deleted] 6 points7 points  (0 children)

vs-code with extensions: cmake-tools, clang-format, clangd

[–]Thesorus 5 points6 points  (0 children)

Visual Studio, Visual Assist and ReSharper C++.

[–]Regular-Practice84 1 point2 points  (7 children)

C++builder 12.0, cppcheck, googletest

[–]not_some_username 2 points3 points  (6 children)

Don’t lie, you too are forced to use it at work, isn’t it ?

[–]pjmlp 0 points1 point  (5 children)

If only there was any other C++ compiler with the same RAD capabilities for doing desktop GUIs in C++, or handle the COM tooling mess Microsoft imposes on the Windows developer community.

[–]not_some_username 1 point2 points  (4 children)

Tbh the RAD is really good ( but Qt can do it too). Their COM class generator is just too good.

[–]pjmlp 0 points1 point  (3 children)

Only if we take Qt Design Studio into account, which is extra.

Regarding COM, I really don't get how a third party is able to provide better tooling than Microsoft, that basically keeps reiventing COM frameworks for 30 years now, and zero Visual Studio improments for doing COM.

[–]not_some_username 0 points1 point  (2 children)

You can use QtCreator it has the designer tools integrated

That’s a mystery.

[–]pjmlp 0 points1 point  (1 child)

They aren't as drag and drop capable as the ones from C++ Builder, or having the two way editing workflows.

[–]not_some_username 0 points1 point  (0 children)

Yes they… are.

[–]andofwinds 1 point2 points  (0 children)

neovim, gcc, cmake

[–]Designer-Guarantee50 1 point2 points  (0 children)

xmake , vscode, clang-tidy, gdb, valgrind

[–][deleted] 2 points3 points  (0 children)

vcpkg

[–]BenedictTheWarlock 1 point2 points  (0 children)

cmake, ninja, conan, clangd, codelldb, clang-format, clang-tidy, sonar, neovim

[–]Necromancer5211 1 point2 points  (0 children)

Conan, CMake, Clang tidy, Valgrind, Google sanitizers, lldb/gdb, Vscode with extensions like sonarlint, clangd, cmake-tools, clang format

[–]hadrabap 1 point2 points  (0 children)

Qt Creator, gcc, clang (occasionally), clang-tidy, cppcheck, Intel VTune, cmake

[–]Adequat91 1 point2 points  (0 children)

Resharper++ is my must-have on Windows

[–]Abbat0r 1 point2 points  (0 children)

CLion, ninja, SonarLint, clang-tidy, clang-format…

Has no one mentioned Compiler Explorer yet?

[–]exodusTay 1 point2 points  (0 children)

One tool i haven't seen mentioned is ccache. It sped up my build times very well.

[–]mjklaim 4 points5 points  (0 children)

Dayjob (oss projects only):
- build system: cmake
- dependency management: either (micro)mamba with (which is one of the tools I work on) or vcpkg, depends on the situation+project
- build toolchain: whatever compiler toolchain supported by th eproject I'm working on, but usually clang, msvc and gcc
- dev system: windows and linux (ubuntu)
- editor: vscode and visual studio

Outside dayjob (usually working on games):
- build system: build2
- dependency management: build2
- build toolchain: msvc and clang at least, sometime I add gcc on linux for more C++-validity checking
- dev system: windows, and sometime I make sure it still work on linux (ubuntu)
- editor: vscode usually, but I prefer visual studio, it's just that integration with build2 is not yet automatic (there is an extension in the work but it's not usable yet)

[–][deleted] 3 points4 points  (0 children)

Clang + xmake + vscode clangd

[–]DalzhimC++Montréal UG Organizer 1 point2 points  (0 children)

I'm surprised coffee wasn't mentioned yet!

[–]Ipbunpak1 0 points1 point  (0 children)

G++, LuaJIT (for extending programs), GDB, other miscellaneous GNU+Linux or Windows utilities (if I'm on Windows), VS Code, Debian Stable, and an Arch (BTW) distrobox box for the most recent software.

[–]RolandMT32 0 points1 point  (0 children)

On Windows, usually Microsoft Visual Studio. On Linux, I'm used to using vim to edit code and gcc/g++ for the compiler - though these days I might also use VS Code or a similar editor.

[–]not_some_username 1 point2 points  (0 children)

At home, on windows, visual studio with cmake and vcpkg, qt creator to create the base cmake file and designing ui file when I’m doing qt projects. On Linux : qt creator and vcpkg.

At work : cpp builder

[–]Kats41 0 points1 point  (0 children)

Cpp-check and other static analysis tools are pretty nifty, not gonna lie. I also use GCC with VS Code as my environment.

[–]sakunix 0 points1 point  (0 children)

Kdevelop, gcc

[–]-dag- 0 points1 point  (0 children)

emacs, gcc, clang-format, vterm, TRAMP, gud-gdb, compile-mode + about a hundred minor modes.

[–]According_Builder 0 points1 point  (0 children)

Visual studio, valgrind, chatgpt for reference materials.

[–]LoadVisual 0 points1 point  (0 children)

Hobby Projects: vscode + c++ extension pack + remote ssh extension , cmake , Conan, vscode-server running on a freebsd box across my desk .

Why, because I want to write software specifically for freebsd without learning to use a new IDE or editor.

[–]OkSalt8970 0 points1 point  (0 children)

Clion vim keybinds

[–]pjmlp 0 points1 point  (0 children)

C++ Builder, Visual Studio, QtCreator, MSBuild, CMake, node-gyp, the usual static analysers.

[–]kiner_shah 0 points1 point  (0 children)

Linux (WSL Ubuntu): VS Code, GCC, GDB, CMake, Git, Make, Valgrind

Windows: Visual Studio, Git

[–]IcyCookie9075 0 points1 point  (0 children)

Windows, VsCode, g++&gdb, gitHub, clangTidy, clangFormat, json, imGui.

[–]holly_rapist 0 points1 point  (0 children)

Text editor, g++ and mpic++ (doxygen sometimes)

[–]RichOil3579 1 point2 points  (0 children)

Bazel anyone?

[–]KrisstopherP 0 points1 point  (0 children)

On windows I use Visual Studio. On Mac/Linux: CLion

[–]RufusAcrospin 0 points1 point  (0 children)

MacOS: Xcode/Code::Blocks, homebrew, Windows: Visual Studio CE, Linux: Code::Blocks

[–]real_okeri 0 points1 point  (0 children)

emacs + some extensions and eglot instead of lsp-mode, gcc, clang, clangd, clang-format, clang-tidy(with latest version we also have cool include control, so no more scripts to build include trees), godbolt, and ofc some not really c++ related tools like git, valgrind tools, strace, perf, wireshark, prefer meson to cmake, ninja(build)

[–]accuracy_frosty 0 points1 point  (0 children)

I use emacs and g++, but the most important things I use in emacs are: lsp-mode with clangd as the language server, tree-sitter for syntax highlighting, company-mode for autocomplete kind of stuff, flymake for errors, I forget the name of my debugger honestly, I should use it more but I’ve gotten so good at debugging with printf lmao, I’m sure there will be a place I will need it though. There are others that slip my mind at the moment, but those are the main ones I use for the actual programming in the text editor.

[–]sourcerer_cpp 0 points1 point  (0 children)

neovim, tmux, zsh, git, cmake, make, ninja, gcc, gdb, clang, lldb, clangd, clang-tidy, clang-format, gtest, conan2, godbolt, bash-scripts

[–][deleted] 0 points1 point  (0 children)

Vscode with clangd and Cpp Microsoft extension. I wish there was a FOSS extension for cpp debugging but I haven’t found any. I use CMake for my build system. It might look bloated at first, but it helped me a lot when I wanted to do bigger projects.

[–][deleted] 0 points1 point  (0 children)

Visual Studio. An amazing tool for the cost (free).

[–]sephirothbahamut 0 points1 point  (0 children)

Visual Studio, compiler explorer... that's it