Issue 149000
Summary libc: compile with -Werror=missing-prototypes (-Werror=missing-declarations)
Labels libc
Assignees
Reporter frobtech
    libc code (and tests) should be compiled with the GCC `-Wmissing-declarations` and `-Wmissing-variable-declarations` switches for both C and C++, the GCC `-Wmissing-prototypes` switch for C (only); and the Clang `-Wmissing-prototypes` and `-Wmissing-variable-declarations` switches for both C and C++.  These diagnose global or namespace-scope things being defined without prior declaration.  This is a good way to catch things that are defined in a source (`.cpp`) file at namespace scope but should either be defined `inline` in a header or should be defined with internal linkage via an anonymous namespace in the source file.

The code today has several such bugs that later manifest as multiple-definition errors.  We should make sure that all those get fixed so we can change the cmake configuration to make these blocking errors on the presubmit bots.  We can't make the cmake change now because there are several violations. https://github.com/llvm/llvm-project/pull/147408 is fixing some of those, but there are more.

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to