On Sat, 2023-07-08 at 12:33 -0400, Paul Smith wrote: > On Sat, 2023-07-08 at 17:30 +0200, Andreas Schwab wrote: > > That needs to be sysconf (_SC_SEM_VALUE_MAX), and thus is not > > suitable for a constexpr. > > Oh right, obviously. > > Well, I guess I'll have to try to figure out why it's not defined. > Sigh.
I figured it out. I'm sure it's such a weird problem no one else will hit it but just in case: In order to use clangd without errors I need to use the clangd intrinsics: clang can't parse the GCC intrinsics correctly. The clang limits.h uses #include_next <limits.h> which happens to find GCC's include-fixed/limits.h and includes it in such a way that it doesn't try to include the full system limits.h, so I only have the basics and not all the POSIX extensions etc. If I convince clangd to ignore BOTH the GCC intrinsics directory AND the GCC include-fixed directory, then everything works as expected.