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

Re: PATCH: BPs & cleanups for ARRAY_SIZE



  In message <msitsr22h4.fsf@mcgary.org>you write:
   > > Then, there's no violation of bounds if 'p' is stepped 27 times,
  > > instead of nested loops.
  > 
  > ISO/IEC 9899/1999 (E)
  > 
  >                        Programming languages  --  C
  > 
  > 	Annex J (informative)
  > 	Portability Issues
  > ...
  >        J.2  Undefined behavior
  > 
  >        The behavior is undefined in the following circumstances:
  > ...
  >          -- An  array  subscript is out of range, even if an object
  >             is apparently accessible with the given  subscript  (as
  >             in  the lvalue expression a[1][7] given the declaration
  >             int a[4][5]) (6.5.6).
Wow.  I never knew that.  Thanks for the info.  Consider your full patch
approved.
jeff


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