Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jan 2010 08:04:09 +0100
From:      Ed Schouten <ed@80386.nl>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r202661 - head/lib/libc/gen
Message-ID:  <20100120070409.GJ64905@hoeg.nl>
In-Reply-To: <20100120163243.A68431@delplex.bde.org>
References:  <201001192307.o0JN7CKu034318@svn.freebsd.org> <20100120163243.A68431@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--ab67L9H6qvgO+k5w
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Bruce Evans <brde@optusnet.com.au> wrote:
> Of course it is against standards.  This is implicit for most functions,
> and the part of the standard that you quoted says it explicitly for
> uname():
>=20
> > | The following shall be declared as a function and may also be defined
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^     ^^^^^^^^
> > | as a macro:
> > |
> > | int uname(struct utsname *);
>=20
> Examples of use of the function when it is also defined as a macro:
>=20
> <snip>

It turned out I slightly misinterpreted the sentence. It should declared
as a function *and* may also be defined as a macro. When I read this at
first, I interpreted the word "and" as an "or", which in my mind makes
sense when you try to keep things simple. But yes, if uname wouldn't be
provided as a real function, there are many constructs that could of
course break.

The most confusing part about this, is that the uname function we
provide in libc doesn't match the one in <sys/utsname.h>, which uses 128
bytes instead of 32. Fortunately it's not possible to #undef the inline
function, but it still sounds quite scary to me.

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--ab67L9H6qvgO+k5w
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAktWqukACgkQ52SDGA2eCwVPhgCcCNfSxAbD8K/4tEGKtFMOnqss
AhEAn2WYvmLQLnzyJQGgZcR9JRBuQ37Q
=oFLc
-----END PGP SIGNATURE-----

--ab67L9H6qvgO+k5w--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100120070409.GJ64905>