home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,986 of 243,242   
   James Russell Kuyper Jr. to Scott Lurndal   
   Re: UB or not UB? was: On Undefined Beha   
   12 Jan 26 21:09:25   
   
   From: jameskuyper@alumni.caltech.edu   
      
   On 2026-01-12 15:02, Scott Lurndal wrote:   
   > Michael S  writes:   
   >> On Mon, 12 Jan 2026 15:58:15 +0000   
   >> bart  wrote:   
   >>   
   >>> On 12/01/2026 14:28, Michael S wrote:   
   ...   
   >>>> struct bar1 {   
   >>>>     int table[4];   
   >>>>     int other_table[4];   
   >>>> };   
   ...   
   >>> So you want to deliberately read one element past the end because you   
   >>> know it will be the first element of other_table?   
   >>>   
   >>   
   >> Yes. I primarily want it for multi-dimensional arrays.   
   >   
   > So declare it as int table[4][4].   
      
      
   Note that this suggestion does not make the behavior defined. It is   
   undefined behavior to make dereference table[0]+4, and it is undefined   
   behavior to make any use of table[0]+5.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca