This is the mail archive of the gcc-bugs@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]

[Bug c/47418] warning: array subscript is above array bounds at O2 with sin6_addr


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

--- Comment #1 from Dan McGee <dpmcgee at gmail dot com> 2011-01-23 00:15:29 UTC ---
Also of note is the commented bit in the test case- if you instead dereference
the s6_addr bit of the union, it all works without warnings.

In the preprocessed source, replace
  ap = (char *)&u.sin6.sin6_addr;

with:
  ap = (char *)&u.sin6.sin6_addr.__in6_u.__u6_addr8;


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