GCC 15 turned -Wincompatible-pointer-types into a compiler error instead
of a warning by default. This patch prevents the following error:
$ gcc manual/examples/subopt.c
manual/examples/subopt.c: In function ‘main’:
manual/examples/subopt.c:64:40: error: passing argument 2 of ‘getsubopt’ from incompatible pointer type [-Wincompatible-pointer-types]
64 | switch (getsubopt (&subopts, mount_opts, &value))
| ^~~~~~~~~~
| |
| const char **
In file included from manual/examples/subopt.c:19:
/usr/include/stdlib.h:1100:47: note: expected ‘char * const* restrict’ but argument is of type ‘const char **’
1100 | char *const *__restrict __tokens,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
case 'o':
subopts = optarg;
while (*subopts != '\0')
- switch (getsubopt (&subopts, mount_opts, &value))
+ switch (getsubopt (&subopts, (char * const *) mount_opts, &value))
{
case RO_OPTION:
read_only = 1;