[chbot] gcc experts: Is there a flag/symbol available to see current optimisations?

Volker Kuhlmann list57 at top.geek.nz
Sun Jun 28 12:32:42 BST 2020


Not that I know of. If there was, the result would be only in binaries
containing debugging output, not in those that were stripped.

To get running code to print something useful about how it was compiled,
I define strings in the Makefile, pass them in via -Dmacro=xxx, and use
that macro to construct a C string in the program.

If you want that string to remain in the code without printing or using
it, don't forget to to declare it volatile or the optimiser will give
you a blank canvas...

Volker

-- 
Volker Kuhlmann
http://volker.top.geek.nz/	Please do not CC list postings to me.



More information about the Chchrobotics mailing list