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

Charles Manning cdhmanning at gmail.com
Sun Jun 28 19:23:15 BST 2020


Thanks all

It looks like the only way to do this is by passing in something from the
Makefile. That is perhaps the way I will go.

Unfortunately at present this project is under Eclipse control so I will do
this once I move over to Makefiles.



On Sun, Jun 28, 2020 at 11:33 PM Volker Kuhlmann <list57 at top.geek.nz> wrote:

> 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.
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/chchrobotics
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> Meetings usually 3rd Monday each month. See http://kiwibots.org for
> venue, directions and dates.
> When replying, please edit your Subject line to reflect new subjects.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20200629/2c72c14f/attachment.html>


More information about the Chchrobotics mailing list