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,994 of 243,242   
   Andrey Tarasevich to Michael S   
   Re: UB or not UB? was: On Undefined Beha   
   13 Jan 26 08:11:15   
   
   From: noone@noone.net   
      
   On Mon 1/12/2026 9:36 AM, Michael S wrote:   
   > But I was interested in the "opinion" of C Standard rather than of gcc   
   > compiler.   
   > Is it full nasal UB or merely "implementation-defined behavior"?   
      
   It is full nasal UB per the standard. And, of course, it is as   
   "implementation-defined" as any other UB in a sense that the standard   
   permits implementations to _extend_ the language in any way they please,   
   as long as they don't forget to issue diagnostics when diagnostics are   
   required (by the standard).   
      
   >> Perhaps there's a switch in GCC that would outlaw the classic "struct   
   >> hack"... But in any case, it is not prohibited by default for   
   >> compatibility with pre-C99 code.   
   >>   
   >   
   > gcc indeed has something of this sort : -fstrict-flex-arrays=3   
   > But at the moment it does not appear to affect code generation [in this   
   > particular example].   
      
   Yeah... I tried both the command-line setting and the attribute. No   
   effect on the code though.   
      
   --   
   Best regards,   
   Andrey   
      
   --- 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