https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95130

--- Comment #5 from Tomas Kalibera <tomas.kalibera at gmail dot com> ---
(In reply to jos...@codesourcery.com from comment #1)
> See bug 92292.  The extra attribute isn't ignored, it simply means the 
> function has multiple format attributes, which is valid, but should 
> probably be special-cased for this case of built-in functions.

I've added a draft of a patch to address the issue in the suggested way. I've
tested it in gcc 10.3.0 on the example from comment 2 (also attached). With the
patch applied, only line (2) gets a warning, as it should.

When deciding whether to emit a format warning for a function with multiple
format attributes, it skips the first format in case it is a builtin known to
have a format added by gcc. Please let me know if you have any advice how to
improve (thanks to Martin Liska for helping me with identifying the builtins),
or indeed feel free to adjust and add your way. Fixing this would help the R
community or anyone else who uses GCC with UCRT.

Thanks,
Tomas

Reply via email to