diff mbox series

[meta-oe] usleep: fix compile errors

Message ID 20240606050222.2551532-1-kai.kang@windriver.com
State Accepted
Headers show
Series [meta-oe] usleep: fix compile errors | expand

Commit Message

Kai June 6, 2024, 5:02 a.m. UTC
From: Kai Kang <kai.kang@windriver.com>

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>
---
 meta-oe/recipes-core/usleep/files/usleep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Khem Raj June 6, 2024, 5:36 a.m. UTC | #1
On Wed, Jun 5, 2024 at 10:02 PM Kai Kang via lists.openembedded.org
<kai.kang=windriver.com@lists.openembedded.org> wrote:
>
> From: Kai Kang <kai.kang@windriver.com>
>
> 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);
> |       |            ^
>

What is the upstream status of this patch ?

> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>  meta-oe/recipes-core/usleep/files/usleep.c | 4 ++--
>  1 file 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) {
>    int showVersion = 0;
>    int showOot = 0;
>    int rc;
> -  char * countStr = NULL;
> +  const char * countStr = NULL;
>    struct poptOption options[] = {
>              { "version", 'v', POPT_ARG_NONE, &showVersion, 0,
>                         "Display the version of this program, and exit" },
> @@ -44,7 +44,7 @@ int main(int argc, char **argv) {
>              { 0, 0, 0, 0, 0 }
>          };
>
> -  optCon = poptGetContext("usleep", argc, argv, options,0);
> +  optCon = poptGetContext("usleep", argc, (const char **)argv, options,0);
>    /*poptReadDefaultConfig(optCon, 1);*/
>    poptSetOtherOptionHelp(optCon, "[microseconds]");
>
> --
> 2.42.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#110707): https://lists.openembedded.org/g/openembedded-devel/message/110707
> Mute This Topic: https://lists.openembedded.org/mt/106517953/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Kai June 7, 2024, 8:49 a.m. UTC | #2
On 6/6/24 13:36, Khem Raj wrote:
> On Wed, Jun 5, 2024 at 10:02 PM Kai Kang via lists.openembedded.org
> <kai.kang=windriver.com@lists.openembedded.org>  wrote:
>> From: Kai Kang<kai.kang@windriver.com>
>>
>> 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);
>> |       |            ^
>>
> What is the upstream status of this patch ?
It just modify the source code usleep.c which residents in meta-oe

and not a separated patch, so not require upstream status.

Regards,
Kai

>
>> Signed-off-by: Kai Kang<kai.kang@windriver.com>
>> ---
>>   meta-oe/recipes-core/usleep/files/usleep.c | 4 ++--
>>   1 file 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) {
>>     int showVersion = 0;
>>     int showOot = 0;
>>     int rc;
>> -  char * countStr = NULL;
>> +  const char * countStr = NULL;
>>     struct poptOption options[] = {
>>               { "version", 'v', POPT_ARG_NONE, &showVersion, 0,
>>                          "Display the version of this program, and exit" },
>> @@ -44,7 +44,7 @@ int main(int argc, char **argv) {
>>               { 0, 0, 0, 0, 0 }
>>           };
>>
>> -  optCon = poptGetContext("usleep", argc, argv, options,0);
>> +  optCon = poptGetContext("usleep", argc, (const char **)argv, options,0);
>>     /*poptReadDefaultConfig(optCon, 1);*/
>>     poptSetOtherOptionHelp(optCon, "[microseconds]");
>>
>> --
>> 2.42.0
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#110707):https://lists.openembedded.org/g/openembedded-devel/message/110707
>> Mute This Topic:https://lists.openembedded.org/mt/106517953/1997914
>> Group Owner:openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe:https://lists.openembedded.org/g/openembedded-devel/unsub  [raj.khem@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
diff mbox series

Patch

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) {
   int showVersion = 0;
   int showOot = 0;
   int rc;
-  char * countStr = NULL;
+  const char * countStr = NULL;
   struct poptOption options[] = {
             { "version", 'v', POPT_ARG_NONE, &showVersion, 0, 
 			"Display the version of this program, and exit" },
@@ -44,7 +44,7 @@  int main(int argc, char **argv) {
             { 0, 0, 0, 0, 0 }
         };
 
-  optCon = poptGetContext("usleep", argc, argv, options,0);
+  optCon = poptGetContext("usleep", argc, (const char **)argv, options,0);
   /*poptReadDefaultConfig(optCon, 1);*/
   poptSetOtherOptionHelp(optCon, "[microseconds]");