Re: A: a new bug to old plain C

LIU Hao via Gcc-help <[email protected]>
Newsgroups gmane.comp.gcc.help
Message-ID <[email protected]>
在 2025-11-27 18:28, Александр Поваляев 写道:
> 2) Second, there is no explicit prohibition of such conversion ("Foo**" -> "const Foo*const*const) in C 
> standard.

How hard for you would it be to comprehend that the paragraph which starts with 'one of the following 
shall hold' has a bold word 'Constraints' in front of it so your code is identified as a constraint 
violation and is such undefined behavior?

Oh maybe you are not willing to read the standard so I quote it for you:

    5.1.1.3 Diagnostics
    1 A conforming implementation shall produce at least one diagnostic message
      (identified in an implementation-defined manner) if a preprocessing
      translation unit or translation unit contains >>>>>>> a violation of any
      syntax rule or constraint <<<<<<<, even if the behavior is also explicitly
      specified as undefined or implementation-defined. Diagnostic messages need
      not be produced in other circumstances.


> 3) Half of well-known compilers don't treat such conversion ("Foo**" -> "const Foo*const*const) as an 
> error. They might show a warning or doesn't show it.

It's undefined behavior so compilers are free to accept it (with a warning) or reject it (with an error).


> 4) I showed a use-case where such conversion might be useful and why. I think all the participants have 
> read that post.

I understand it's useful. Right. But no matter how weird it looks, it's C. The standard says it's 
undefined behavior, and what you think does not matter, at, all.


> 5) IF WE ARE TALKING ABOUT UNIFYING OF C STANDARD IMPLEMENTATION OVER ALL THE COMPILERS AVAILABLE, WE 
> CAN'T MAKE A PROHIBITION AS A GENERAL RULE, SINCE
>      WE WILL FACE OUT BACK-COMPATIBILITY ISSUE WITH THE COMPILERS WHICH HAVE ALREADY HAD SUPPORT OF SUCH 
> CONVERSION.

So it seems that you are unable to agree with what others agree, you are proactively violating the C 
standard, and you are claiming that your disability is causing *your* issue. Oh, maybe that's just you.



-- 
Best regards,
LIU Hao
OpenPGP_signature.asc (application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEEYmSQWY4DEzq4FUs4hfveZl3ogBsFAmkoNiEFAwAAAAAACgkQhfveZl3ogBsS
7hAAl22jwdS6de+X42k6IjOzoyG1POsqq2wfrzLTTJRNc9SQu6EZrHUU2aGlRlwZq/ftViHiO0Le
EduELTmeZF6C9rylgDmBTVWBsNIXYph3hayJ0avpXiwO+g2D6zjeqJCNO9RgvKRHaUhFZF2zwgAw
+DCAt3pdQXwhBpFNSLfTBsMrSfuYkHi4XNLieDw3613/sz3/hHFiG/BpiPup/2cl5w8o52TKkmMC
uLC2+wuosBLsmde9uWHPu86xZAP5clDqtTU/1LnZUsHMgzw6ln+Ct5eONuXlbvQ3fRvGDCMfV5O9
SzlBBD4BX+EIKE4/BO4uQDGf1RMBTrZvTWPMTqQ/KxA9RFRItWPRSrCt1qeFijA8e7gnu+tB4UQy
CiYNGwzEqLtFPh7byto8cFDTv8IylH2D8UwYZIgly8GX1Pf9pk89KZEUHtwiX9jx+fEXewKMsfNi
hwZkK6C8wwl7eilvwfvokClYX8wHPwlUroJOGuWwjnMOAAJBhkRquww77OSKh/RFZUc+/19Ru9I/
8Nt6MNzgH6RfKsK723lhW0v7GzuI03Z0RkPpAvyVMt/xLsnrwoMY8X55olr/bxAfx/YYwq62h6V4
nf1KDqkvCBwI7+z/y91WLXTWkgBLQhZOyE5C1WJDj7lYtUOGbUva8gDGyhE6on7sYcsY11QdoZcJ
o/g=
=TTIT
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.