This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: assuming C89?


Eric Blake wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jeff Johnston on 3/14/2007 12:23 PM:
I know that newlib was originally started from code that predates C89,
hence all the macros in <_ansi.h> such as _DEFUN, _AND, and so forth to
allow compilation with either K&R prototypes or standard prototypes.  But
is it still the case that K&R syntax must be supported, or can new files
assume C89 and avoid the contortions?  Similarly, can we now assume that
_HAVE_STDC is always defined, that <stdarg.h> always exists, and other
forms of C89 assumptions, or do new files still have to cater to the
possibility of obsolete <varargs.h>?

- --
The answer is we probably could assume C89 at this point in time without
harm, but the work has already been done and is trivial IMO.  I wouldn't
remove the _DEFUN and _EXFUN macros anyway because it provides the
ability for a platform to add specialized function attributes to all the
C library function declarations or definitions (e.g. see _ansi.h and
__CYGWIN__ reference).

It looks like _DEFUN is not needed any more (Cygwin does not special case it, and we already have files like fprintf.c that fail to use it). I agree that _EXFUN is still essential, but the use of _EXFUN is limited pretty much to headers. I'm not going to any great lengths to clean up existing code, but any new code I submit will probably avoid the bulk of the _ansi.h macros and just assume C89.


I guess I'll do it for you then. Just because no platform now uses additional function attributes in _DEFUN, don't assume that no one will ever need or want this.


-- Jeff J.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]