This is the mail archive of the gcc-bugs@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]

Re: gcc.dg/c90-impl-decl-1.c


On Sat, 29 Jul 2000, Zack Weinberg wrote:

> > "Can" or "shall"?  Unless "shall", I'd prefer this test removed,
> > since users really ought to include <string.h>.
> 
> We can still complain about it with -Wall, but it isn't supposed to be
> a -pedantic complaint in C90 mode.  (Since C90 doesn't say we SHALL
> NOT implicitly declare strcmp.)

To be precise:

	Provided that a library function can be declared without reference
	to any type defined in a header, it is also permissible to declare
	the function, either explicitly or implictly, and use it without
	including its associated header.  If a function that accepts a
	variable number of arguments is not declared (explicitly or by
	including its associated header), the behavior is undefined.

Thus, the warning is nothing to do with -pedantic except in C99 mode,
since the usage is correct according to the 1990 standard (if
inadvisable).  -Wall warnings here are desirable; -pedantic warnings if
the implicit declaration is wrong (e.g. for abort) are reasonable.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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