public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>, Jeff Law <law@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] analyzer: fix build with gcc 4.4 (PR 93276)
Date: Tue, 28 Jan 2020 16:31:00 -0000	[thread overview]
Message-ID: <1c4bf6f18b22edefd640cd6b7c55485dbf8f85c3.camel@redhat.com> (raw)
In-Reply-To: <20200128101301.GV17695@tucnak>

On Tue, 2020-01-28 at 11:13 +0100, Jakub Jelinek wrote:
> On Fri, Jan 24, 2020 at 07:53:28PM -0500, David Malcolm wrote:
> > This patch fixes various build failures seen with gcc 4.4
> > 
> > gcc prior to 4.6 complains about:
> > 
> >   error: #pragma GCC diagnostic not allowed inside functions
> > 
> > for various uses of PUSH_IGNORE_WFORMAT and POP_IGNORE_WFORMAT.
> > This patch makes them a no-op with such compilers.
> 
> I think this is wrong.
> All that is really needed is make sure you #include "diagnostic-
> core.h"
> before including pretty-print.h.  By including
> diagnostic-core.h first, you do:
> #ifndef GCC_DIAG_STYLE
> #define GCC_DIAG_STYLE __gcc_tdiag__
> #endif
> and then pretty-print.h will do:
> #ifdef GCC_DIAG_STYLE
> #define GCC_PPDIAG_STYLE GCC_DIAG_STYLE
> #else
> #define GCC_PPDIAG_STYLE __gcc_diag__
> #endif
> If instead pretty-print.h is included first, then it will use
> __gcc_diag__
> instead of __gcc_tdiag__ and thus will assume %E/%D etc. can't be
> handled.
> 
> I've so far just tested that in stage3 with this patch analyzer
> builds
> without any -Wformat/-Wformat-extra-args warnings.

Aha!  Thanks - that's much better.
 
> Ok for trunk if it passes bootstrap/regtest?

LGTM.


Dave

      reply	other threads:[~2020-01-28 15:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-25  3:39 David Malcolm
2020-01-25  6:09 ` Jeff Law
2020-01-28 10:35 ` Jakub Jelinek
2020-01-28 16:31   ` David Malcolm [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=1c4bf6f18b22edefd640cd6b7c55485dbf8f85c3.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=law@redhat.com \
    /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).