summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2024-06-06 13:02:22 +0800
committerKhem Raj <raj.khem@gmail.com>2024-06-07 21:52:52 -0700
commitda13475f00b043465178d1b784f0edc29ccde47a (patch)
treefe15652c87697b15233d1cc1782013c97f8a74f1
parent7d5e32b7e9a950d29d8e333df5c6c49c0c02c021 (diff)
downloadmeta-openembedded-da13475f00b043465178d1b784f0edc29ccde47a.tar.gz
usleep: fix compile errors
Update usleep.c to fix following compile error: | usleep.c: In function 'main': | usleep.c:47:43: error: passing argument 3 of 'poptGetContext' from incompatible pointer type [-Wincompatible-pointer-types] | 47 | optCon = poptGetContext("usleep", argc, argv, options,0); | | ^~~~ | | | | | char ** | In file included from usleep.c:29: | /path_to/tmp-glibc/work/core2-64-wrs-linux/usleep/1.2/recipe-sysroot/usr/include/popt.h:217:41: note: expected 'const char **' but argument is of type 'char **' | 217 | int argc, const char ** argv, | | ~~~~~~~~~~~~~~^~~~ | usleep.c:68:12: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] | 68 | countStr = poptGetArg(optCon); | | ^ Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-core/usleep/files/usleep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta-oe/recipes-core/usleep/files/usleep.c b/meta-oe/recipes-core/usleep/files/usleep.c
index a5e7d9d715..dfa52ec19a 100644
--- a/meta-oe/recipes-core/usleep/files/usleep.c
+++ b/meta-oe/recipes-core/usleep/files/usleep.c
@@ -34,7 +34,7 @@ int main(int argc, char **argv) {
34 int showVersion = 0; 34 int showVersion = 0;
35 int showOot = 0; 35 int showOot = 0;
36 int rc; 36 int rc;
37 char * countStr = NULL; 37 const char * countStr = NULL;
38 struct poptOption options[] = { 38 struct poptOption options[] = {
39 { "version", 'v', POPT_ARG_NONE, &showVersion, 0, 39 { "version", 'v', POPT_ARG_NONE, &showVersion, 0,
40 "Display the version of this program, and exit" }, 40 "Display the version of this program, and exit" },
@@ -44,7 +44,7 @@ int main(int argc, char **argv) {
44 { 0, 0, 0, 0, 0 } 44 { 0, 0, 0, 0, 0 }
45 }; 45 };
46 46
47 optCon = poptGetContext("usleep", argc, argv, options,0); 47 optCon = poptGetContext("usleep", argc, (const char **)argv, options,0);
48 /*poptReadDefaultConfig(optCon, 1);*/ 48 /*poptReadDefaultConfig(optCon, 1);*/
49 poptSetOtherOptionHelp(optCon, "[microseconds]"); 49 poptSetOtherOptionHelp(optCon, "[microseconds]");
50 50