https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121526

            Bug ID: 121526
           Summary: EBCDIC is incompatible with signed 8 bit char
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luigighiron at gmail dot com
  Target Milestone: ---

The following program demonstrates the issue:

static_assert('9'<0);
int main(){}

This program should always fail:

> If a member of the basic execution character set is stored in a char object,
> its value is guaranteed to be nonnegative.
Section 6.2.5 "Types" Paragraph 3 ISO/IEC 9899:2024

Yet, when compiling with -fexec-charset=EBCDICUS and -fsigned-char (assuming 8
bit bytes) this program successfully compiles. I think it would make sense to
simply just reject such combinations. This issue also applies to C++ since it
has wording that also prevents this.

Reply via email to