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?


-----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.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF+Uzx84KuGfSFAYARApEWAJ4mfv61liU9S6s9Y1AaZrXRzngmIwCgtGEP
SqcZsfnWChvCHZynEtd9dz8=
=Upqj
-----END PGP SIGNATURE-----


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