This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: bluesky idea: __attribute__ (netorder)



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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]