[Bug 1572] Autoconf Offset macro help needed

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Fri Jun 18 10:22:13 UTC 2010


https://www.rtems.org/bugzilla/show_bug.cgi?id=1572





--- Comment #4 from Ralf Corsepius <ralf.corsepius at rtems.org>  2010-06-18 05:22:11 ---
> What's the best approach?

Not to use any explicit constants, but to let the compiler do it ;)
I don't know what you actually are doing, so it's hard to tell whether this
would be applicable.


Wrt. __SIZEOF_POINTER__:

* __SIZEOF_POINTER__ is a GCC internal (private) and proprietary define.
=> It's non portable, you should not use it.

* A portable way is use "sizeof(void*)" or similar (compile-time constants).
i.e. essentially use the way you used in your example.

* The autoconf way to supply a portable replacement to GCC's
__SIZEOF_POINTER__is to use AC_CHECK_SIZEOF([void*]), which adds a define to
config.h, named "SIZEOF_VOIDP".

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list