简体   繁体   English

D_FORTIFY_SOURCE=2 选项对我不起作用

[英]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.我看到 GCC 4.5 及以上版本应该支持 –D_FORTIFY_SOURCE=2 选项。 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?使用的编译器版本是“g++.c4.5.3-p0”,它会忽略该选项吗?

In most systems, –D_FORTIFY_SOURCE=2 is only activated when also using -O2 , ie, GCC compiler optimizations level 2 (or more).在大多数系统中, –D_FORTIFY_SOURCE=2仅在同时使用-O2时才被激活,即 GCC 编译器优化级别 2(或更高)。 Try to use -O2 –D_FORTIFY_SOURCE=2 to see if it works.尝试使用-O2 –D_FORTIFY_SOURCE=2看看它是否有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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