[nas] K&R prototypes in server/os/utils.c

Andreas Voegele voegelas at users.sourceforge.net
Sat Aug 31 01:25:33 MDT 2002


Are there still systems that require the following K&R prototypes in
server/os/utils.c?

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?

Bye, Andreas



More information about the Nas mailing list