You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "jasonbu (via GitHub)" <gi...@apache.org> on 2025/11/30 08:38:30 UTC
[PR] inttype.h: add PRIuTM(time_t) to handle TIME64 & TIME32 print compatible [nuttx]
jasonbu opened a new pull request, #17409:
URL: https://github.com/apache/nuttx/pull/17409
## Summary
When we using code cross platform, the time_t is not supported by printf offcially,
for compatible, we always to cast time_t to uint64_t and use PRIu64.
The code should be ugly and a waste of stack, if we are really using 32bit time_t.
Add a standard PRIdTM to handle the time_t print should prefer.
## Impact
After patch, we will no longer need cast to int64_t again.
## Testing
CI-test, qemu arm-v7a nsh, qemu arm-v8a nsh
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] inttype.h: add PRIuTM(time_t) to handle TIME64 & TIME32 print compatible [nuttx]
Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on PR #17409:
URL: https://github.com/apache/nuttx/pull/17409#issuecomment-3595885533
these are not standard macros, not defined in POSIX or any other OS. I don't think something like this should be merged without much thinking. At least it should be clearly stated that these macros are non-standard.`inttype.h` is standard defined header and I'm not sure if we should place nuttx-specific code here.
32-bit `time_t` will be removed in the future (not compatible with POSIX), so these custom macros will become useless.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] inttype.h: add PRIuTM(time_t) to handle TIME64 & TIME32 print compatible [nuttx]
Posted by "jerpelea (via GitHub)" <gi...@apache.org>.
jerpelea merged PR #17409:
URL: https://github.com/apache/nuttx/pull/17409
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] inttype.h: add PRIuTM(time_t) to handle TIME64 & TIME32 print compatible [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #17409:
URL: https://github.com/apache/nuttx/pull/17409#issuecomment-3595927807
> these are not standard macros, not defined in POSIX or any other OS. I don't think something like this should be merged without much thinking. At least it should be clearly stated that these macros are non-standard.`inttype.h` is standard defined header and I'm not sure if we should place nuttx-specific code here. 32-bit `time_t` will be removed in the future (not compatible with POSIX), so these custom macros will become useless.
this macro is specific designed for 32bit/64 time_t/clock_t, once 32bit version is removed, all these macros can be removed too.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] inttype.h: add PRIuTM(time_t) to handle TIME64 & TIME32 print compatible [nuttx]
Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on PR #17409:
URL: https://github.com/apache/nuttx/pull/17409#issuecomment-3596202091
because this is a non-standard macro, the moment we remove 32-bit time_t, we'll have to remove these macros which will be a breaking change that will break all code that started using this macro. If nuttx-apps starts using this macro now, we'll have another incompatibility between nuttx and nuttx-apps making 'git bisect' impossible in the future. So I don't think "we'll remove it later" is the solution here, because it will cause an even bigger problem.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org