[devel] -D_FORTIFY_SOURCE=2

Dmitry V. Levin ldv на altlinux.org
Чт Авг 12 10:24:39 UTC 2010


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
----------- следующая часть -----------
Было удалено вложение не в текстовом формате...
Имя     : отсутствует
Тип     : application/pgp-signature
Размер  : 198 байтов
Описание: отсутствует
Url     : <http://lists.altlinux.org/pipermail/devel/attachments/20100812/79530135/attachment.bin>


Подробная информация о списке рассылки Devel