Skip to contentSkip to conversation

perf build: Add -funsigned-char to default CFLAGS

PATCH Applied Ian Rogers 2 participants 6 messages Mar 6 – Apr 1 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf build: Add -funsigned-char to default CFLAGS

Commit 3bc753c06dd0 ("kbuild: treat char as always unsigned") made chars unsigned by default in the Linux kernel. To avoid similar kinds of bugs and warnings, make unsigned chars the default for the perf tool.

---
 tools/perf/Makefile.config | 1 +
 1 file changed, 1 insertion(+)
tools/perf/Makefile.config +1 -0
index a8dc72cfe48e..3820bdf73f43 100644
@@ -349,6 +349,7 @@ CORE_CFLAGS += -fno-omit-frame-pointer
 CORE_CFLAGS += -Wall
 CORE_CFLAGS += -Wextra
 CORE_CFLAGS += -std=gnu11
+CORE_CFLAGS += -funsigned-char
 
 CXXFLAGS += -std=gnu++17 -fno-exceptions -fno-rtti
 CXXFLAGS += -Wall
Signature · 1 line
2.53.0.473.g4a7958ca14-goog
author reviewer
#1 lore raw
Quoted 6 lines · Ian Rogers

Commit 3bc753c06dd0 ("kbuild: treat char as always unsigned") made chars unsigned by default in the Linux kernel. To avoid similar kinds of bugs and warnings, make unsigned chars the default for the perf tool.

Ping.

Thanks,
Ian

Quoted 19 lines
---
 tools/perf/Makefile.config | 1 +
 1 file changed, 1 insertion(+)
tools/perf/Makefile.config +1 -1
index a8dc72cfe48e..3820bdf73f43 100644
@@ -349,6 +349,7 @@ CORE_CFLAGS += -fno-omit-frame-pointer
 CORE_CFLAGS += -Wall
 CORE_CFLAGS += -Wextra
 CORE_CFLAGS += -std=gnu11
+CORE_CFLAGS += -funsigned-char
 
 CXXFLAGS += -std=gnu++17 -fno-exceptions -fno-rtti
 CXXFLAGS += -Wall
--

2.53.0.473.g4a7958ca14-goog

maintainer
#2 lore raw
Quoted 7 lines · Ian Rogers
Quoted 6 lines · Ian Rogers

Commit 3bc753c06dd0 ("kbuild: treat char as always unsigned") made chars unsigned by default in the Linux kernel. To avoid similar kinds of bugs and warnings, make unsigned chars the default for the perf tool.

Do you know what the actual bug was?

Thanks,
Namhyung

Quoted 20 lines
Quoted 20 lines
---
 tools/perf/Makefile.config | 1 +
 1 file changed, 1 insertion(+)
tools/perf/Makefile.config +1 -1
index a8dc72cfe48e..3820bdf73f43 100644
@@ -349,6 +349,7 @@ CORE_CFLAGS += -fno-omit-frame-pointer
 CORE_CFLAGS += -Wall
 CORE_CFLAGS += -Wextra
 CORE_CFLAGS += -std=gnu11
+CORE_CFLAGS += -funsigned-char
 
 CXXFLAGS += -std=gnu++17 -fno-exceptions -fno-rtti
 CXXFLAGS += -Wall
--

2.53.0.473.g4a7958ca14-goog

author reviewer
#3 lore raw
Quoted 11 lines · Namhyung Kim
Quoted 7 lines · Ian Rogers
Quoted 6 lines · Ian Rogers

Commit 3bc753c06dd0 ("kbuild: treat char as always unsigned") made chars unsigned by default in the Linux kernel. To avoid similar kinds of bugs and warnings, make unsigned chars the default for the perf tool.

Do you know what the actual bug was?

I don't, my motivation was to try to avoid sashiko warnings about issues that occur with signed chars.

Thanks,
Ian

Quoted 23 lines

Thanks,
Namhyung

Quoted 20 lines
Quoted 20 lines
---
 tools/perf/Makefile.config | 1 +
 1 file changed, 1 insertion(+)
tools/perf/Makefile.config +1 -1
index a8dc72cfe48e..3820bdf73f43 100644
@@ -349,6 +349,7 @@ CORE_CFLAGS += -fno-omit-frame-pointer
 CORE_CFLAGS += -Wall
 CORE_CFLAGS += -Wextra
 CORE_CFLAGS += -std=gnu11
+CORE_CFLAGS += -funsigned-char
 
 CXXFLAGS += -std=gnu++17 -fno-exceptions -fno-rtti
 CXXFLAGS += -Wall
--

2.53.0.473.g4a7958ca14-goog

author reviewer
#4 lore raw
Quoted 10 lines · Ian Rogers
Quoted 8 lines · Namhyung Kim
Quoted 6 lines · Ian Rogers
Quoted 5 lines · Ian Rogers

Commit 3bc753c06dd0 ("kbuild: treat char as always unsigned") made chars unsigned by default in the Linux kernel. To avoid similar kinds of bugs and warnings, make unsigned chars the default for the perf tool.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

Do you know what the actual bug was?

I don't, my motivation was to try to avoid sashiko warnings about issues that occur with signed chars.

Ping.

Thanks,
Ian

Quoted 26 lines

Thanks,
Ian

Quoted 23 lines

Thanks,
Namhyung

Quoted 20 lines
Quoted 20 lines
---
 tools/perf/Makefile.config | 1 +
 1 file changed, 1 insertion(+)
tools/perf/Makefile.config +1 -1
index a8dc72cfe48e..3820bdf73f43 100644
@@ -349,6 +349,7 @@ CORE_CFLAGS += -fno-omit-frame-pointer
 CORE_CFLAGS += -Wall
 CORE_CFLAGS += -Wextra
 CORE_CFLAGS += -std=gnu11
+CORE_CFLAGS += -funsigned-char
 
 CXXFLAGS += -std=gnu++17 -fno-exceptions -fno-rtti
 CXXFLAGS += -Wall
--

2.53.0.473.g4a7958ca14-goog

maintainer Applied
#5 lore raw
In reply to Ian Rogers
Quoted 5 lines · Ian Rogers

Commit 3bc753c06dd0 ("kbuild: treat char as always unsigned") made chars unsigned by default in the Linux kernel. To avoid similar kinds of bugs and warnings, make unsigned chars the default for the perf tool.

Applied to perf-tools-next, thanks!

Best regards,
Namhyung