Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Sep 2002 05:01:34 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Garrett Wollman <wollman@lcs.mit.edu>
Cc:        standards@FreeBSD.ORG
Subject:   Re: CFR: Jumbo stdlib.h/qsort_r patch
Message-ID:  <20020910044208.T8099-100000@gamplex.bde.org>
In-Reply-To: <200209091736.g89HaDnh066298@khavrinen.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 9 Sep 2002, Garrett Wollman wrote:

> ...
> - The compiler now signals whether it is prepared to compile `long
> long'.  I'll dump this part in favor of obrien's patch.  This patchset

I dislike both.  stdlib.h should work right for all sorts of C90 and
C99 compilers, not just ones that have been patched to define a special
macro.  Ifdefs in <sys/cdefs.h> can handle all relevant versions of gcc
(both system ones on ports ones) much more easily than patches for N
systems and M ports.

> Index: include/stdlib.h
> ===================================================================
> RCS file: /home/ncvs/src/include/stdlib.h,v
> retrieving revision 1.40
> diff -u -r1.40 stdlib.h
> --- include/stdlib.h	1 Sep 2002 07:08:22 -0000	1.40
> +++ include/stdlib.h	9 Sep 2002 00:24:00 -0000
> ...
> +/* float strtof(const char *__restrict, char **__restrict); */

Code should be "commented out" using ifdefs, not comments.  This avoids
messing up the formatting of the code and actually works if the code has
embedded comments.

> +#if __ISO_C_VISIBLE >= 1999
> +#ifdef __LONG_LONG_SUPPORTED
> +/* LONGLONG */

LONGLONG is bogus.  lint shouldn't see long long declarations if it doesn't
support them.  FreeBSD's lint does support them but is out of date -- it
treats long long as a gcc (mis)feature only.

> ...
> +#if __BSD_VISIBLE
> +extern const char *_malloc_options;
> +extern void (*_malloc_message)(const char *, const char *, const char *, const char *);

Still has some style bugs (no indentation; long line).

I dislike arranging functions for easy ifdefing.  I dislike rearranging them
for this more.

Some of the other changes are OK :).

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-standards" in the body of the message




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