From 9b18dbeb15a11677479aefc17bf800f353226cfb Mon Sep 17 00:00:00 2001 From: Dee Newcum Date: Thu, 3 Feb 2022 19:24:55 -0600 Subject: [PATCH] fix compile warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pi400kb/pi400.c: In function ‘modprobe_libcomposite’: pi400kb/pi400.c:82:37: warning: passing argument 2 of ‘execv’ from incompatible pointer type [-Wincompatible-pointer-types] 82 | execv("/usr/sbin/modprobe", argv); | ^~~~ | | | const char ** In file included from pi400kb/pi400.c:14: /usr/include/unistd.h:563:51: note: expected ‘char * const*’ but argument is of type ‘const char **’ 563 | extern int execv (const char *__path, char *const __argv[]) | ~~~~~~~~~~~~^~~~~~~~ --- pi400.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pi400.c b/pi400.c index ad8c4ac..cb5f013 100644 --- a/pi400.c +++ b/pi400.c @@ -43,7 +43,7 @@ bool modprobe_libcomposite() { if (pid < 0) return false; if (pid == 0) { - const char* argv[] = {"modprobe", "libcomposite"}; + char* const argv[] = {"modprobe", "libcomposite"}; execv("/usr/sbin/modprobe", argv); exit(0); }