Author: uqs
Date: Thu Mar 4 16:08:01 2010
New Revision: 204711
URL: http://svn.freebsd.org/changeset/base/204711
Log:
ed(1): make WARNS=6 clean
Although argc and argv are never read after the longjmp is complete,
gcc is not clever enough to see that and needlessly warns about it.
So add volatile to silence the compiler.
Approved by: ed (the co-mentor, not ed(1))
Modified:
head/bin/ed/Makefile
head/bin/ed/main.c
Modified: head/bin/ed/Makefile
==============================================================================
--- head/bin/ed/Makefile Thu Mar 4 16:07:14 2010 (r204710)
+++ head/bin/ed/Makefile Thu Mar 4 16:08:01 2010 (r204711)
@@ -4,7 +4,6 @@
PROG= ed
SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
-WARNS?= 2
LINKS= ${BINDIR}/ed ${BINDIR}/red
MLINKS= ed.1 red.1
Modified: head/bin/ed/main.c
==============================================================================
--- head/bin/ed/main.c Thu Mar 4 16:07:14 2010 (r204710)
+++ head/bin/ed/main.c Thu Mar 4 16:08:01 2010 (r204711)
@@ -103,15 +103,10 @@ const char usage[] = "usage: %s [-] [-sx
/* ed: line editor */
int
-main(int argc, char *argv[])
+main(volatile int argc, char ** volatile argv)
{
int c, n;
long status = 0;
-#if __GNUC__
- /* Avoid longjmp clobbering */
- (void) &argc;
- (void) &argv;
-#endif
(void)setlocale(LC_ALL, "");
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"