You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/02/10 13:53:30 UTC
[GitHub] [incubator-nuttx-apps] patacongo opened a new issue #63: PR62
Introduces parameter mismatch
patacongo opened a new issue #63: PR62 Introduces parameter mismatch
URL: https://github.com/apache/incubator-nuttx-apps/issues/63
PR 62 introduces a parameter mismatch which must be fixed. Changes lines like:
printf("CHILD: started with arg=%d\n", (intptr_t)arg);
will cause warnings in some environments where there is type checking (like sim). It can also cause parameter mismatches in other cases.
For example, on 64-bit simulation, %d will expect an int argument and sizeof(int) == 32-bits. But intptr_t will be 64-bits so the printf will be wrong. In certain cases, this kind of size mismatch can lead to a crash.
My suggesting is to use the more complex cast (int)((intptr_t)arg). That will both avoid the warning and assure that the value provided to printf is a proper integer type.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-nuttx-apps] patacongo commented on issue #63: PR62
Introduces parameter mismatch
Posted by GitBox <gi...@apache.org>.
patacongo commented on issue #63: PR62 Introduces parameter mismatch
URL: https://github.com/apache/incubator-nuttx-apps/issues/63#issuecomment-586611366
Resolved by PR #72
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-nuttx-apps] patacongo closed issue #63: PR62 Introduces
parameter mismatch
Posted by GitBox <gi...@apache.org>.
patacongo closed issue #63: PR62 Introduces parameter mismatch
URL: https://github.com/apache/incubator-nuttx-apps/issues/63
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services