This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/461: non-lvalue arrays



>Number:         461
>Category:       c
>Synopsis:       non-lvalue arrays
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 10 04:06:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Joseph S. Myers
>Release:        2.96
>Organization:
none
>Environment:
System: Linux decomino 2.2.16 #1 Thu Jun 8 00:26:22 UTC 2000 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
>Description:

In C90, non-lvalue arrays do not decay to pointers; in C99, they do
(except in those places where arrays do not decay to pointers anyway).
Though GCC allows use of non-lvalue arrays as an extension in some
cases, not all cases are allowed and -pedantic gives warnings without
depending on the standard version.

Undefined behavior does arise if the non-lvalue array is modified at
all, or accessed after the next sequence point, but subject to that
the decay to a pointer is legitimate.

Non-lvalue arrays arise, for example, from structures that are the
values of function calls or assignments.

>How-To-Repeat:

See gcc.dg/c99-array-lval-1.c, currently XFAILing (or would be if it
didn't get tree-check errors - c/351 - instead).

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]