Date: Thu, 6 Feb 1997 04:45:24 +1100 From: Bruce Evans <bde@zeta.org.au> To: imp@village.org, obrien@NUXI.com Cc: freebsd-ports@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: conditionally including <sys/param.h> Message-ID: <199702051745.EAA12664@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>Most of the examples that you sighted can be handled better by other >means. Don't declare sys_errlist at all, rather use strerror() or >#include <errno.h> (which is fairly standard). Don't use hard wired strerror() doesn't exist on old systems. >Also, as time moves forward, some new systems will adopt parts of the >4.4 tree. Do you really want to have things like: > >#if defined(__bsd44__) || (defined(SOLARIS) && SOLARIS >= 207) ... NOOOO! :-) >Many of the ports have 2-3 lines of ifdefs to include stdlib.h, when >instead they should have a single #ifdef __STDC__ in its place. This is wrong. __STDC__ has very little to do with the existence of standard headers. It has more to do with the ANSI conformance of the current invocation of the compiler. E.g., it is not defined for `gcc -traditional', but running the compiler with different flags does not make standard headers go away. I think we should just use `#ifdef __FreeBSD__' and <sys/param.h> in ports. Original authors should use a better method to suit themselves. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702051745.EAA12664>