[all-commits] [llvm/llvm-project] 9f4630: [Clang] add ext warning for missing return in 'mai...

Oleksandr T. via All-commits all-commits at lists.llvm.org
Tue Apr 8 13:22:17 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9f463056e6dd5ff94d35f8cc1f4aa4ecc87fa61d
      https://github.com/llvm/llvm-project/commit/9f463056e6dd5ff94d35f8cc1f4aa4ecc87fa61d
  Author: Oleksandr T. <oleksandr.tarasiuk at outlook.com>
  Date:   2025-04-08 (Tue, 08 Apr 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/AnalysisBasedWarnings.cpp
    M clang/lib/Sema/SemaDecl.cpp
    A clang/test/Sema/main-no-return-c89-1.c
    A clang/test/Sema/main-no-return-c89-2.c
    A clang/test/Sema/main-no-return-c89-3.c

  Log Message:
  -----------
  [Clang] add ext warning for missing return in 'main' for C89 mode (#134617)

Fixes #21650 

--- 

Clang currently inserts an implicit `return 0;` in `main()` when
compiling in `C89` mode, even though the `C89` standard doesn't require
this behavior. This patch changes that behavior by emitting a warning
instead of silently inserting the implicit return under `-pedantic`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list