Module Name: src Committed By: rillig Date: Sat Feb 27 15:29:15 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: msg_241.c msg_241.exp Log Message: tests/lint: remove stray warning 278 from test for warning 241 To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_241.c cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_241.exp 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_241.c diff -u src/tests/usr.bin/xlint/lint1/msg_241.c:1.3 src/tests/usr.bin/xlint/lint1/msg_241.c:1.4 --- src/tests/usr.bin/xlint/lint1/msg_241.c:1.3 Sat Feb 27 14:54:55 2021 +++ src/tests/usr.bin/xlint/lint1/msg_241.c Sat Feb 27 15:29:15 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_241.c,v 1.3 2021/02/27 14:54:55 rillig Exp $ */ +/* $NetBSD: msg_241.c,v 1.4 2021/02/27 15:29:15 rillig Exp $ */ # 3 "msg_241.c" // Test for message: dubious operation on enum, op %s [241] @@ -18,56 +18,58 @@ enum color { BLUE = 1 << 2 }; -extern void sink(int); +extern void sink_bool(_Bool); +extern void sink_int(int); +extern void sink_color(enum color); void example(void) { enum color c = RED; - sink(!c); /* expect: 241 */ - sink(~c); /* expect: 241, 278 */ - ++c; /* expect: 241 */ - --c; /* expect: 241 */ - c++; /* expect: 241 */ - c--; /* expect: 241 */ - sink(+c); /* expect: 241, 278 */ - sink(-c); /* expect: 241, 278 */ - sink(c * c); /* expect: 241, 278 */ - sink(c / c); /* expect: 241, 278 */ - sink(c % c); /* expect: 241, 278 */ - sink(c + c); /* expect: 241, 278 */ - sink(c - c); /* expect: 241, 278 */ - sink(c << c); /* expect: 241, 278 */ - sink(c >> c); /* expect: 241, 278 */ - - sink(c < c); - sink(c <= c); - sink(c > c); - sink(c >= c); - sink(c == c); - sink(c != c); - - sink(c & c); /* expect: 241, 278 */ - sink(c ^ c); /* expect: 241, 278 */ - sink(c | c); /* expect: 241, 278 */ - - sink(c && c); /* expect: 241 */ - sink(c || c); /* expect: 241 */ - sink(c ? c : BLUE); /* expect: 278 */ + sink_bool(!c); /* expect: 241 */ + sink_color(~c); /* expect: 241 */ + ++c; /* expect: 241 */ + --c; /* expect: 241 */ + c++; /* expect: 241 */ + c--; /* expect: 241 */ + sink_color(+c); /* expect: 241 */ + sink_color(-c); /* expect: 241 */ + sink_color(c * c); /* expect: 241 */ + sink_color(c / c); /* expect: 241 */ + sink_color(c % c); /* expect: 241 */ + sink_color(c + c); /* expect: 241 */ + sink_color(c - c); /* expect: 241 */ + sink_color(c << c); /* expect: 241 */ + sink_color(c >> c); /* expect: 241 */ + + sink_bool(c < c); + sink_bool(c <= c); + sink_bool(c > c); + sink_bool(c >= c); + sink_bool(c == c); + sink_bool(c != c); + + sink_color(c & c); /* expect: 241 */ + sink_color(c ^ c); /* expect: 241 */ + sink_color(c | c); /* expect: 241 */ + + sink_bool(c && c); /* expect: 241 */ + sink_bool(c || c); /* expect: 241 */ + sink_color(c ? c : BLUE); c = GREEN; - c *= c; /* expect: 241 */ - c /= c; /* expect: 241 */ - c %= c; /* expect: 241 */ - c += c; /* expect: 241 */ - c -= c; /* expect: 241 */ - c <<= c; /* expect: 241 */ - c >>= c; /* expect: 241 */ - c &= c; /* expect: 241 */ - c ^= c; /* expect: 241 */ - c |= c; /* expect: 241 */ + c *= c; /* expect: 241 */ + c /= c; /* expect: 241 */ + c %= c; /* expect: 241 */ + c += c; /* expect: 241 */ + c -= c; /* expect: 241 */ + c <<= c; /* expect: 241 */ + c >>= c; /* expect: 241 */ + c &= c; /* expect: 241 */ + c ^= c; /* expect: 241 */ + c |= c; /* expect: 241 */ /* The cast to unsigned is required by GCC at WARNS=6. */ - c &= ~(unsigned)GREEN; /* expect: 241 */ + c &= ~(unsigned)GREEN; /* expect: 241 */ } Index: src/tests/usr.bin/xlint/lint1/msg_241.exp diff -u src/tests/usr.bin/xlint/lint1/msg_241.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_241.exp:1.3 --- src/tests/usr.bin/xlint/lint1/msg_241.exp:1.2 Sat Feb 27 14:54:55 2021 +++ src/tests/usr.bin/xlint/lint1/msg_241.exp Sat Feb 27 15:29:15 2021 @@ -1,45 +1,31 @@ -msg_241.c(28): warning: dubious operation on enum, op ! [241] -msg_241.c(29): warning: dubious operation on enum, op ~ [241] -msg_241.c(29): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(30): warning: dubious operation on enum, op ++x [241] -msg_241.c(31): warning: dubious operation on enum, op --x [241] -msg_241.c(32): warning: dubious operation on enum, op x++ [241] -msg_241.c(33): warning: dubious operation on enum, op x-- [241] -msg_241.c(34): warning: dubious operation on enum, op + [241] -msg_241.c(34): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(35): warning: dubious operation on enum, op - [241] -msg_241.c(35): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(36): warning: dubious operation on enum, op * [241] -msg_241.c(36): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(37): warning: dubious operation on enum, op / [241] -msg_241.c(37): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(38): warning: dubious operation on enum, op % [241] -msg_241.c(38): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(39): warning: dubious operation on enum, op + [241] -msg_241.c(39): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(40): warning: dubious operation on enum, op - [241] -msg_241.c(40): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(41): warning: dubious operation on enum, op << [241] -msg_241.c(41): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(42): warning: dubious operation on enum, op >> [241] -msg_241.c(42): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(51): warning: dubious operation on enum, op & [241] -msg_241.c(51): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(52): warning: dubious operation on enum, op ^ [241] -msg_241.c(52): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(53): warning: dubious operation on enum, op | [241] -msg_241.c(53): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(55): warning: dubious operation on enum, op && [241] -msg_241.c(56): warning: dubious operation on enum, op || [241] -msg_241.c(57): warning: combination of 'int' and 'enum color', arg #1 [278] -msg_241.c(60): warning: dubious operation on enum, op *= [241] -msg_241.c(61): warning: dubious operation on enum, op /= [241] -msg_241.c(62): warning: dubious operation on enum, op %= [241] -msg_241.c(63): warning: dubious operation on enum, op += [241] -msg_241.c(64): warning: dubious operation on enum, op -= [241] -msg_241.c(65): warning: dubious operation on enum, op <<= [241] -msg_241.c(66): warning: dubious operation on enum, op >>= [241] -msg_241.c(67): warning: dubious operation on enum, op &= [241] -msg_241.c(68): warning: dubious operation on enum, op ^= [241] -msg_241.c(69): warning: dubious operation on enum, op |= [241] -msg_241.c(72): warning: dubious operation on enum, op &= [241] +msg_241.c(30): warning: dubious operation on enum, op ! [241] +msg_241.c(31): warning: dubious operation on enum, op ~ [241] +msg_241.c(32): warning: dubious operation on enum, op ++x [241] +msg_241.c(33): warning: dubious operation on enum, op --x [241] +msg_241.c(34): warning: dubious operation on enum, op x++ [241] +msg_241.c(35): warning: dubious operation on enum, op x-- [241] +msg_241.c(36): warning: dubious operation on enum, op + [241] +msg_241.c(37): warning: dubious operation on enum, op - [241] +msg_241.c(38): warning: dubious operation on enum, op * [241] +msg_241.c(39): warning: dubious operation on enum, op / [241] +msg_241.c(40): warning: dubious operation on enum, op % [241] +msg_241.c(41): warning: dubious operation on enum, op + [241] +msg_241.c(42): warning: dubious operation on enum, op - [241] +msg_241.c(43): warning: dubious operation on enum, op << [241] +msg_241.c(44): warning: dubious operation on enum, op >> [241] +msg_241.c(53): warning: dubious operation on enum, op & [241] +msg_241.c(54): warning: dubious operation on enum, op ^ [241] +msg_241.c(55): warning: dubious operation on enum, op | [241] +msg_241.c(57): warning: dubious operation on enum, op && [241] +msg_241.c(58): warning: dubious operation on enum, op || [241] +msg_241.c(62): warning: dubious operation on enum, op *= [241] +msg_241.c(63): warning: dubious operation on enum, op /= [241] +msg_241.c(64): warning: dubious operation on enum, op %= [241] +msg_241.c(65): warning: dubious operation on enum, op += [241] +msg_241.c(66): warning: dubious operation on enum, op -= [241] +msg_241.c(67): warning: dubious operation on enum, op <<= [241] +msg_241.c(68): warning: dubious operation on enum, op >>= [241] +msg_241.c(69): warning: dubious operation on enum, op &= [241] +msg_241.c(70): warning: dubious operation on enum, op ^= [241] +msg_241.c(71): warning: dubious operation on enum, op |= [241] +msg_241.c(74): warning: dubious operation on enum, op &= [241]