This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bluesky idea: __attribute__ (netorder)
- To: egcs at cygnus dot com
- Subject: Re: bluesky idea: __attribute__ (netorder)
- From: Stephen Williams <steve at icarus dot com>
- Date: Sat, 05 Sep 1998 23:06:54 -0700
weejock@ferret.lmh.ox.ac.uk said:
> How hard would __attribute(__ (netorder) be to implement?
Even bluer sky...
__attribute__((property(foo)))
The idea here it that any type can be given a named property. Any
application of that type what doesn't have the matching property would
be flagged as a warning. i.e.:
extern inline unsigned long htonl(unsigned long) __attribute__((property(nbo)));
unsigned long foo __attribute__((property(nbo));
foo = 5; // property mismatch warning
foo = htonl(5); // no warning
or how 'bout this one:
typedef void*image_memory __attribute__((property(image)));
void dma_from_image_memory(void*dest, image_memory src);
image_memory fooptr;
void*barptr;
dma_from_image_memory(barptr, fooptr); // OK
dma_from_image_memory(fooptr, barptr); // warnings
Hm?
--
Steve Williams "The woods are lovely, dark and deep.
steve@icarus.com But I have promises to keep,
steve@picturel.com and lines to code before I sleep,
http://www.picturel.com And lines to code before I sleep."