Hi,

I am a member of WG14 (the C standard committee) with a particular
interest in keeping the language specification suitable for smaller
compilers. TCC is the most well-known such compiler, so I hope I can
contribute.

While prototyping an implementation of the _Optional qualifier
described in N3422, I noticed something odd: whereas GCC and Clang
make __builtin_types_compatible_p ignore qualifiers on array elements,
TCC currently removes qualifiers only from the outer CType node.

That difference can be observed in Compiler Explorer:
https://godbolt.org/z/1oboWrn9e

The attached patch uses TCC's existing unqualified comparison function
recursively for arrays whilst continuing to treat qualifiers on
referenced types as significant. Three cases are added to the existing
built-in test. The full test suite passes on macOS 26.4.1 (arm64).

The patch was developed with help from Codex, but I have reviewed it
and take responsibility for the submission.

Please could you let me know the next steps?

Regards,
Christopher

Attachment: 0001-tccgen-match-GCC-for-qualified-array-types.patch
Description: Binary data

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to