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

Charles Manning cdhmanning at gmail.com
Sun Jun 28 07:47:53 BST 2020


Hi All

I want to be able to tell in some logs what optimisation level was used to
compile some code.

eg.
 printf("This code was optimised with %s\n", omptimisation_string());

And this would print:
"This code was optimised with -Os\n" or whatever.

Does anyone know of such a thing in gcc?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20200628/dff5921f/attachment.html>


More information about the Chchrobotics mailing list