Module Name: src Committed By: rillig Date: Thu Jul 8 18:53:58 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: msg_206.c msg_206.exp src/usr.bin/xlint/lint1: cgram.y Log Message: lint: fix wrong check for enum constants in switch (since today) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_206.c \ src/tests/usr.bin/xlint/lint1/msg_206.exp cvs rdiff -u -r1.272 -r1.273 src/usr.bin/xlint/lint1/cgram.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/xlint/lint1/msg_206.c diff -u src/tests/usr.bin/xlint/lint1/msg_206.c:1.3 src/tests/usr.bin/xlint/lint1/msg_206.c:1.4 --- src/tests/usr.bin/xlint/lint1/msg_206.c:1.3 Thu Jul 8 18:50:57 2021 +++ src/tests/usr.bin/xlint/lint1/msg_206.c Thu Jul 8 18:53:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_206.c,v 1.3 2021/07/08 18:50:57 rillig Exp $ */ +/* $NetBSD: msg_206.c,v 1.4 2021/07/08 18:53:57 rillig Exp $ */ # 3 "msg_206.c" // Test for message: enumeration value(s) not handled in switch [206] @@ -25,5 +25,4 @@ test(enum number num) case THREE: break; } - /* FIXME *//* expect-1: warning: enumeration value(s) not handled in switch [206] */ } Index: src/tests/usr.bin/xlint/lint1/msg_206.exp diff -u src/tests/usr.bin/xlint/lint1/msg_206.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_206.exp:1.4 --- src/tests/usr.bin/xlint/lint1/msg_206.exp:1.3 Thu Jul 8 18:50:57 2021 +++ src/tests/usr.bin/xlint/lint1/msg_206.exp Thu Jul 8 18:53:57 2021 @@ -1,2 +1 @@ msg_206.c(19): warning: enumeration value(s) not handled in switch [206] -msg_206.c(27): warning: enumeration value(s) not handled in switch [206] Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.272 src/usr.bin/xlint/lint1/cgram.y:1.273 --- src/usr.bin/xlint/lint1/cgram.y:1.272 Thu Jul 8 18:50:57 2021 +++ src/usr.bin/xlint/lint1/cgram.y Thu Jul 8 18:53:57 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.272 2021/07/08 18:50:57 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.273 2021/07/08 18:53:57 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: cgram.y,v 1.272 2021/07/08 18:50:57 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.273 2021/07/08 18:53:57 rillig Exp $"); #endif #include <limits.h> @@ -853,8 +853,7 @@ enum_declaration: symtyp = FVFT; enumval = 0; } enumerator_list enumerator_list_comma_opt T_RBRACE { - /* FIXME: $2 must be $3 */ - $$ = $2; + $$ = $3; } ;