News for hackers. Stuff that matters.
Re:How to build highly-debuggable C++ binaries by o11c on Monday July 29, 2024 @02:39PM (#41102646)
Assuming spatulas are absent, I've never had a problem with the build system on Linux. Nonetheless, for GCC the equivalent is:

  #pragma GCC optimize ("O0")
(see also target, push_options, and pop_options)

This is also available as a per-function attribute, using both gnu and standard syntaxes:

  __attribute__((optimize("O0")))
  [[gnu::optimize("O0")]]
Re:How to build highly-debuggable C++ binaries by bialpio on Monday July 29, 2024 @04:59PM (#41103729)
For completeness, in Clang `[[clang::optnone]]` as a per-function attribute also works fine. I'm using it for debugging quite frequently lately.