This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

protos for warning(), error()


Many files call warning() and error().   Many file complain about the
absence of protos for those functions - and since those are vararg/stdarg
functions, this can actually represent a problem.

I found there used to be protos for them.

rtl.h:
	/* In toplev.c */
	extern void strip_off_ending            PROTO ((char *, int));
	extern void print_time                  PROTO ((char *, int));
	extern int get_run_time                 PROTO ((void));
	#if 0
	extern void fatal                       PVPROTO ((char *, ...));
	extern void warning                     PVPROTO ((char *, ...));
	extern void error                       PVPROTO ((char *, ...));
	#endif

tree.h:
	/* toplev.c */
	[ munch ] 
	extern void fatal_io_error              PROTO ((char *));
	#if 0
	extern void warning                     PVPROTO ((char *, ...));
	extern void error                       PVPROTO ((char *, ...));
	#endif
	extern void pedwarn                     PVPROTO ((char *, ...));


Does anyone have any idea why thre are #if 0'ed away.  How about why so
much of this stuff appears in at least two different files?  I can't
find any smoking gnus in ChangeLogs for either EGCS or GCC, but I didn't
scour them, either.

We like the GNU __attribute__ ((format (printf, ...))) stuff, don't we?
I think we've probably all been bitten by errors in these error message.

Does creation of a toplev.h that contains a single set of enhanced protos
for these things sound like the thing to do?  This file would be included
by the two aforementinoed ones and would include something like:

	#if __GNUC__
	#  proto it with __attribute__ stuff
	#else
	# use PVPROTO stuff.
	#endif

Is GNUC == true ANSI == false a useful combination? 


RJL


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