简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM