[all-commits] [llvm/llvm-project] 5ca40f: [BPF] Fix build warnings due to a static var in he...

yonghong-song via All-commits all-commits at lists.llvm.org
Tue Jul 22 16:37:32 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5ca40fa101df2b75e10c0c260192b653120a9b1d
      https://github.com/llvm/llvm-project/commit/5ca40fa101df2b75e10c0c260192b653120a9b1d
  Author: yonghong-song <yhs at fb.com>
  Date:   2025-07-22 (Tue, 22 Jul 2025)

  Changed paths:
    M llvm/lib/Target/BPF/BPF.h

  Log Message:
  -----------
  [BPF] Fix build warnings due to a static var in header file (#150128)

Simon Pilgrim ([1]) and Anton reported that the following warning will
appear when building clang compiler:
```
In file included from .../llvm-project/llvm/lib/Target/BPF/BPFASpaceCastSimplifyPass.cpp:9: .../llvm-project/llvm/lib/Target/BPF/BPF.h:25:20: warning: ‘llvm::BPF_TRAP’ defined but not used [-Wunused-variable]
   25 | static const char *BPF_TRAP = "__bpf_trap";
      |                    ^~~~~~~~
...
In file included from .../llvm-project/llvm/lib/Target/BPF/MCTargetDesc/BPFInstPrinter.cpp:14:
.../llvm-project/llvm/lib/Target/BPF/BPF.h:25:20: warning: ‘llvm::BPF_TRAP’ defined but not used [-Wunused-variable]
   25 | static const char *BPF_TRAP = "__bpf_trap";
      |                    ^~~~~~~~
...
```
Instead of using static const variable, use macro to silence warnings.

  [1] https://github.com/llvm/llvm-project/pull/131731



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