From: tr.17687@z991.linuxsc.com   
      
   Andrey Tarasevich writes:   
      
   > On Wed 1/7/2026 8:17 AM, Andrey Tarasevich wrote:   
   >   
   >> which is related to how qualifications are treated under   
   >> _Generic`. `_Generic` operates on "exact match" basis not on "type   
   >> compatibility" basis. Which is why such matters suddenly become   
   >> important.   
   >   
   > No, I take it back. `_Generic` chooses its branches based on type   
   > compatibility.   
      
   Right. For _Generic, top-level qualifiers are dropped (IIUC).   
      
   Incidental comment: the discussion in DR 423 leaves much to be   
   desired.   
      
   > In that case it raises an interesting question: why does the C   
   > standard keeps sticking to this, i.e. keeps persistent top-level   
   > qualifiers on function parameters? Why not switch to C++-like approach   
   > and just discard such qualifiers at the parameter type adjustment   
   > stage? Especially now, after C17 started to explicitly do this with   
   > the return type.   
      
   My guess is that's a consequence of the processes used to write the   
   ISO C standard and to modify the ISO C standard. A lot of work goes   
   into both writing the text initially and revising the text later when   
   a change is needed (talking about a change to the text, which could be   
   either a modification of an earlier semantics or a clarification of an   
   earlier semantics). Sometimes there is a sense that a smaller change   
   would mean less work and also a smaller chance of unintended problems   
   (and errors), so a smaller change is chosen even though the end result   
   is less attractive. Perhaps that happened here, in much the same way   
   that modifying source code might choose an easier path locally to the   
   detriment of some larger overall aesthetic.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|