Date: Thu, 15 Apr 2021 17:26:10 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 254714] include <math.h> contains a c11 extension Message-ID: <bug-254714-227-Cklegp9ZB1@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-254714-227@https.bugs.freebsd.org/bugzilla/> References: <bug-254714-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254714 --- Comment #5 from commit-hook@FreeBSD.org --- A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D7abb639572d847d4c5ff134f4441cb394= 47b3c9c commit 7abb639572d847d4c5ff134f4441cb39447b3c9c Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2021-04-08 11:13:15 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2021-04-15 16:51:08 +0000 Avoid -pedantic warnings about using _Generic in __fp_type_select When compiling parts of math.h with clang using a C standard before C11, and using -pedantic, it will result in warnings similar to: bug254714.c:5:11: warning: '_Generic' is a C11 extension [-Wc11-extensi= ons] return !isfinite(1.0); ^ /usr/include/math.h:111:21: note: expanded from macro 'isfinite' ^ /usr/include/math.h:82:39: note: expanded from macro '__fp_type_select' ^ This is because the block that enables use of _Generic is conditional not only on C11, but also on whether the compiler advertises support for C generic selections via __has_extension(c_generic_selections). To work around the warning without having to pessimize the code, use the __extension__ keyword, which is supported by both clang and gcc. While here, remove the check for __clang__, as _Generic has been supported for a long time by gcc too now. Reported by: yuri PR: 254714 lib/msun/src/math.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --=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-254714-227-Cklegp9ZB1>