Joerg Schilling writes:
> > I think you might be misreading the code.  __sun_attr__ is just a
> > macro in that file that expands to nothing when using a Sun C
> > compiler, or to the right __attribute__ thing by way of token pasting
> > if you're using gcc.
> 
> So why does __sun_attr__ exists at all?

It's a simplification; an implementation detail.

> > It's an internal implementation detail of that header file.  Source
> > code in ON should be using __NORETURN, __PURE, and so on.
> 
> Does this always expand to nothing in case that you use a Sun C compiler?

Basically, yes:

#if defined(__ATTRIBUTE_IMPLEMENTED) || defined(__GNUC__)
[...]
#else   /* __ATTRIBUTE_IMPLEMENTED || __GNUC__ */
#define __sun_attr__(__a)
#endif  /* __ATTRIBUTE_IMPLEMENTED || __GNUC__ */

If it ever happened that there was a compiler that implemented the
gcc-like __attribute__ feature but didn't set __GNUC__, then you could
use __ATTRIBUTE_IMPLEMENTED to turn the feature on.  But that's not
true of Workshop C, and there's nothing today that ever sets this
flag.

-- 
James Carlson, KISS Network                    <[EMAIL PROTECTED]>
Sun Microsystems / 1 Network Drive         71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to