public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tomas.kalibera at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/95130] GCC ignoring attribute(format(gnu_printf)) on printf in mingw
Date: Wed, 15 Dec 2021 17:45:30 +0000	[thread overview]
Message-ID: <bug-95130-4-7j88Igl60s@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95130-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Tomas Kalibera <tomas.kalibera at gmail dot com> ---
(In reply to joseph@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

  parent reply	other threads:[~2021-12-15 17:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 11:37 [Bug c/95130] New: " martin at martin dot st
2020-05-14 17:27 ` [Bug c/95130] " joseph at codesourcery dot com
2021-11-22 21:21 ` tomas.kalibera at gmail dot com
2021-12-15 17:27 ` tomas.kalibera at gmail dot com
2021-12-15 17:29 ` tomas.kalibera at gmail dot com
2021-12-15 17:45 ` tomas.kalibera at gmail dot com [this message]
2022-10-25  7:10 ` lh_mouse at 126 dot com
2022-10-25 16:46 ` tomas.kalibera at gmail dot com
2022-10-25 19:40 ` martin at martin dot st
2022-10-26  7:03 ` tomas.kalibera at gmail dot com
2022-10-26 10:09 ` lh_mouse at 126 dot com
2022-10-26 12:04 ` tomas.kalibera at gmail dot com
2022-10-26 15:27 ` tomas.kalibera at gmail dot com
2022-12-15 15:42 ` tomas.kalibera at gmail dot com
2023-01-29 18:20 ` alvinhochun at gmail dot com
2023-08-02  2:06 ` tanksherman27 at gmail dot com
2023-08-02 13:15 ` tomas.kalibera at gmail dot com
2023-08-03 16:33 ` tomas.kalibera at gmail dot com
2023-08-17  6:11 ` tanksherman27 at gmail dot com
2023-08-19 10:18 ` tanksherman27 at gmail dot com
2023-08-19 19:11 ` tomas.kalibera at gmail dot com
2023-08-20  2:22 ` cvs-commit at gcc dot gnu.org
2023-08-21 12:50 ` tomas.kalibera at gmail dot com
2024-04-19  2:53 ` pinskia at gcc dot gnu.org
2024-04-19  3:28 ` lh_mouse at 126 dot com
2024-04-19  7:04 ` martin at martin dot st
2024-04-19  7:12 ` lh_mouse at 126 dot com
2024-04-19  7:13 ` pinskia at gcc dot gnu.org
2024-04-19  7:27 ` lh_mouse at 126 dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-95130-4-7j88Igl60s@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).