Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

D_FORTIFY_SOURCE=2 option does not work for me

I saw that GCC 4.5 and above versions should support –D_FORTIFY_SOURCE=2 option. But it does not work for me, it has been ignred and it does not report issues when i used.

Compiler version used is "g++.c4.5.3-p0", Will it ignore the option?

like image 506
susitra Avatar asked Dec 10 '25 01:12

susitra


1 Answers

In most systems, –D_FORTIFY_SOURCE=2 is only activated when also using -O2, ie, GCC compiler optimizations level 2 (or more). Try to use -O2 –D_FORTIFY_SOURCE=2 to see if it works.

like image 164
MestreLion Avatar answered Dec 12 '25 15:12

MestreLion



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!