Re: [PATCH 1/4] gprof: Fix discarded-qualifiers problems in source.c
Project / Subsystem
binutils / gprof
Date
2026-04-26
Proposer
Simon Marchi <simon.marchi@polymtl.ca>
Source type
public_inbox
Consensus
Proposed
Sentiment
—/10
All attributes
- project
- binutils
- subsystem
- gprof
- patch_id
- —
- discussion_id
- 2f5264b0-9152-4085-8936-e476512557f9@polymtl.ca
- source_type
- public_inbox
- title
- Re: [PATCH 1/4] gprof: Fix discarded-qualifiers problems in source.c
- headline
- gprof: Fix discarded-qualifiers problems in source.c
- tldr
- Fixes discarded-qualifiers errors in gprof's source.c due to qualifier-preserving strchr().
- proposer
- Simon Marchi <simon.marchi@polymtl.ca>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- —
- technical_tradeoffs
- []
- series_id
- binutils:gprof: fix discarded-qualifiers problems in source.c
- series_role
- reply
- series_parts
- []
- tags
-
- • gprof
- • profiler
- • const
- • strchr
- • build error
- bugzilla_url
- —
- date
- 2026-04-26T00:00:00.000Z
Re: [PATCH 1/4] gprof: Fix discarded-qualifiers problems in source.c
This patch addresses -Wdiscarded-qualifiers errors in source.c within the gprof profiler. The errors are caused by the qualifier-preserving behavior of strchr(). The patch declares local pointer variables as const to avoid discarding the const qualifier. Simon Marchi notes that the cast to const char * is unnecessary, and variable bslash at line 187 also needs to be changed.