From: tristan.wibberley+netnews2@alumni.manchester.ac.uk   
      
   On 12/01/2026 20:03, Tim Rentsch wrote:   
   > Michael S writes:   
      
   >> Do you have citation from the Standard?   
   >   
   > The short answer is section 6.5.6 paragraph 8.   
   >   
   > There is amplification in Annex J.2, roughly three pages after the   
   > start of J.2. You can search for "an array subscript is out of   
   > range", where there is a clarifying example.   
      
      
   That is "... /apparently/ /accessible/ ..." not "... /actually/   
   /present/ ..." and "... given the /declaration/ ..." not "... given the   
   /definition/ ..."   
      
   Annex J.2 is not an amplification but an inference. Fortunately there is   
   logic involved so statements are logical sums and logical products, the   
   logical sum of 1 with 1 is 1 as is the logical product, not 2 so no   
   amplification. An inference in a technical defining document from its   
   own definitions is just clarification, not amplification, and a sanity   
   check that might help find inconsistencies.   
      
   From 6.5.7:   
      
   "8 For the purposes of these operators, a pointer to an object that is   
   not an element of an array behaves   
   the same as a pointer to the first element of an array of length one   
   with the type of the object as its   
   element type.   
   9 When an expression that has integer type is added to or subtracted   
   from a pointer, the result has the   
   type of the pointer operand. If the pointer operand points to an element   
   of an array object, and the   
   array is large enough ..."   
      
   Combining these, and padding requirements, you can definedly reach   
   existing elements of multidimensional array objects. The pointer to the   
   first element of the first nested array is as good as a pointer to the   
   first element of a non-nested array through which you can reach the   
   elements in the second nested array if they exist. That depends on the   
   /definition/ of the array object, not on the /declaration/, hence the   
   inference whose conclusion was stated in J.2 regarding the   
   ineffectiveness of /declarations/.   
      
   --   
   Tristan Wibberley   
      
   The message body is Copyright (C) 2026 Tristan Wibberley except   
   citations and quotations noted. All Rights Reserved except that you may,   
   of course, cite it academically giving credit to me, distribute it   
   verbatim as part of a usenet system or its archives, and use it to   
   promote my greatness and general superiority without misrepresentation   
   of my opinions other than my opinion of my greatness and general   
   superiority which you _may_ misrepresent. You definitely MAY NOT train   
   any production AI system with it but you may train experimental AI that   
   will only be used for evaluation of the AI methods it implements.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|