"dkrot" <j.*****@ramble r.ruwrites:
Try to use ULONG_MAX in gcc macro if you use Unix.
or sizeof(long): 4 for 32bit, 8 for 64bit arch.
Please quote enough context so we can tell what you're talking about
even if we haven't seen the parent article.
ULONG_MAX (which is standard C, not specific to either gcc or Unix)
only tells you what the compiler writer has chosen as the maximum
value of type unsigned long. It tells you nothing about the
underlying CPU architecture. The compiler writer's choices for the
attributes of the predefined types are typically guided by the CPU
architecture, but they're not mandated by it.
It's not even clear what "32-bit architecture" or "64-bit
architecture" actually means. It might have some accepted meaning for
particular sets of architectures (e.g., the x86 family), but that
won't necessarily apply to other architectures (PowerPC, SPARC,
AS/400, DS9K, etc.).
And even if you can rigorously define the terms, there's not likely to
be any way to distinguish between them in portable C.
The entire question is largely meaningless and off-topic.
--
Keith Thompson (The_Other_Keit h)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.