where can I find the right doc for SunStudio For Linux ?

I can find the docs for SunStudio here, http://docs.sun.com/app/docs/doc/819-5265/6n7c29ck9?a=view

but it seems that it doesn't right on linux platform.

#include <stdio.h>

int main(void)

{

#if defined(sun)

printf("sun defined \n");

#else

printf("sun undefined \n");

#endif

#if defined(unix)

printf("unix defined \n");

#else

printf("unix undefined \n");

#endif

#if defined(sparc)

printf("sparc defined \n");

#else

printf("sparc undefined \n");

#endif

#if defined(i386)

printf("i386 defined \n");

#else

printf("i386 undefined \n");

#endif

#if defined(__sun)

printf("__sun defined \n");

#else

printf("__sun undefined \n");

#endif

#if defined(__unix)

printf("__unix defined \n");

#else

printf("__unix undefined \n");

#endif

#if defined(__SUNPRO_C)

printf("__SUNPRO_C defined \n");

#else

printf("__SUNPRO_C undefined \n");

#endif

#if defined(__sparc)

printf("__sparc defined \n");

#else

printf("__sparc undefined \n");

#endif

#if defined(__i386)

printf("__i386 defined \n");

#else

printf("__i386 undefined \n");

#endif

#if defined(__SVR4)

printf("__SVR4 defined \n");

#else

printf("__SVR4 undefined \n");

#endif

return 0;

}

[luoyi@qpd06 test]$ suncc -o test test.c

[luoyi@qpd06 test]$ ./test

sun undefined

unix defined

sparc undefined

i386 undefined

__sun undefined

__unix defined

__SUNPRO_C defined

__sparc undefined

__i386 undefined

__SVR4 undefined

where can I found the correct docs for SunStudio For Linux ?

[3155 byte] By [luoyi82a] at [2007-11-27 10:03:01]
# 1

You can refer to cc man pages. Here is about predefinitions:

...

Predefinitions:unix

sparc (SPARC)

i386 (x86)

sun

The above are not predefined in -Xc mode.

These predefinitions are valid in all modes:

__BUILTIN_VA_ARG_INCR

__SUNPRO_C=0x590

__SVR4(SPARC)

__SunOS(Solaris)

__SunOS_OSN.N(Solaris)

__amd64(x86 with-m64)

__gnu__linux(linux)

__i386(x86)

__linux(linux)

__linux__(linux)

__sparc(SPARC)

__sparcv9(with-m64)

__sun(Solaris)

__unix

__憉name -s慱憉name -r?br>__x86_64(x86)

linux(x86,linux)

The following is predefined in -Xa and -Xt modes only:

__RESTRICT

The compiler also predefines the object-like macro

__PRAGMA_REDEFINE_EXTNAME,

to indicate the pragma will be recognized.

...

dmikha at 2007-7-13 0:37:55 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

I think the man page comes from the same source as html docs in Sun's Site.

My Question is: The docs say i386 and so on predefined macros will get defined under x86 platform, but in fact, it doesn't .

can Sun give out a correct and full list of the predefined macros with SunStudio on Linux ?

luoyi82a at 2007-7-13 0:37:55 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
about i386 defines. i386, __i386 and __i386__ are defined only in ILP32 mode (-m32). In LP64 mode (-m64, default for 64-bit linux) __x86_64, __x86_64__, __amd64 and __amd64__ are defined. Option -### allows to see these defines.
dmikha at 2007-7-13 0:37:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4
OK, these platform macro is correct. but waht about "sun" and " __sun" ?
luoyi82a at 2007-7-13 0:37:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5
We found out that many user applications use __sun when they intend to check for __SunOS. Thus sun/__sun is defined Solaris-only.Man pages look up to date in this regard.regards,__Fedor.
SFVa at 2007-7-13 0:37:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6
FYI. I filed bug 6578123 on compiler docs.
dmikha at 2007-7-13 0:37:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...