[PATCH v2 0/5] sim: Suppress warnings if built with Clang
Tsukasa OI
research_trasio@irq.a4lg.com
Sun Sep 25 08:42:01 GMT 2022
Hello,
This is the version 2 patchset to suppress Clang compiler warnings
(causes a build failure due to default -Werror).
[Background]
When we build Binutils and GDB with Clang, it causes a build failure due to
warnings generated by Clang and the default -Werror configuration.
I finally managed to make ALL ARCHITECTURE ENABLED Binutils and GDB
-Werror-free on Clang 15.0.0 (note that this does not necessarily mean
warning-free) and this patchset is a part of it (common simulator part
except the printf-like functions).
Full Clang 15.0.0 -Werror-free branch is available at:
<https://github.com/a4lg/binutils-gdb/tree/clang-nowarn-dev>
[About this Patchset]
This patchset contains four five fixes to the files under sim{,/common}.
Each contains minor fixes to suppress Clang / GCC warnings.
Each change is detailed in the each patch.
[Changes: v1 -> v2]
- Commit messages are improved
- PATCH v1 1/4 is Moved to another patchset
- PATCH v1 2-4/4 -> PATCH v2 1-3/5
- New: Check known getopt definition on sim (PATCH v2 4/5)
This test is already performed on binutils, gas, gprof and ld and this
commit does the same to sim.
- New: Initialize pbb_br_* by default (PATCH v2 5/5)
It did not generate warnings on Clang but GCC creates some warnings
(although those are not reported as errors).
This is due to uninitialized pbb_br_* variables and this commit fixes
the issue by initializing them by a harmless value.
Thanks,
Tsukasa
Tsukasa OI (5):
sim: Remove self-assignments
sim: Make WITH_{TRACE,PROFILE}-based macros bool
sim: Suppress non-literal printf warning
sim: Check known getopt definition existence
sim: Initialize pbb_br_* by default
sim/common/genmloop.sh | 8 ++++----
sim/common/hw-tree.c | 2 --
sim/common/sim-hw.c | 3 +++
sim/common/sim-profile.h | 12 ++++++------
sim/common/sim-trace.h | 4 ++--
sim/config.h.in | 3 +++
sim/configure | 32 ++++++++++++++++++++++++++++++++
sim/configure.ac | 10 ++++++++++
8 files changed, 60 insertions(+), 14 deletions(-)
base-commit: 58d69206b8173b9d027a6c65f56cdaf045ae6e64
--
2.34.1
More information about the Gdb-patches
mailing list