rtadvd - WARNS and a missing break?

Eitan Adler lists at eitanadler.com
Sat Oct 15 05:38:31 UTC 2011


I was playing around with WARNS on some programs and noticed that
usr.sbin/rtadvd builds with WARNS=3 with both clang and gcc (and
WARNS=6 with gcc). Perhaps the following could be committed ?

Index: Makefile
===================================================================
--- Makefile	(revision 226370)
+++ Makefile	(working copy)
@@ -24,6 +24,6 @@

 CFLAGS+= -DHAVE_ARC4RANDOM

-WARNS?=	1
+WARNS?=	3

 .include <bsd.prog.mk>


While here I also noticed that one of the switch statements is missing
a "break" statement but I'm uncertain if adding one is correct.

Index: control_server.c
===================================================================
--- control_server.c	(revision 226370)
+++ control_server.c	(working copy)
@@ -704,6 +704,7 @@
 			switch (cm->cm_type) {
 			case CM_TYPE_EOM:
 				state = CM_STATE_EOM;
+				break; //// or should this be /* FALLTHROUGH? */
 			case CM_TYPE_NUL:
 				cm->cm_type = CM_TYPE_ACK;
 				cm->cm_len = sizeof(*cm);

-- 
Eitan Adler


More information about the freebsd-hackers mailing list