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)


On Sun, Sep 06, 1998 at 11:02:13AM -0400, Tim Hollebeek wrote:
> You mean instead of variables just having values, they also have types?
> What a novel concept.

You noticed.. ;-)

> There are hundreds of ways to do this that do not include modifying
> the compiler and writing nonstandard C/C++.  For example:
[struct wrappers]

Indeed, the Linux kernel uses this technique in some places to catch
type errors.

The attribute thoughts were to do with warning about errors in network
code that uses standard types and functions.  But thinking about it, to
avoid warnings you'd need as many changes in the application code as for
your struct wrappers.  (I.e., none if all you do is
`addr.sin_port = htons (port)' etc.; sometimes more).

Consider anything I said on this topic withdrawn, stomped upon,
dismissed, discarded etc.

-- Jamie


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