public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/106741] New: suspicious %qE related warning when building gcc
@ 2022-08-25 15:27 jbeulich at suse dot com
  2022-08-25 17:08 ` [Bug analyzer/106741] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jbeulich at suse dot com @ 2022-08-25 15:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106741
           Summary: suspicious %qE related warning when building gcc
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: jbeulich at suse dot com
  Target Milestone: ---

This

/usr/local/src/gcc-12.2.0/gcc/analyzer/diagnostic-manager.cc: In member
function ‘void ana::saved_diagnostic::dump_as_dot_node(pretty_printer*) const’:
/usr/local/src/gcc-12.2.0/gcc/analyzer/diagnostic-manager.cc:783:28: warning:
unknown conversion type character ‘E’ in format [-Wformat=]
  783 |     pp_printf (pp, "var: %qE\n", m_var);
      |                            ^
/usr/local/src/gcc-12.2.0/gcc/analyzer/diagnostic-manager.cc:783:20: warning:
too many arguments for format [-Wformat-extra-args]
  783 |     pp_printf (pp, "var: %qE\n", m_var);
      |                    ^~~~~~~~~~~~

suggests the use of %qE here is wrong, unlike elsewhere in the same file when
calling other functions.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug analyzer/106741] suspicious %qE related warning when building gcc
  2022-08-25 15:27 [Bug analyzer/106741] New: suspicious %qE related warning when building gcc jbeulich at suse dot com
@ 2022-08-25 17:08 ` pinskia at gcc dot gnu.org
  2022-08-25 17:13 ` pinskia at gcc dot gnu.org
  2022-08-26  7:32 ` jbeulich at suse dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-25 17:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-08-25

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Is this during stage 1 or a latter stage? What GCC did you start with?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug analyzer/106741] suspicious %qE related warning when building gcc
  2022-08-25 15:27 [Bug analyzer/106741] New: suspicious %qE related warning when building gcc jbeulich at suse dot com
  2022-08-25 17:08 ` [Bug analyzer/106741] " pinskia at gcc dot gnu.org
@ 2022-08-25 17:13 ` pinskia at gcc dot gnu.org
  2022-08-26  7:32 ` jbeulich at suse dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-25 17:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
/* If we haven't already defined a front-end-specific diagnostics
   style, use the generic one.  */
#ifdef GCC_DIAG_STYLE
#define GCC_PPDIAG_STYLE GCC_DIAG_STYLE
#else
#define GCC_PPDIAG_STYLE __gcc_diag__
#endif

/* This header may be included before diagnostics-core.h, hence the duplicate
   definitions to allow for GCC-specific formats.  */
#if GCC_VERSION >= 3005
#define ATTRIBUTE_GCC_PPDIAG(m, n) __attribute__ ((__format__
(GCC_PPDIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m)
#else
#define ATTRIBUTE_GCC_PPDIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif
extern void pp_printf (pretty_printer *, const char *, ...)
     ATTRIBUTE_GCC_PPDIAG(2,3);


%qE support was added for GCC 8, with r8-499-631238ac3f50 .
So if you are compiling with GCC 7 (or before), the first stage will warn about
an unknown conversion type character ‘E’ but the 2nd and 3rd stages won't.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug analyzer/106741] suspicious %qE related warning when building gcc
  2022-08-25 15:27 [Bug analyzer/106741] New: suspicious %qE related warning when building gcc jbeulich at suse dot com
  2022-08-25 17:08 ` [Bug analyzer/106741] " pinskia at gcc dot gnu.org
  2022-08-25 17:13 ` pinskia at gcc dot gnu.org
@ 2022-08-26  7:32 ` jbeulich at suse dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jbeulich at suse dot com @ 2022-08-26  7:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from jbeulich at suse dot com ---
If I'm reading the log right, it's stages 2 and 3 where the warnings appear,
while stage 1 (using gcc10) don't expose such a warning. Interestingly the
warnings do appear (once) when doing cross builds (again using gcc10) - do
stage1 builds have more warnings suppressed than (single-stage) cross builds?

There also was no such warning when building 12.1.0.

I guess this (in gcc/analyzer/analyzer.h) might matter:

/* Disable -Wformat-diag; we want to be able to use pp_printf
   for logging/dumping without complying with the rules for diagnostics.  */
#if __GNUC__ >= 10
#pragma GCC diagnostic ignored "-Wformat-diag"
#endif

This does neither suppress -Wformat= nor -Wformat-extra-args.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-26  7:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25 15:27 [Bug analyzer/106741] New: suspicious %qE related warning when building gcc jbeulich at suse dot com
2022-08-25 17:08 ` [Bug analyzer/106741] " pinskia at gcc dot gnu.org
2022-08-25 17:13 ` pinskia at gcc dot gnu.org
2022-08-26  7:32 ` jbeulich at suse dot com

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).