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]
Other format: [Raw text]

c/6800: bad warnings for flexible arrays



>Number:         6800
>Category:       c
>Synopsis:       bad warnings for flexible arrays
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 24 10:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     davem@redhat.com
>Release:        3.1
>Organization:
>Environment:
sparc-unknown-linux
>Description:
Operations, such as __typeof__(f->bar) warn
when the 'bar' member of 'f' is a flexible
array.

See attachment source, it warns:

? gcc -c -o flex.o flex.c
flex.c: In function `bar':
flex.c:8: array initialized from non-constant array expression
flex.c:8: storage size of `b' isn't known
>How-To-Repeat:
gcc -c -o flex.o flex.c
>Fix:
Shrug... don't use flexible arrays :-)
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="flex.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="flex.c"

c3RydWN0IGZvbyB7CglpbnQgeDsKCWludCBhW107Cn07Cgp2b2lkICpiYXIoc3RydWN0IGZvbyAq
cCkKewoJX190eXBlb2ZfXyhwLT5hKSBiID0gcC0+YTsKCglyZXR1cm4gYiArIDE7Cn0K


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