1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-11-06 19:29:35 +03:00
Files
glibc/manual/examples/subopt.c
Collin Funk 0d98af2e1d manual: Allow getsubopt example to compile with GCC 15.
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>
2025-09-29 17:01:54 -07:00

2.2 KiB