From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ADFDE3858D28; Tue, 24 Jan 2023 19:51:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADFDE3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674589864; bh=Q9KJfP5TYQL4nSqk1vIpnRb68wezcv1lUPqgoB0qO/o=; h=From:To:Subject:Date:From; b=K9riwnuUKyC4+B8JutT2r7uNmQ9QqpWNeHFtcH2MfujKPfHzIp6PorDsSLHYjU8SA zF7VdIBsLVHPpeEtj+XgAfRVnFsPL8vUs8CjqOaUswjZCpJTE1FAYTNWlwcTPI2H6D iEfvqC8/AetC8vWiAFvb3zqbzVN59jwvfaZssTQs= From: "Keith.S.Thompson at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108531] New: Imaginary types are not supported, violating ISO C Annex G Date: Tue, 24 Jan 2023 19:51:04 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: Keith.S.Thompson at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108531 Bug ID: 108531 Summary: Imaginary types are not supported, violating ISO C Annex G Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: Keith.S.Thompson at gmail dot com Target Milestone: --- #include #include int main(void) { #ifdef __STDC_IEC_559_COMPLEX__ printf("__STDC_IEC_559_COMPLEX__ is defined as %d\n", __STDC_IEC_559_COMPLEX__); #else printf("__STDC_IEC_559_COMPLEX__ is NOT defined\n"); #endif #ifdef _Imaginary_I printf("Imaginary types are supported\n"); #else printf("Imaginary types are NOT supported\n"); #endif } The output of this program, when compiled with "gcc -Wall -Wextra -std=3Dc11 -pedantic-errors" is: __STDC_IEC_559_COMPLEX__ is defined as 1 Imaginary types are NOT supported ISO C Annex G was informative in C99, but was made normative in C11.=20 Imaginary types are optional in C11, but are mandatory for any implementation that predefines __STDC_IEC_559_COMPLEX__. (Complex types were made optional in C11, but that's not relevant here.) To conform to C11 (and later), gcc should either implement imaginary types as defined in Annex G or remove the definition of __STDC_IEC_559_COMPLEX__.=