[libcxx-commits] [libcxx] [libc++] Simplify the implementation of <stddef.h> (PR #86843)

Nico Weber via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 10 06:13:15 PDT 2024


================
@@ -36,16 +24,19 @@
 
 */
 
-#  include <__config>
+#include <__config>
+
+// Note: This include is outside of header guards because we sometimes get included multiple times
+//       with different defines and the underlying <stddef.h> will know how to deal with that.
+#include_next <stddef.h>
----------------
nico wrote:

Thanks for the fix!

> Is -Wgnu-include-next enabled by default?

No. Apparently someone over here thought it'd be good to compile some of our files with `-pedantic`, which enables `-Wgnu`.

> Why did we not see this anywhere else?

I don't know how libc++ tests run. Maybe there isn't a test that includes all public headers with `-Wall -Wconversion -Wextra -pedantic -Werror`? Does libc++ have any policy which warning levels it's clean at? Probably not really needed since all its headers are supposed to be system headers which disable warnings, so the test could and probably should even use -Weverything with clang.

https://github.com/llvm/llvm-project/pull/86843


More information about the libcxx-commits mailing list