public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/67661] New: Wrong warning when declare VLAs: operation on 'b' may be undefined [-Wsequence-point]
@ 2015-09-21  6:19 leechung at 126 dot com
  2015-09-24  1:08 ` [Bug c/67661] Wrong warning when declare VLAs: operation on 'x' " leechung at 126 dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: leechung at 126 dot com @ 2015-09-21  6:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67661
           Summary: Wrong warning when declare VLAs: operation on 'b' may
                    be undefined [-Wsequence-point]
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: leechung at 126 dot com
  Target Milestone: ---

The following code produces a warning: operation on 'b' may be
undefined.[-Wsequence-point]

int x = 0, y [++ x], z [++ x];

But N1570 6.8 says:
A block allows a set of declarations and statements to be grouped into one
syntactic unit. The initializers of objects that have automatic storage
duration, and the variable length array declarators of ordinary identifiers
with block scope, are evaluated and the values are stored in the objects
(including storing an indeterminate value in objects without an initializer)
each time the declaration is reached in the order of execution, as if it were a
statement, and within each declaration in the order that declarators appear.

and 6.7.6 says:
A full declarator is a declarator that is not part of another declarator. The
end of a full declarator is a sequence point.


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

end of thread, other threads:[~2015-09-24 16:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-21  6:19 [Bug c/67661] New: Wrong warning when declare VLAs: operation on 'b' may be undefined [-Wsequence-point] leechung at 126 dot com
2015-09-24  1:08 ` [Bug c/67661] Wrong warning when declare VLAs: operation on 'x' " leechung at 126 dot com
2015-09-24  7:06 ` manu at gcc dot gnu.org
2015-09-24  8:14 ` frankhb1989 at gmail dot com
2015-09-24 16:23 ` joseph at codesourcery dot com
2015-09-24 16:25 ` mpolacek 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).