Skip to content

Backport fixes for -Wdiscarded-qualifiers and -Wnonnull with newer glibc

Shreenidhi Shedi stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest18 patches 3 repliesIn review
  2. v118 patches 1 replySuperseded

Changes in v2 from the cover letter

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18libbpf: Fix -Wdiscarded-qualifiers under C23tools/lib/bpf/libbpf.c+1 -10 replies
2/18perf diff: Constify strchr() return variablestools/perf/builtin-diff.c+5 -70 replies
3/18perf test bpf: Address error about non-null argument for epoll_pwait 2nd argtools/perf/tests/bpf.c+2 -10 replies
4/18perf list: Fix -Wdiscarded-qualifiers under C23tools/perf/builtin-list.c+2 -10 replies
5/18perf trace: Deal with compiler const checkstools/perf/builtin-trace.c+1 -10 replies
6/18perf tools: Use const for variables receiving str{str,r?chr}() returnstools/perf/jvmti/libjvmti.c tools/perf/util/evlist.c+3 -20 replies
7/18perf parse-events: Fix -Wdiscarded-qualifiers under C23tools/perf/util/print-events.c+2 -20 replies
8/18perf tools: Remove unused color_fwrite_linestools/perf/util/color.c tools/perf/util/color.h+0 -290 replies
9/18perf strlist: Don't write to const memorytools/perf/util/strlist.c+8 -40 replies
10/18perf metricgroup: Constify variables storing the result of strchr() on const tablestools/perf/util/metricgroup.c+1 -20 replies
11/18perf session: Don't write to memory pointed to a const pointertools/perf/util/session.c+3 -30 replies
12/18perf trace-event: Constify variables storing the result of strchr() on const tablestools/perf/util/trace-event-info.c+1 -10 replies
13/18perf units: Constify variables storing the result of strchr() on const tablestools/perf/util/units.c+1 -10 replies
14/18perf bpf: Fix -Wdiscarded-qualifiers under C23tools/perf/util/bpf-loader.c+1 -10 replies
15/18perf time-utils: Constify variables storing the result of strchr() on const tablestools/perf/util/time-utils.c+2 -20 replies
16/18perf demangle-java: Constify variables storing the result of strchr() on const tablestools/perf/util/demangle-java.c+1 -10 replies
17/18perf parse-events:: Fix -Wdiscarded-qualifiers under C23tools/perf/util/parse-events.c+1 -10 replies
18/18perf bpf-event: Constify variables storing the result of strchr() on const tablestools/perf/util/bpf-event.c+2 -10 replies

Reviews trailers per patch

4 of 18 patches have a Reviewed-by or Acked-by.

PatchIan Rogers
1/18
2/18R-b
3/18
4/18
5/18R-b
6/18R-b
7/18
8/18R-b
9/18
10/18
11/18
12/18
13/18
14/18
15/18
16/18
17/18
18/18

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH 6.1.y v2 00/18] Backport fixes for -Wdiscarded-qualifiers and -Wnonnull with newer glibc

Hi all,

This patch series backports a number of patches from master to 6.1.y to fix -Wdiscarded-qualifiers and -Wnonnull build issues with newer glibc versions.

I will port these changes to other stable trees once this gets reviewed.

Arnaldo Carvalho de Melo (12):
perf diff: Constify strchr() return variables
perf test bpf: Address error about non-null argument for epoll_pwait
2nd arg
perf trace: Deal with compiler const checks
perf tools: Use const for variables receiving str{str,r?chr}() returns perf strlist: Don't write to const memory
perf metricgroup: Constify variables storing the result of strchr() on
const tables
perf session: Don't write to memory pointed to a const pointer perf trace-event: Constify variables storing the result of strchr() on
const tables
perf units: Constify variables storing the result of strchr() on const
tables
perf time-utils: Constify variables storing the result of strchr() on
const tables
perf demangle-java: Constify variables storing the result of strchr()
on const tables
perf bpf-event: Constify variables storing the result of strchr() on
const tables

Dr. David Alan Gilbert (1):
perf tools: Remove unused color_fwrite_lines

Mikhail Gavrilov (1):
libbpf: Fix -Wdiscarded-qualifiers under C23

The following patches by me are branch specific. Upstream code is refactored and the troubling piece of code is not there anymore.

Shreenidhi Shedi (4):
perf list: Fix -Wdiscarded-qualifiers under C23 perf parse-events: Fix -Wdiscarded-qualifiers under C23 perf bpf: Fix -Wdiscarded-qualifiers under C23 perf parse-events:: Fix -Wdiscarded-qualifiers under C23

 tools/lib/bpf/libbpf.c             |  2 +-
 tools/perf/builtin-diff.c          | 12 +++++-------
 tools/perf/builtin-list.c          |  3 ++-
 tools/perf/builtin-trace.c         |  2 +-
 tools/perf/jvmti/libjvmti.c        |  2 +-
 tools/perf/tests/bpf.c             |  3 ++-
 tools/perf/util/bpf-event.c        |  3 ++-
 tools/perf/util/bpf-loader.c       |  2 +-
 tools/perf/util/color.c            | 28 ----------------------------
 tools/perf/util/color.h            |  1 -
 tools/perf/util/demangle-java.c    |  2 +-
 tools/perf/util/evlist.c           |  3 ++-
 tools/perf/util/metricgroup.c      |  3 +--
 tools/perf/util/parse-events.c     |  2 +-
 tools/perf/util/print-events.c     |  4 ++--
 tools/perf/util/session.c          |  6 +++---
 tools/perf/util/strlist.c          | 12 ++++++++----
 tools/perf/util/time-utils.c       |  4 ++--
 tools/perf/util/trace-event-info.c |  2 +-
 tools/perf/util/units.c            |  2 +-
 20 files changed, 37 insertions(+), 61 deletions(-)

v1:
https://lore.kernel.org/all/[email protected]/

v2:
Address comment from Greg
https://lore.kernel.org/all/2026051001-jacket-reliance-3ec6@gregkh/

Signature · 1 line
2.54.0