public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Optimization auto-setting _FORTIFY_SOURCE ??
@ 2023-01-29 23:05 Patrick Herbst
  2023-01-30  4:23 ` Xi Ruoyao
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick Herbst @ 2023-01-29 23:05 UTC (permalink / raw)
  To: gcc-help

Using GCC 9.4, I've noticed setting -O1 will set
_FORTIFY_SOURCE=2

I'm able to see this by running
gcc -c -E -dM -O1 - < /dev/null | grep FORTIFY_SOURCE

But running the same command without -O1 doesn't set it.

Is this documented?  is this expected behavior?  I could not find any
reference to how optimization leads to setting this macro.

Any tips on where I can look, or what i'm missing to see this connection?

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-30  4:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-29 23:05 Optimization auto-setting _FORTIFY_SOURCE ?? Patrick Herbst
2023-01-30  4:23 ` Xi Ruoyao
2023-01-30  4:57   ` LIU Hao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).