| Summary: | yacc(1)-generated files fail to compile cleanly with -Wstrict-prototypes | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | avn <avn> | ||||
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.3-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
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 State Changed From-To: open->closed This has been fixed in -CURRENT and -STABLE. |
.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