Bug 28362

Summary: yacc(1)-generated files fail to compile cleanly with -Wstrict-prototypes
Product: Base System Reporter: avn <avn>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description avn 2001-06-23 11:10:01 UTC
.c files generated with yacc(1) fail to compile under CFLAGS=
-Wstrict-prototypes when no -ansi is specified.

Fix: The patch below makes it happy with either '-Wstrict-prototypes' and
'-Wstrict-prototypes -ansi' and '-Wstrict-prototypes -ansi -pedantic'
How-To-Repeat: --- Makefile ---
CC = gcc
CFLAGS = -Wstrict-prototypes
SRCS = a.y
PROG = a
NOMAN = yes
NOOBJ = yes
.include <bsd.prog.mk>
--- a.y ---
%{
void yyerror(const char *s)
{}
int yylex(void)
{}
%}
%%
stmt    :
        ;
%%
int main(void)
{
	return 0;
}
--- end ---
this produces when compiling:
a.c:14: warning: function declaration isn't a prototype
a.c:99: warning: function declaration isn't a prototype
Comment 1 ru freebsd_committer freebsd_triage 2001-06-23 12:51:17 UTC
This PR can be closed (after MFC of rev.1.29 of yacc/skeleton.c).

-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age
Comment 2 Mike Barcroft freebsd_committer freebsd_triage 2001-07-19 06:48:48 UTC
State Changed
From-To: open->closed


This has been fixed in -CURRENT and -STABLE.