[nas] K&R prototypes in server/os/utils.c
Jon Trulson
jon at radscan.com
Sat Aug 31 12:16:23 MDT 2002
On 31 Aug 2002, Andreas Voegele wrote:
> Date: 31 Aug 2002 09:25:33 +0200
> From: Andreas Voegele <voegelas at users.sourceforge.net>
> To: nas at radscan.com
> Subject: [nas] K&R prototypes in server/os/utils.c
>
> Are there still systems that require the following K&R prototypes in
> server/os/utils.c?
>
None require K&R that I'm aware of anymore - it's just
kruft. Perhaps it's time for an overdue face lift in this regard.
> Xalloc (amount)
> unsigned long amount;
> {
> char *malloc();
> [...]
> }
>
> Xrealloc (ptr, amount)
> register pointer ptr;
> unsigned long amount;
> {
> char *malloc();
> char *realloc();
> [...]
> }
>
> GCC 3.2 fails with the following message when I try to build NAS under
> GNU/Linux:
>
> utils.c: In function `Xalloc':
> utils.c:387: conflicting types for `malloc'
> /usr/include/stdlib.h:527: previous declaration of `malloc'
> utils.c:387: warning: extern declaration of `malloc' doesn't match global one
> utils.c: In function `Xrealloc':
> utils.c:431: conflicting types for `malloc'
> /usr/include/stdlib.h:527: previous declaration of `malloc'
> utils.c:431: warning: extern declaration of `malloc' doesn't match global one
>
> IMHO these prototypes ought to be removed or wrapped with #ifdef. What
> do you think?
They should just simply be removed - any modern system contains
the correct prototype declaration in stdlib.h now ;-) I will fix this for
the next version. Maybe get rid of some of the K&R style stuff in that
file as well...
--
Jon Trulson mailto:jon at radscan.com
ID: 1A9A2B09, FP: C23F328A721264E7 B6188192EC733962
PGP keys at http://radscan.com/~jon/PGPKeys.txt
#include <std/disclaimer.h>
Bad Color Temperature, Too much Peach.
More information about the Nas
mailing list