bluesky idea: __attribute__ (netorder)

Stephen Williams steve@icarus.com
Sun Sep 6 01:09:00 GMT 1998


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."





More information about the Gcc mailing list