[clang] [Clang] add ext warning for missing return in 'main' for C89 mode (PR #134617)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 7 05:54:04 PDT 2025
================
@@ -0,0 +1,6 @@
+/* RUN: %clang_cc1 -std=c89 -fsyntax-only -verify -pedantic -Wno-strict-prototypes %s
+ */
+
+int main() {
----------------
AaronBallman wrote:
You should also have a test where `main` does return a value to show that we silence the diagnostic, and another test along the lines of:
```
int main() {
if (1)
exit(1);
}
```
which should also silence the diagnostic.
https://github.com/llvm/llvm-project/pull/134617
More information about the cfe-commits
mailing list