[cfe-dev] Null pointer constants and the glibc tgmath.h
Eli Friedman
eli.friedman at gmail.com
Wed Feb 13 10:07:17 PST 2008
Testcase:
int a() {
*(0 ? (double *) 0 : (void *) !0.25) = 10;
}
clang rejects this with an error because the left-hand side has type
void; comeau and gcc accept it.
clang's behavior is pretty clearly correct per the standard; however,
the linux (glibc) tgmath.h expects that "(0 ? (double *) 0 : (void *)
!0.25)" has type double*, not void*. Therefore, making tgmath.h work
requires being non-compliant with C99.
Thoughts?
-Eli
More information about the cfe-dev
mailing list