[4136] in Athena Bugs

home help back first fref pref prev next nref lref last post

6.4R: /usr/include/stdio.h: sprintf; hc

daemon@ATHENA.MIT.EDU (Ken Raeburn)
Mon Feb 5 11:48:16 1990

Date: Mon, 5 Feb 90 11:48:01 -0500
From: Ken Raeburn <Raeburn@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU

ANSI C does not permit compatibility between function declarations
with empty parameter lists (which is what we provide for sprintf in
stdio.h), and prototypes with an ellipsis (which is correct for
sprintf).

Bug 1: The hc2 compiler does not even hint that there could be a
problem, even with the "-H+w" option.

Bug 2: The stdio.h header file on both platforms should have
	int sprintf ();
replaced with
	#ifndef __STDC__
	int sprintf ();
	#else
	int sprintf (char *, const char *, ...);
	#endif
and should probably have prototypes for printf and fprintf as well.

-- Ken

home help back first fref pref prev next nref lref last post