[PATCH C] Fix PR37724

NightStrike nightstrike@gmail.com
Mon Jun 7 19:13:00 GMT 2010


On Sat, Jun 5, 2010 at 6:44 AM, Joseph S. Myers <joseph@codesourcery.com> wrote:
> On Mon, 31 May 2010, Shujing Zhao wrote:
>
>> Hi,
>>
>> This patch uses the patch Andrew posted and fix the issues with %< and %>.
>> Pass the argument 'gmsgid' to 'pedwarn', but not '%s' would fix the issues.
>> The same issues are also fixed at error_init and warning_init.
>> To mark messages passed to error_init, pedantic_init and warning_init to be
>> gcc-internal-format, the arguments are also changed to use 'gmsgid' instead of
>> 'msgid'.
>> It doesn't fix C++ too.
>>
>> Tested on i686-pc-linux-gnu bootstrap with enabled all languages.
>>
>> Is it ok?
>
> OK with a comment added above the "error (gmsgid)" and similar calls to
> explain that the operand may be a format string with %< and %>, so that
> people using Ubuntu etc. host compilers which enable -Wformat-security by
> default don't try to change it back blindly.  (Ideally there would be
> error_no_args etc. functions that take a format string that is only
> permitted to use formats not taking any arguments and the information
> about this would be passed down to all the pretty-printers so that they
> abort instead of using va_arg in that case.)
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
>

Shujung, did you commit yet?



More information about the Gcc-patches mailing list