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-utils pull request #322 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

```c

../../alsactl/init_parse.c: In function 'elemid_get':
../../alsactl/init_parse.c:695:29: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  695 |                 char *pos = strchr(attr, ' ');
      |                             ^~~~~~
../../alsactl/init_parse.c: In function 'conf_name_filter':
../../alsactl/init_parse.c:1284:21: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1284 |         char *ext = strrchr(d->d_name, '.');
      |                     ^~~~~~~
../../aplay/aplay.c: In function 'create_path':
../../aplay/aplay.c:3226:23: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 3226 |                 start = strchr(path + 1, '/');
      |                       ^
../../aplay/aplay.c:3228:23: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 3228 |                 start = strchr(path, '/');
      |                       ^
../../topology/pre-process-object.c: In function 'tplg_pp_add_object_tuple_section':
../../topology/pre-process-object.c:562:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  562 |         type = strchr(token_ref, '.');
      |              ^
../../topology/pre-process-dapm.c:175:14: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  175 |         args = strchr(string, '.');
      |              ^

```

Request URL : https://github.com/alsa-project/alsa-utils/pull/322
Patch URL : https://github.com/alsa-project/alsa-utils/pull/322.patch
Repository URL: https://github.com/alsa-project/alsa-utils