A: a new bug to old plain C

LIU Hao lh_mouse@126.com
Wed Nov 26 10:03:59 GMT 2025


在 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20251126/c6f6a4be/attachment.sig>


More information about the Gcc-help mailing list