This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Wformat-security and string literal


* Joe Buck | 2005-10-17 09:28:51 [-0700]:

>If we go down that route, the option would only work correctly if
>optimization is enabled, because you expect gcc to trace the source
>of pointers, and see what the pointers point to, and check the original
>strings for format characters.

ACK - gcc behave correctly if optimization is enabled. To my mind: a
pointer who points to a string literal is also a string literal. The
generated string is stored in the .rodata section, on either side (-O0,
-O2). The generated code is the same, but the warning messages differ!


HGN


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]