-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed as not planned
Labels
c11enhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featureobsoleteIssues with old (unsupported) versions of LLVMIssues with old (unsupported) versions of LLVM
Description
This program:
#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
}compiled with clang -Wall -Wextra -std=c11 -pedantic-errors (llvm version 15.0.0) produces this output:
__STDC_IEC_559_COMPLEX__ is defined as 1
Imaginary types are NOT supportedISO 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), clang should either implement imaginary types
as defined in Annex G or remove the definition of __STDC_IEC_559_COMPLEX__.
Metadata
Metadata
Assignees
Labels
c11enhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featureobsoleteIssues with old (unsupported) versions of LLVMIssues with old (unsupported) versions of LLVM