public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/56824] New: pragma GCC diagnostic push/pop regression for GCC diagnostic ignored "-Waggregate-return"
@ 2013-04-03  7:40 magnus.reftel at gmail dot com
  2013-04-10  8:10 ` [Bug c/56824] " magnus.reftel at gmail dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: magnus.reftel at gmail dot com @ 2013-04-03  7:40 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56824

             Bug #: 56824
           Summary: pragma GCC diagnostic push/pop regression for GCC
                    diagnostic ignored "-Waggregate-return"
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: magnus.reftel@gmail.com


Created attachment 29784
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29784
Simple testcase

If the aggregate-return warning is silenced using

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waggregate-return"

and then, after a line that triggers the warning, the diagnostics are restored
using 

#pragma GCC diagnostic pop

, gcc 4.8 issues an aggregate-return warning. This was not the case in versions
4.6 or 4.7.

With the attached test case, the following is printed:

$ /opt/gcc-4.7/bin/gcc --version
gcc (GCC) 4.7.0
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ /opt/gcc-4.7/bin/gcc -Waggregate-return -c aggregate-return.c
$ /opt/gcc-4.8/bin/gcc --version
gcc (GCC) 4.8.0
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ /opt/gcc-4.8/bin/gcc -Waggregate-return -c aggregate-return.c
aggregate-return.c: In function ‘main’:
aggregate-return.c:8:13: warning: function call has aggregate value
[-Waggregate-return]
  struct foo f = aggregate_return();
             ^
$

No warning is printed by either version if the "GCC diagnostic pop" is left
out.

This regression does not affect (at least some) other warnings, e.g. the
following test case:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
int main(int argc, char* argv[])
{
        int i;
        return 0;
}
#pragma GCC diagnostic pop

does not print a warning when compiled with "/opt/gcc-4.8/bin/gcc
-Wunused-variable -c unused.c".
>From gcc-bugs-return-419039-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Apr 03 07:45:38 2013
Return-Path: <gcc-bugs-return-419039-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21832 invoked by alias); 3 Apr 2013 07:45:38 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 21802 invoked by uid 48); 3 Apr 2013 07:45:33 -0000
From: "magnus.reftel at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/56824] pragma GCC diagnostic push/pop regression for GCC diagnostic ignored "-Waggregate-return"
Date: Wed, 03 Apr 2013 07:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: magnus.reftel at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields: Attachment #29784 is obsolete
Message-ID: <bug-56824-4-p4Intfr8YW@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56824-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56824-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg00184.txt.bz2
Content-length: 576


http://gcc.gnu.org/bugzilla/show_bug.cgi?idV824

Magnus Reftel <magnus.reftel at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29784|0                           |1
        is obsolete|                            |

--- Comment #1 from Magnus Reftel <magnus.reftel at gmail dot com> 2013-04-03 07:45:33 UTC ---
Created attachment 29785
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id)785
Slightly tweaked version of the testcase


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

end of thread, other threads:[~2014-03-06  8:27 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-03  7:40 [Bug c/56824] New: pragma GCC diagnostic push/pop regression for GCC diagnostic ignored "-Waggregate-return" magnus.reftel at gmail dot com
2013-04-10  8:10 ` [Bug c/56824] " magnus.reftel at gmail dot com
2013-04-10 18:32 ` manu at gcc dot gnu.org
2013-04-12  7:42 ` magnus.reftel at gmail dot com
2013-04-12  9:12 ` manu at gcc dot gnu.org
2013-08-08 18:37 ` magnus.reftel at gmail dot com
2013-08-10 16:14 ` mikpe at it dot uu.se
2013-11-19  9:46 ` [Bug c/56824] [4.8/4.9 regression] pragma GCC diagnostic push/pop fail with " rguenth at gcc dot gnu.org
2013-11-22 10:45 ` rguenth at gcc dot gnu.org
2014-02-05 14:15 ` [Bug preprocessor/56824] " jakub at gcc dot gnu.org
2014-02-07  7:03 ` magnus.reftel at gmail dot com
2014-02-07 16:43 ` jakub at gcc dot gnu.org
2014-02-08  0:10 ` [Bug preprocessor/56824] [4.8 " jakub at gcc dot gnu.org
2014-02-10 15:56 ` magnus.reftel at gmail dot com
2014-03-06  7:58 ` jakub at gcc dot gnu.org
2014-03-06  8:27 ` jakub at gcc dot gnu.org

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