Force -Werror=strict-prototypes so that C API tests fail to compile if
we add a non-prototype declaration. This should help avoid regressions
like bddecba4b333f7772029b4937d2c34f9f2fda6ca was fixing.
Details
Diff Detail
Event Timeline
Note that we have C files including these headers in llvm/tools/llvm-c-test and clang/tools/c-index-test, and I tested that dropping a (void) to just () triggers the error when compiling those.
clang/include/clang-c/ExternC.h | ||
---|---|---|
19–20 | I think this needs some extra compiler guards, unfortunately. I don't think MSVC supports _Pragma (IIRC, they rather oddly decided to call it __pragma instead). Do we want to restrict this pragma to only clang compilers? Do we need to do something to support GCC as well? |
clang/include/clang-c/ExternC.h | ||
---|---|---|
19–20 | Thanks for pointing this out; guarded against _MSC_VER in the updated diff. Supporting GCC as a follow-up sounds nice to me if someone is interested in sorting that out, but covering it in Clang like this is sufficient to get our bots to reject commits that regress. |
godbolt.org says that GCC doesn't have -Wunknown-pragmas by default, but it is in -Wall. I'd better guard this more closely with __clang__.
I think this needs some extra compiler guards, unfortunately. I don't think MSVC supports _Pragma (IIRC, they rather oddly decided to call it __pragma instead). Do we want to restrict this pragma to only clang compilers? Do we need to do something to support GCC as well?