public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/28280]  New: [4.2 regression] bogus "statement with no effect" warning
@ 2006-07-06  9:14 tbm at cyrius dot com
  2006-07-06 14:51 ` [Bug c/28280] " pinskia at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: tbm at cyrius dot com @ 2006-07-06  9:14 UTC (permalink / raw)
  To: gcc-bugs

gcc 4.2 shows the following bogus warning message.  I'm not sure whether this
is a regression or a new warning but it would be great if this could be
improved.  The warning shows up in elfutils, the minimal testcase was extracted
by Eugeniy Meshcheryakov.
41714:tbm@deprecation: ~] /usr/lib/gcc-snapshot/bin/gcc -c -W -Wall test.c
test.c: In function 'fun':
test.c:9: warning: statement with no effect
41715:tbm@deprecation: ~] gcc-4.1 -c -W -Wall test.c
41716:tbm@deprecation: ~] cat test.c
#include <inttypes.h>

void * fun(char *desc, int descsz)
{
        struct
        {
                uint32_t os;
                uint32_t version[descsz / 4 - 1];
        } *tag = (__typeof (tag)) desc;

        return tag;
}


-- 
           Summary: [4.2 regression] bogus "statement with no effect"
                    warning
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbm at cyrius dot com


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
@ 2006-07-06 14:51 ` pinskia at gcc dot gnu dot org
  2006-07-06 15:12 ` [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof pinskia at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-06 14:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-07-06 14:51 -------
This is not a debug issue.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|fche at redhat dot com,     |
                   |jakub at redhat dot com     |


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
  2006-07-06 14:51 ` [Bug c/28280] " pinskia at gcc dot gnu dot org
@ 2006-07-06 15:12 ` pinskia at gcc dot gnu dot org
  2006-07-06 15:13 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-06 15:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-07-06 15:12 -------
We are warning inside the typeof.
Here is a shorter testcase:
void f(__SIZE_TYPE__ d)
{
  typedef int t[d];
  t *g = (__typeof(g))d;
}


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
            Summary|[4.2 regression] bogus      |[4.2 regression] bogus
                   |"statement with no effect"  |"statement with no effect"
                   |warning                     |warning with VLA and typeof
   Target Milestone|---                         |4.2.0


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
  2006-07-06 14:51 ` [Bug c/28280] " pinskia at gcc dot gnu dot org
  2006-07-06 15:12 ` [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof pinskia at gcc dot gnu dot org
@ 2006-07-06 15:13 ` pinskia at gcc dot gnu dot org
  2006-07-08 10:10 ` mrs at apple dot com
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-06 15:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-07-06 15:13 -------
Most likely caused by:
2006-05-18  Mike Stump  <mrs@apple.com>

        Fix up vla, vm and [*] sematics.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrs at apple dot com
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-07-06 15:13:05
               date|                            |


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
                   ` (2 preceding siblings ...)
  2006-07-06 15:13 ` pinskia at gcc dot gnu dot org
@ 2006-07-08 10:10 ` mrs at apple dot com
  2006-07-12 13:12 ` mrs at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mrs at apple dot com @ 2006-07-08 10:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mrs at apple dot com  2006-07-08 10:10 -------
Fix submitted.


-- 


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
                   ` (3 preceding siblings ...)
  2006-07-08 10:10 ` mrs at apple dot com
@ 2006-07-12 13:12 ` mrs at gcc dot gnu dot org
  2006-07-12 13:13 ` mrs at apple dot com
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mrs at gcc dot gnu dot org @ 2006-07-12 13:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from mrs at gcc dot gnu dot org  2006-07-12 13:12 -------
Subject: Bug 28280

Author: mrs
Date: Wed Jul 12 13:12:08 2006
New Revision: 115369

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115369
Log:
        PR c/28280
        * c-parser.c (c_parser_typeof_specifier): Don't use
        c_finish_expr_stmt, open code desired semantics instead.

Added:
    trunk/gcc/testsuite/gcc.dg/vla-9.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-parser.c


-- 


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
                   ` (4 preceding siblings ...)
  2006-07-12 13:12 ` mrs at gcc dot gnu dot org
@ 2006-07-12 13:13 ` mrs at apple dot com
  2006-07-12 17:23 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mrs at apple dot com @ 2006-07-12 13:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from mrs at apple dot com  2006-07-12 13:13 -------
I have checked in a fix for this.


-- 


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
                   ` (5 preceding siblings ...)
  2006-07-12 13:13 ` mrs at apple dot com
@ 2006-07-12 17:23 ` pinskia at gcc dot gnu dot org
  2006-07-15 17:04 ` mrs at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-12 17:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-07-12 17:23 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
                   ` (6 preceding siblings ...)
  2006-07-12 17:23 ` pinskia at gcc dot gnu dot org
@ 2006-07-15 17:04 ` mrs at gcc dot gnu dot org
  2006-07-15 18:52 ` mrs at apple dot com
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mrs at gcc dot gnu dot org @ 2006-07-15 17:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from mrs at gcc dot gnu dot org  2006-07-15 17:03 -------
Subject: Bug 28280

Author: mrs
Date: Sat Jul 15 17:03:44 2006
New Revision: 115479

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115479
Log:
Revert:
        PR c/28280
        * c-parser.c (c_parser_typeof_specifier): Don't use
        c_finish_expr_stmt, open code desired semantics instead.

Removed:
    trunk/gcc/testsuite/gcc.dg/vla-9.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-parser.c


-- 


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
                   ` (7 preceding siblings ...)
  2006-07-15 17:04 ` mrs at gcc dot gnu dot org
@ 2006-07-15 18:52 ` mrs at apple dot com
  2006-07-15 18:58 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mrs at apple dot com @ 2006-07-15 18:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from mrs at apple dot com  2006-07-15 18:52 -------
THis bug should be reopened.


-- 


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
                   ` (8 preceding siblings ...)
  2006-07-15 18:52 ` mrs at apple dot com
@ 2006-07-15 18:58 ` pinskia at gcc dot gnu dot org
  2006-07-17  3:08 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-15 18:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pinskia at gcc dot gnu dot org  2006-07-15 18:58 -------
Reopening because Mike cannot do it himself as he does not know the trick of
using his @gcc.gnu.org. 


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
                   ` (9 preceding siblings ...)
  2006-07-15 18:58 ` pinskia at gcc dot gnu dot org
@ 2006-07-17  3:08 ` mmitchel at gcc dot gnu dot org
  2006-08-15 16:17 ` jsm28 at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-07-17  3:08 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
                   ` (10 preceding siblings ...)
  2006-07-17  3:08 ` mmitchel at gcc dot gnu dot org
@ 2006-08-15 16:17 ` jsm28 at gcc dot gnu dot org
  2006-08-15 18:01 ` mrs at gcc dot gnu dot org
  2006-08-15 18:04 ` pinskia at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2006-08-15 16:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jsm28 at gcc dot gnu dot org  2006-08-15 16:16 -------
The patch http://gcc.gnu.org/ml/gcc-patches/2006-07/txt00017.txt is OK.


-- 


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
                   ` (11 preceding siblings ...)
  2006-08-15 16:17 ` jsm28 at gcc dot gnu dot org
@ 2006-08-15 18:01 ` mrs at gcc dot gnu dot org
  2006-08-15 18:04 ` pinskia at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: mrs at gcc dot gnu dot org @ 2006-08-15 18:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from mrs at gcc dot gnu dot org  2006-08-15 18:01 -------
Subject: Bug 28280

Author: mrs
Date: Tue Aug 15 18:01:19 2006
New Revision: 116163

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116163
Log:
        PR c/28280
        * c-parser.c (c_parser_typeof_specifier): Don't use
        c_finish_expr_stmt, open code desired semantics instead.

Added:
    trunk/gcc/testsuite/gcc.dg/vla-9.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-parser.c


-- 


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


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

* [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof
  2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
                   ` (12 preceding siblings ...)
  2006-08-15 18:01 ` mrs at gcc dot gnu dot org
@ 2006-08-15 18:04 ` pinskia at gcc dot gnu dot org
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-15 18:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from pinskia at gcc dot gnu dot org  2006-08-15 18:04 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2006-08-15 18:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-06  9:14 [Bug debug/28280] New: [4.2 regression] bogus "statement with no effect" warning tbm at cyrius dot com
2006-07-06 14:51 ` [Bug c/28280] " pinskia at gcc dot gnu dot org
2006-07-06 15:12 ` [Bug c/28280] [4.2 regression] bogus "statement with no effect" warning with VLA and typeof pinskia at gcc dot gnu dot org
2006-07-06 15:13 ` pinskia at gcc dot gnu dot org
2006-07-08 10:10 ` mrs at apple dot com
2006-07-12 13:12 ` mrs at gcc dot gnu dot org
2006-07-12 13:13 ` mrs at apple dot com
2006-07-12 17:23 ` pinskia at gcc dot gnu dot org
2006-07-15 17:04 ` mrs at gcc dot gnu dot org
2006-07-15 18:52 ` mrs at apple dot com
2006-07-15 18:58 ` pinskia at gcc dot gnu dot org
2006-07-17  3:08 ` mmitchel at gcc dot gnu dot org
2006-08-15 16:17 ` jsm28 at gcc dot gnu dot org
2006-08-15 18:01 ` mrs at gcc dot gnu dot org
2006-08-15 18:04 ` pinskia at gcc dot gnu dot 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).