public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Daniil Stas <daniil.stas@posteo.net>
Cc: <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH v4] c-format: Add -Wformat-int-precision option [PR80060]
Date: Fri, 7 Jan 2022 20:00:24 +0000	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2201071958340.192044@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20220107182556.73e78c40@ux550ve>

On Fri, 7 Jan 2022, Daniil Stas via Gcc-patches wrote:

> > > @@ -4248,7 +4248,7 @@ check_format_types (const substring_loc
> > > &fmt_loc, && (!pedantic || i < 2)
> > >  	  && char_type_flag)
> > >  	continue;
> > > -      if (types->scalar_identity_flag
> > > +      if ((types->scalar_identity_flag ||
> > > !warn_format_int_precision) && (TREE_CODE (cur_type) == TREE_CODE

This makes the option apply to all types, not just integer types.  Thus, 
it means a test such as

void f (void) { __builtin_printf ("%f", 0.0f64); }

is not diagnosed with -Wformat -Wno-format-int-precision.  Given the 
option name, I don't think it should affect diagnosing that test (and 
there should be such a test added to the testsuite to verify that it 
doesn't affect diagnostics for non-integer types).

-- 
Joseph S. Myers
joseph@codesourcery.com

      reply	other threads:[~2022-01-07 20:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-27 22:18 Daniil Stas
2021-12-20 22:43 ` Daniil Stas
2022-01-07 16:25   ` Daniil Stas
2022-01-07 20:00     ` Joseph Myers [this message]

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=alpine.DEB.2.22.394.2201071958340.192044@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=daniil.stas@posteo.net \
    --cc=gcc-patches@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).