Skip to contentSkip to conversation

fix discards const from pointer target

DISCUSSION GitHub pull_request - opened 1 participant 1 message Feb 20 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

alsa-project/alsa-lib pull request #496 was opened from heitbaum:

Since glibc-2.43:

For 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.

https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html

fixes:

```c

../../../src/seq/seqmid.c: In function 'snd_seq_parse_address':
../../../src/seq/seqmid.c:449:24: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  449 |                 if ((p = strpbrk(arg, ":.")) != NULL) {
      |                        ^
../../../src/ucm/main.c: In function 'snd_use_case_get_list':
../../../src/ucm/main.c:2396:22: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 2396 |                 str1 = strchr(identifier, '/');
      |                      ^
../../../src/ucm/main.c: In function 'snd_use_case_geti':
../../../src/ucm/main.c:2721:22: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 2721 |                 str1 = strchr(identifier, '/');
      |                      ^
../../../src/ucm/main.c: In function 'snd_use_case_set':
../../../src/ucm/main.c:3038:22: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 3038 |                 str1 = strchr(identifier, '/');
      |                      ^
../../../src/ucm/ucm_subs.c: In function 'strchr_with_escape':
../../../src/ucm/ucm_subs.c:832:19: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  832 |                 s = strchr(str, c);
      |                   ^
../../src/conf.c: In function 'snd_config_hook_load_for_all_cards':
../../src/conf.c:4446:51: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 4446 |                                         char *s = strchr(driver, '.');
      |                                                   ^~~~~~

```

Request URL : https://github.com/alsa-project/alsa-lib/pull/496
Patch URL : https://github.com/alsa-project/alsa-lib/pull/496.patch
Repository URL: https://github.com/alsa-project/alsa-lib