prototype patch for cpplib

Per Bothner bothner@cygnus.com
Wed Sep 24 17:30:00 GMT 1997


I appreciate the effort to proto-ize cpplib.  However, I really don't
like the way you handled the the error-reporting functions.  For example:

+ #ifdef __STDC__
  void
+ cpp_fatal (cpp_reader *pfile, const char *str, ...)
+ {
+ ...
+ }
+ #else
+ void
  cpp_fatal (pfile, str, arg)
       cpp_reader *pfile;
       char *str, *arg;
  {
  ...
  }
+ #endif

The code seems to be duplicated between the __STDC__ and non-__STDC__
case.  This would be a maintainance nightmare:  If someone makes a change,
there is a good chance they will only fix one of the versions, but
not both.

Instead, I would suggest looking at toplev.c, and using VPROTO
for the varargs functions as done there for the error reporting functions.

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner



More information about the Gcc mailing list