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-26 17:57, Александр Поваляев 写道:
> Your mentioned the following text snippet from C standard:
> "
> 6.7.4 Type qualifiers
>      6.7.4.1 General
> 
>      11 For two qualified types to be compatible, both shall have >>>>>>> the
>         identically qualified version <<<<<<< of a compatible type; the order of
>         type qualifiers within a list of specifiers or qualifiers does not affect the
>         specified type.
> ".
> 
> So, the last code sample does a conversion between "non compatible" types without any error or warning.
> 

Those types are not compatible. => This is correct.

But the conversion is allowed by the second quoted paragraph. Although those pointers point to 
incompatible types, the conversion happens as a simple assignment, so qualified compatible types are also 
allowed. (The left operand can't have fewer qualifiers than the right operand.)



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

wsF5BAABCAAjFiEEYmSQWY4DEzq4FUs4hfveZl3ogBsFAmkm0I8FAwAAAAAACgkQhfveZl3ogBvi
6A/7BOz+4hH/tffk3IfmRXlx71wiEtoyJU/9FgsqTYvd+T0oTPy6Cs3E3MPz1QWx+XA26hQiGNRH
EpLQyitquH8LE2AP53dLn2zxpm5MgdpgR3SljWSkTt809621kuBL3qOegxkN57zg/qwmGwftUayL
n69YK5tzmuMpq6MPD5iw4XmzqIvdJq3LCmThRak2s/np7qC6sQf1NnYfhhJpGtiiNnoSsmmkf8p3
QYi+3Gfhw5ZX7JUZZwEUDzYnA+CFhk1XZEo101E5XdA8pIUPoTdVnNF6SKIZ79LlcGKZQf6cZUvw
3yMVX4twr2uqWLjP767c0zlIv8lteD4zGXGQd0YYy+STnFfgtR/mD34zkckNAVWCEID1C5GG/Dtx
9MoYsnq7JXb/hTqPVW0WEOPAd/w5sV+GTtWXv41NF7aNnUMdTm9q6uy/q/7rxFBXqptwz8jgnDLX
XVXN1KHhZAXM2+VK8ojJXvRmD/WOa3nujGkUT1Fe2ZUkmCQ5NXGgrl/UPEwEglITBvMklXlzouy5
JzJdAG6BSkD99LamokfxOPqsMIZFyOmXS10JjoieoIaS7KkBo0dXEPnTyK2W9SOrlkKdKq0T2HfC
X+HU4Ld1ltnm+5rd5WBxoYZVwJ2qz/aCVjbVSvk4TOnPj6QUehKVPhzwXfLKb7ul+al+r3QpytmL
96s=
=7OLo
-----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.