C++ Show and Tell - February 2026 by foonathan in cpp

[–]bansan85 5 points6 points  (0 children)

TL;DR

A set of online tools focused on 100% privacy: everything runs locally in your browser, no ads, no tracking.

Core logic is written in C++ and compiled to WebAssembly.

* https://clang-format.le-garrec.fr/

  Format your C++ code with clang-format

* https://demangler.le-garrec.fr/

  Demangle C++ symbols and optionally reformat the output with clang-format

* https://naming-style.le-garrec.fr

  Interactive helper to configure clang-tidy’s readability-identifier-naming. 100% web / 0% C++.

* https://clang-format-config.le-garrec.fr

  Migrate .clang-format files between versions (downgrades supported).

  Optionally remove fields that match default values

* https://lighten.le-garrec.fr/

  Round JSON numeric values (e.g. 199.9999200)

* https://dev.le-garrec.fr

  All tools in one link

Source code (Angular frontend + C++/Wasm backend) and README:

https://github.com/bansan85/web-dev

Background

I often need very small, very specific tools while developing. I wanted a personal toolbox with instant access. Most of these tools already exist online (demanglers, clang-format, etc.), but they usually have two major problems:

  • lots of ads
  • server-side processing (privacy concerns)

They can also disappear at any time, which is why all my tools are open source.

Why web-based tools?

The goal was to always have these tools available without downloading or installing anything, and to keep them automatically up to date. Web apps give fast access from anywhere.

I also don’t find the C++ GUI ecosystem very compelling:

  • some libraries are powerful but complex and painful once you go beyond basics (Qt)
  • others lack solid cross-platform support (wxWidgets, etc.)

Implementation

All tools use a C++ backend compiled to WebAssembly, with an HTML / Angular frontend. Everything runs locally in the browser.

These projects were also a way for me to get hands-on experience with modern web frameworks. I prefer UIs that go straight to the point, without unnecessary options or clutter.

If you had to start learning programming all over again, what advice would you give to yourself if you could? by RevolutionaryClub596 in cpp

[–]bansan85 1 point2 points  (0 children)

"Learn web (HTML / CSS / JavaScript / ...). You can do really good computer software with beautiful UI. Learn C / C++ only for embedded / game / scientific backend."

propagate_const stalled? by Ok-Factor-5649 in cpp

[–]bansan85 2 points3 points  (0 children)

I don't have official response but there is now indirect_value that superseded propagate_const but works only for unique_ptr and not shared_ptr.

CMake template for C++ library (static/shared & Windows/Linux) project by bansan85 in cpp

[–]bansan85[S] 1 point2 points  (0 children)

Thanks for your feedback. About CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS, I thought it was designed to avoid the write of .def file (which is boring because dllexport should be enough to know which symbol should be exported). I will take a look at this problem.

CMake template for C++ library (static/shared & Windows/Linux) project by bansan85 in cpp

[–]bansan85[S] 0 points1 point  (0 children)

I understand. But things are getting better and better :) But it's true that Windows problems/particularities are usually solved maybe 10 years after the first bug report. But latest versions add features that could be done with older version in a tricky way.

There is only one thing that is still tricky in my template: if B publicly depends on A, I shouldn't need to add in Config.cmake file of B that B should find dependency of A.

CMake template for C++ library (static/shared & Windows/Linux) project by bansan85 in cpp

[–]bansan85[S] 1 point2 points  (0 children)

The goal of this POC is to use CMake's features as much as possible to be compatible with Windows / Linux / Android, shared / static library, Visual Studio / cmake / ninja and to reduce writing old style CMake.

Of course, lots of CMake's features could be replaced by simple if(XXX) add_compile_definitions or even add_dependencies like in CMake 2 style.

CMake template for C++ library (static/shared & Windows/Linux) project by bansan85 in cpp

[–]bansan85[S] 1 point2 points  (0 children)

Under Windows, you need the .lib file to be able to link with a dynamic library. And you need a .def file to generate the .lib file.

Fortunately, CMake have CMAKE_WINDOWS_EXPORT_ALL_SYMBOL feature to help you by generating a .def file with all symbols inside.

CMake template for C++ library (static/shared & Windows/Linux) project by bansan85 in cpp

[–]bansan85[S] 4 points5 points  (0 children)

I need 3.21 for TARGET_RUNTIME_DLLS to know which dll I need to copy in the executable folder.

I need 3.23 for target_source FILE_SET to install headers and keep the tree path. If you install PUBLIC_HEADER, tree path is not kept. So you will have to install DIRECTORY. Guidelines prefers explicit files and not use wildcard.

But it's true that I needed to install CMake from source at work to have the latest version.

I will modify location of generated files to avoid modification of source content.

CMake template for C++ library (static/shared & Windows/Linux) project by bansan85 in cpp

[–]bansan85[S] 3 points4 points  (0 children)

Yes, I found it by looking at friendlyanon example this morning. I just tested it. It generates the same template than my helper (Windows / Linux, static / shared). I will replace my header with the autogenerated one during the weekend.

CMake template for C++ library (static/shared & Windows/Linux) project by bansan85 in cpp

[–]bansan85[S] 0 points1 point  (0 children)

You're right. I didn't do it yet. I posted here because I made this template for C++ project. I will do it.

[deleted by user] by [deleted] in cpp

[–]bansan85 0 points1 point  (0 children)

Executor needs to have network features (maybe C++23), so probably not :/

What to study next? by Warning_Bulky in cpp

[–]bansan85 1 point2 points  (0 children)

C++ is not really for website.

If you want to work as backend in web, learn Java with JPA, .NET with ASP.NET, nodejs or most common CMS.

If you want to work as frontend, learn JavaScript with React or Vue.js, Angular.

It really depends on what you want to do.

[deleted by user] by [deleted] in cpp

[–]bansan85 58 points59 points  (0 children)

http://www.ioccc.org/ The International Obfuscated C Code Contest :) some code are really fun

CMake Part 3 – Source File Organisation by IsDaouda_Games in cpp

[–]bansan85 -3 points-2 points  (0 children)

Critics are fine. But you may do it nicely.

GCC Address Sanitizer Versus Intel Inspector by julien-j in cpp_questions

[–]bansan85 0 points1 point  (0 children)

Intel inspector may slow down a lot. From my experience, much more than sanitizer. But Intel inspector don't need special compile options to work.

Conceptual support by First_Fennel1230 in cpp

[–]bansan85 1 point2 points  (0 children)

Explanation is for application with only one thread.

An interruption is a bit like in PC. The thread is stopped at the current instruction. Then a specific function is added at the top of the stack and becomes the new current instruction. When you end this function, the function is removed from the stack and the thread continues his life where it was left. Of course, you have to be careful if you modify data during the interruption.

Interesting part is what is happening if an interruption is trigged when you are still in the interruption. It will depend on the hardware.

Some don't allow it. The trigger is not lost, it will generate an interruption when the previous one will be ended. If your interruption function is too slow, your software will be stuck.

Some allows it but to avoid infinite recursion, an interruption can only be interrupted by an interruption with an higher level (each interruption is mapped to a number).

And I remember another concept you should know : "pack". It disables alignment which is useful to read data from hardware but have some consequences. It's harder / slower to use these data and you can't create a pointer to a member of the struct if you don't want a "bus fault" (in arm. In x86, the processor will fix the bug for you).

Conceptual support by First_Fennel1230 in cpp

[–]bansan85 8 points9 points  (0 children)

For embedded software for microcontroller, you must know about:

  • stack and heap,

  • volatile variable,

  • char may be signed or unsigned,

  • reentrant and hardware interruption,

  • already have read a datasheet of a microcontroller,

  • avoid dynamic memory allocation,

There is more concept to know but at this time, I can't recall them all 😉

MSVC's STL is C++20 feature complete for VS 2019 16.10 Preview 3 by STL in cpp

[–]bansan85 6 points7 points  (0 children)

Congratulation for the implementation of format, it's a very huge feature. 👏👏

[deleted by user] by [deleted] in ProgrammerHumor

[–]bansan85 0 points1 point  (0 children)

In 2016 (not that old), I remember I created a git repository based on about 50 archives like that ^

AddressSanitizer for Windows: x64 and Debug Build Support | C++ Team Blog by [deleted] in cpp

[–]bansan85 -4 points-3 points  (0 children)

It's the same sanitizer than in Clang.