[all-commits] [llvm/llvm-project] 506deb: [lldb] Fix GCC's `-Wreturn-type` warnings (#127974)

foxtran via All-commits all-commits at lists.llvm.org
Fri Feb 21 09:02:43 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 506deb0cce3fe503f61ef1a1a08a40770ef4b978
      https://github.com/llvm/llvm-project/commit/506deb0cce3fe503f61ef1a1a08a40770ef4b978
  Author: foxtran <39676482+foxtran at users.noreply.github.com>
  Date:   2025-02-21 (Fri, 21 Feb 2025)

  Changed paths:
    M lldb/source/DataFormatters/TypeSummary.cpp
    M lldb/source/ValueObject/DILLexer.cpp

  Log Message:
  -----------
  [lldb] Fix GCC's `-Wreturn-type` warnings (#127974)

This patch fixes `-Wreturn-type` warnings which happens if LLVM is built
with GCC compiler (14.1 is used for detecting)

Warnings:
```
llvm-project/lldb/source/ValueObject/DILLexer.cpp: In static member function ‘static llvm::StringRef lldb_private::dil::Token::GetTokenName(Kind)’:
llvm-project/lldb/source/ValueObject/DILLexer.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
   33 | }
      | ^
```
and:
```
llvm-project/lldb/source/DataFormatters/TypeSummary.cpp: In member function ‘virtual std::string lldb_private::TypeSummaryImpl::GetSummaryKindName()’:
llvm-project/lldb/source/DataFormatters/TypeSummary.cpp:62:1: warning: control reaches end of non-void function [-Wreturn-type]
   62 | }
      | ^
```

Technically, it is a bug in Clang (see #115345), however, UBSan with
Clang should detect these places, therefore it would be nice to provide
a return statement for all possible inputs (even invalid).



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