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,132 of 243,242   
   Michael S to Philipp Klaus Krause   
   Re: What is the meaning of array paramet   
   25 Nov 25 16:04:41   
   
   From: already5chosen@yahoo.com   
      
   On Tue, 25 Nov 2025 14:28:39 +0100   
   Philipp Klaus Krause  wrote:   
      
   > Since C99 we have four types of array parameters:   
   >   
   > []   
   > [assignment-expression]   
   > [static assignment-expression]   
   > [*]   
   >   
   > But what is their meaning? They're all compatible, they all decay to   
   > pointers anyway. Only to [static assignment-expression] does the   
   > standard give a little bit of extra formal meaning, by making it UB   
   > when a too-short array is passed.   
   >   
   > They exist, they are different types, but the standard does not give   
   > them meaning (with the exception noted above). So people using them   
   > must have a motivation beyond what is explicitly stated in the   
   > standard, and thus an idea of what the meaning of these would or   
   > should be.   
   >   
   > Philipp   
   >   
      
   May be, The Standard could allow (or even recommend?) diagnostic for   
   code like below?   
   int foo(int prm[2])   
   {   
     return prm[2];   
   }   
      
   Other than that, there is hardly any meaning.   
      
   --- 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