Date: Fri, 14 Apr 2017 15:48:41 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-standards@FreeBSD.org Subject: [Bug 218657] Usage of I (_Complex_I) from complex.h results in unexpected warnings with clang -pedantic Message-ID: <bug-218657-15@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D218657 Bug ID: 218657 Summary: Usage of I (_Complex_I) from complex.h results in unexpected warnings with clang -pedantic Product: Base System Version: 9.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: standards Assignee: freebsd-standards@FreeBSD.org Reporter: akari@alienslab.net Created attachment 181784 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D181784&action= =3Dedit the test program Compile the attached test program with: clang -std=3Dc11 -pedantic test.c -= o test This is expected to compile without warnings. However, it produces an "imaginary constants is a GNU extension" warning on FreeBSD. This is because _Complex_I is defined as ((float _Complex)1.0i) in /usr/include/complex.h. The easiest workaround would be to use __extension__ to suppress the warnin= g, i.e. redefine _Complex_I as (__extension__ (float _Complex)1.0i). This is w= hat glibc does as well. It's a minor issue, but it prevents a project I'm working on from building = with -Wall on FreeBSD. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-218657-15>