Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2001 10:00:17 +0300
From:      Peter Pentchev <roam@orbitel.bg>
To:        Mike Heffner <mheffner@cowpie.acm.vt.edu>
Cc:        freebsd-audit@freebsd.org
Subject:   Re: cmp(1) patch
Message-ID:  <20010528100017.B8450@ringworld.oblivion.bg>
In-Reply-To: <20010527232926.A85869@cowpie.acm.vt.edu>; from mheffner@cowpie.acm.vt.edu on Sun, May 27, 2001 at 11:29:27PM -0400
References:  <20010527232926.A85869@cowpie.acm.vt.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, May 27, 2001 at 11:29:27PM -0400, Mike Heffner wrote:
> BDECFLAGS cleanup, respect -s flag in one place, return instead of
> exit() at end of main. Please review.
> 
> Index: cmp.c
> ===================================================================
> RCS file: /home/ncvs/src/usr.bin/cmp/cmp.c,v
> retrieving revision 1.9
> diff -u -r1.9 cmp.c
> --- cmp.c	2000/07/25 13:01:34	1.9
> +++ cmp.c	2001/05/26 21:57:56
> @@ -58,6 +58,7 @@
>  
>  int	lflag, sflag, xflag, zflag;
>  
> +int main __P((int, char *[]));
>  static void usage __P((void));

Does gcc with BDECFLAGS really complain for a missing prototype on main()?
I thought gcc was smart enough (it is, at least on -stable)..

[roam@ringworld:v4 ~/c/misc/foo]$ cat Makefile
CFLAGS+=	${BDECFLAGS}
PROG=	foo
NOMAN=	yes

.include <bsd.prog.mk>
[roam@ringworld:v4 ~/c/misc/foo]$ cat foo.c
#include <stdio.h>

int main(int argc __unused, char *argv[] __unused) {

	printf("Hell world!\n");
	return (0);
}
[roam@ringworld:v4 ~/c/misc/foo]$ make clean all
rm -f foo foo.o
Warning: Object directory not changed from original /usr/home/roam/lang/c/misc/foo
cc -O -pipe  -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align  -Wcast-qual -Wchar-subscripts -Winline  -Wmissing-prototypes -Wnested-externs -Wpointer-arith  -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings   -c foo.c
cc -O -pipe  -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align  -Wcast-qual -Wchar-subscripts -Winline  -Wmissing-prototypes -Wnested-externs -Wpointer-arith  -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings    -o foo foo.o  

G'luck,
Peter

-- 
If I had finished this sentence,

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010528100017.B8450>