On Thu, Aug 12, 2010 at 02:19:26PM +0400, Alexey Tourbin wrote: > On Thu, Aug 12, 2010 at 02:02:17PM +0400, Sergey V Turchin wrote: > > man gcc про -O2 > > "NOTE: In ALT Linux gcc 4.1.1-alt9 and later versions, -D_FORTIFY_SOURCE=2 is > > set by default, and is activated when -O is set to 2 or higher. > > BTW, I find this incomprehensible. Is it really enabled by default, > or is it only enabled with -O2 and higher? Leaving aside the fact of > me being curious about whether -Os is higher than -O2... > > I felt like fortification and optimization are really different > compiler features. To me, it's unclear why -O2 should trigger > fortification. Yes, that's odd, but _FORTIFY_SOURCE is implemented in glibc header files this way. -- ldv