bluesky idea: __attribute__ (netorder)

Matthew Kirkwood weejock@ferret.lmh.ox.ac.uk
Fri Sep 4 05:03:00 GMT 1998


Hi,

How hard would __attribute(__ (netorder) be to implement?

Essentially, I'd like to be able to mark particular bits of
data as being in network order (host order being default)
to leverage a little compiler assistance in debugging.

Having gcc generate warnings akin those for signedness could
prove handy in some circumstances.  (Who hasn't spent days
looking for a missed ntohl()?)

It might also be useful if it warned on some of the other
implicit conversions, like short->long, etc.

Perhaps __a__ ({big,little}endian) might make more sense...

Comments?

And, given that the most complicated thing I've ever done with
the gcc source is build it, how hard would it be as an initial
hacking project?

Matthew.




More information about the Gcc mailing list