Skip to content

tests: fix -Werror=discarded-qualifiers errors in check_public.c

Alan Coopersmith requested to merge alanc/libxcb:fixes into master
check_public.c: In function ‘parse_display_pass’:
check_public.c:32:32: error: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   32 |                         putenv("DISPLAY=");
      |                                ^~~~~~~~~~
In file included from check_public.c:4:
/usr/include/stdlib.h:148:19: note: expected ‘char *’ but argument is of type ‘const char *’
  148 | extern int putenv(char *);
      |                   ^~~~~~
check_public.c:57:16: error: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   57 |         putenv("DISPLAY=");
      |                ^~~~~~~~~~
/usr/include/stdlib.h:148:19: note: expected ‘char *’ but argument is of type ‘const char *’
  148 | extern int putenv(char *);
      |                   ^~~~~~
check_public.c: In function ‘parse_display_fail’:
check_public.c:73:32: error: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   73 |                         putenv("DISPLAY=");
      |                                ^~~~~~~~~~
/usr/include/stdlib.h:148:19: note: expected ‘char *’ but argument is of type ‘const char *’
  148 | extern int putenv(char *);
      |                   ^~~~~~
check_public.c:99:16: error: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   99 |         putenv("DISPLAY=");
      |                ^~~~~~~~~~
/usr/include/stdlib.h:148:19: note: expected ‘char *’ but argument is of type ‘const char *’
  148 | extern int putenv(char *);
      |                   ^~~~~~
check_public.c: In function ‘public_suite’:
check_public.c:244:16: error: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  244 |         putenv("DISPLAY=");
      |                ^~~~~~~~~~
/usr/include/stdlib.h:148:19: note: expected ‘char *’ but argument is of type ‘const char *’
  148 | extern int putenv(char *);
      |                   ^~~~~~
cc1: all warnings being treated as errors

Merge request reports

Loading