Commit eaf9234
committed
Fix discards const from pointer target
Since glibc-2.43 and ISO C23, the functions bsearch, memchr, strchr,
strpbrk, strrchr, strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr
that return pointers into their input arrays now have definitions as
macros that return a pointer to a const-qualified type when the input
argument is a pointer to a const-qualified type.
char * pointer returns are only being used for comparisons so declare
then as const, which matches the input variables.
Fixes:
../../../src/share/getopt/getopt.c: In function 'share___getopt_internal':
../../../src/share/getopt/getopt.c:781:18: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
781 | char *temp = my_index (optstring, c);
| ^~~~~~~~
../../../src/flac/utils.c: In function 'flac__utils_get_channel_mask_tag':
../../../src/flac/utils.c:485:20: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
485 | if(0 == (p = strchr((const char *)object->data.vorbis_comment.comments[offset].entry, '='))) /* should never happen, but just in case */
| ^
../../../src/flac/main.c: In function 'parse_option':
../../../src/flac/main.c:1137:43: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
1137 | p = strchr(option_argument, ',');
| ^
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>1 parent afb801b commit eaf9234
3 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1132 | 1132 | | |
1133 | 1133 | | |
1134 | 1134 | | |
1135 | | - | |
| 1135 | + | |
1136 | 1136 | | |
1137 | 1137 | | |
1138 | 1138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
781 | | - | |
| 781 | + | |
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
| |||
0 commit comments