From c135c66684d6fba899f26ddc1085494ee299fd4f Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 20 Nov 2019 15:59:07 +0100 Subject: [PATCH] libqcdm,modepref: fix warnings with -Wdiscarded-qualifiers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit modepref.c: In function ‘main’: modepref.c:539:11: warning: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 539 | putenv ("QCDM_DEBUG=1"); | ^~~~~~~~~~~~~~ In file included from modepref.c:21: /usr/include/stdlib.h:647:26: note: expected ‘char *’ but argument is of type ‘const char *’ 647 | extern int putenv (char *__string) __THROW __nonnull ((1)); | ~~~~~~^~~~~~~~ --- libqcdm/tests/modepref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libqcdm/tests/modepref.c b/libqcdm/tests/modepref.c index e5310d9c..f8855161 100644 --- a/libqcdm/tests/modepref.c +++ b/libqcdm/tests/modepref.c @@ -536,7 +536,7 @@ main (int argc, char *argv[]) } if (debug) - putenv ("QCDM_DEBUG=1"); + putenv ((char *)"QCDM_DEBUG=1"); fd = com_setup (dmport); if (fd < 0)