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 2021/08/26 13:45:02 UTC
[GitHub] [incubator-nuttx] zhuyanlinzyl commented on pull request #4418: compiler.h: add __builtin_offsetof instead of offsetof
zhuyanlinzyl commented on pull request #4418:
URL: https://github.com/apache/incubator-nuttx/pull/4418#issuecomment-906427619
hi, @davids5:
offsetof have a little difference in C++ language
https://en.cppreference.com/w/cpp/types/offsetof.
https://gist.github.com/graphitemaster/494f21190bb2c63c5516
In nuttx, when enable LIBCXXABI config, C++ toolchain generate build break which complain `offsetof` is not a constant in
static_assert(sizeof(_Unwind_Exception) + offsetof(__cxa_dependent_exception, unwindHeader) == sizeof(__cxa_dependent_exception)
use built-in offset could be a better way for compile with fixed language code.
https://stackoverflow.com/questions/47219978/why-offsetof-implementations-strangely-differs-on-c-and-c
--
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