public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108531] New: Imaginary types are not supported, violating ISO C Annex G
@ 2023-01-24 19:51 Keith.S.Thompson at gmail dot com
  2023-01-24 20:00 ` [Bug c/108531] " Keith.S.Thompson at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Keith.S.Thompson at gmail dot com @ 2023-01-24 19:51 UTC (permalink / raw)
  To: gcc-bugs

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

            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 <stdio.h>
#include <complex.h>
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=c11 -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. 
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__.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-26  1:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-24 19:51 [Bug c/108531] New: Imaginary types are not supported, violating ISO C Annex G Keith.S.Thompson at gmail dot com
2023-01-24 20:00 ` [Bug c/108531] " Keith.S.Thompson at gmail dot com
2023-01-24 20:06 ` pinskia at gcc dot gnu.org
2023-01-24 20:59 ` Keith.S.Thompson at gmail dot com
2023-01-25  7:16 ` sam at gentoo dot org
2023-01-25 18:16 ` Keith.S.Thompson at gmail dot com
2023-01-26  1:12 ` joseph at codesourcery dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).