lint: add tests for messages 93, 94, 95, 96, 97, 98, 99
This commit is contained in:
parent
4b5ddda496
commit
7d8d33cba8
@ -1,7 +1,12 @@
|
||||
/* $NetBSD: msg_093.c,v 1.1 2021/01/02 10:22:43 rillig Exp $ */
|
||||
/* $NetBSD: msg_093.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
|
||||
# 3 "msg_093.c"
|
||||
|
||||
// Test for message: dubious static function at block level: %s [93]
|
||||
|
||||
TODO: "Add example code that triggers the above message."
|
||||
TODO: "Add example code that almost triggers the above message."
|
||||
void
|
||||
example(void)
|
||||
{
|
||||
static void nested(void);
|
||||
|
||||
nested();
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
msg_093.c(6): syntax error ':' [249]
|
||||
msg_093.c(9): warning: dubious static function at block level: nested [93]
|
||||
|
@ -1,7 +1,12 @@
|
||||
/* $NetBSD: msg_094.c,v 1.1 2021/01/02 10:22:43 rillig Exp $ */
|
||||
/* $NetBSD: msg_094.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
|
||||
# 3 "msg_094.c"
|
||||
|
||||
// Test for message: function has illegal storage class: %s [94]
|
||||
|
||||
TODO: "Add example code that triggers the above message."
|
||||
TODO: "Add example code that almost triggers the above message."
|
||||
register int
|
||||
global_example(int arg)
|
||||
{
|
||||
register int register_example(int);
|
||||
|
||||
return arg;
|
||||
}
|
||||
|
@ -1 +1,2 @@
|
||||
msg_094.c(6): syntax error ':' [249]
|
||||
msg_094.c(7): illegal storage class [8]
|
||||
msg_094.c(9): function has illegal storage class: register_example [94]
|
||||
|
@ -1,7 +1,19 @@
|
||||
/* $NetBSD: msg_095.c,v 1.1 2021/01/02 10:22:43 rillig Exp $ */
|
||||
/* $NetBSD: msg_095.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
|
||||
# 3 "msg_095.c"
|
||||
|
||||
// Test for message: declaration hides earlier one: %s [95]
|
||||
|
||||
TODO: "Add example code that triggers the above message."
|
||||
TODO: "Add example code that almost triggers the above message."
|
||||
/* lint1-flags: -ghSw */
|
||||
|
||||
int identifier;
|
||||
|
||||
int
|
||||
example(int identifier)
|
||||
{
|
||||
|
||||
{
|
||||
int identifier = 3;
|
||||
}
|
||||
|
||||
return identifier;
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
msg_095.c(6): syntax error ':' [249]
|
||||
msg_095.c(15): warning: declaration hides earlier one: identifier [95]
|
||||
|
@ -1,7 +1,22 @@
|
||||
/* $NetBSD: msg_096.c,v 1.1 2021/01/02 10:22:43 rillig Exp $ */
|
||||
/* $NetBSD: msg_096.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
|
||||
# 3 "msg_096.c"
|
||||
|
||||
// Test for message: cannot dereference non-pointer type [96]
|
||||
|
||||
TODO: "Add example code that triggers the above message."
|
||||
TODO: "Add example code that almost triggers the above message."
|
||||
int
|
||||
unary_plus(int i)
|
||||
{
|
||||
return +i;
|
||||
}
|
||||
|
||||
int
|
||||
unary_minus(int i)
|
||||
{
|
||||
return -i;
|
||||
}
|
||||
|
||||
int
|
||||
unary_asterisk(int i)
|
||||
{
|
||||
return *i;
|
||||
}
|
||||
|
@ -1 +1,3 @@
|
||||
msg_096.c(6): syntax error ':' [249]
|
||||
msg_096.c(21): cannot dereference non-pointer type [96]
|
||||
msg_096.c(21): warning: function unary_asterisk expects to return value [214]
|
||||
msg_096.c(19): warning: argument i unused in function unary_asterisk [231]
|
||||
|
@ -1,7 +1,21 @@
|
||||
/* $NetBSD: msg_097.c,v 1.1 2021/01/02 10:22:43 rillig Exp $ */
|
||||
/* $NetBSD: msg_097.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
|
||||
# 3 "msg_097.c"
|
||||
|
||||
// Test for message: suffix U is illegal in traditional C [97]
|
||||
/* Test for message: suffix U is illegal in traditional C [97] */
|
||||
|
||||
TODO: "Add example code that triggers the above message."
|
||||
TODO: "Add example code that almost triggers the above message."
|
||||
/* lint1-flags: -gtw */
|
||||
|
||||
void
|
||||
example()
|
||||
{
|
||||
int i = 1234567;
|
||||
unsigned u = 1234567;
|
||||
unsigned u_upper = 1234567U;
|
||||
unsigned u_lower = 1234567u;
|
||||
|
||||
long l = 1234567L;
|
||||
unsigned long ul = 1234567UL;
|
||||
|
||||
long long ll = 1234567LL;
|
||||
unsigned long long ull = 1234567ULL;
|
||||
}
|
||||
|
@ -1 +1,11 @@
|
||||
msg_097.c(6): syntax error ':' [249]
|
||||
(1): warning: 'long double' is illegal in traditional C [266]
|
||||
(1): warning: function prototypes are illegal in traditional C [270]
|
||||
(2): warning: 'long double' is illegal in traditional C [266]
|
||||
(2): warning: function prototypes are illegal in traditional C [270]
|
||||
(3): warning: 'long double' is illegal in traditional C [266]
|
||||
(3): warning: 'long double' is illegal in traditional C [266]
|
||||
(3): warning: function prototypes are illegal in traditional C [270]
|
||||
msg_097.c(13): warning: suffix U is illegal in traditional C [97]
|
||||
msg_097.c(14): warning: suffix U is illegal in traditional C [97]
|
||||
msg_097.c(17): warning: suffix U is illegal in traditional C [97]
|
||||
msg_097.c(20): warning: suffix U is illegal in traditional C [97]
|
||||
|
@ -1,7 +1,20 @@
|
||||
/* $NetBSD: msg_098.c,v 1.1 2021/01/02 10:22:43 rillig Exp $ */
|
||||
/* $NetBSD: msg_098.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
|
||||
# 3 "msg_098.c"
|
||||
|
||||
// Test for message: suffixes F and L are illegal in traditional C [98]
|
||||
/* Test for message: suffixes F and L are illegal in traditional C [98] */
|
||||
|
||||
TODO: "Add example code that triggers the above message."
|
||||
TODO: "Add example code that almost triggers the above message."
|
||||
/* lint1-flags: -gtw */
|
||||
|
||||
void
|
||||
example()
|
||||
{
|
||||
float f = 1234.5;
|
||||
float f_F = 1234.5F;
|
||||
float f_f = 1234.5F;
|
||||
|
||||
double d = 1234.5;
|
||||
double d_U = 1234.5U;
|
||||
|
||||
long double ld = 1234.5;
|
||||
long double ld_L = 1234.5L;
|
||||
}
|
||||
|
@ -1 +1,13 @@
|
||||
msg_098.c(6): syntax error ':' [249]
|
||||
(1): warning: 'long double' is illegal in traditional C [266]
|
||||
(1): warning: function prototypes are illegal in traditional C [270]
|
||||
(2): warning: 'long double' is illegal in traditional C [266]
|
||||
(2): warning: function prototypes are illegal in traditional C [270]
|
||||
(3): warning: 'long double' is illegal in traditional C [266]
|
||||
(3): warning: 'long double' is illegal in traditional C [266]
|
||||
(3): warning: function prototypes are illegal in traditional C [270]
|
||||
msg_098.c(12): warning: suffixes F and L are illegal in traditional C [98]
|
||||
msg_098.c(13): warning: suffixes F and L are illegal in traditional C [98]
|
||||
msg_098.c(16): syntax error 'U' [249]
|
||||
msg_098.c(18): warning: 'long double' is illegal in traditional C [266]
|
||||
msg_098.c(19): warning: 'long double' is illegal in traditional C [266]
|
||||
msg_098.c(19): warning: suffixes F and L are illegal in traditional C [98]
|
||||
|
@ -1,7 +1,11 @@
|
||||
/* $NetBSD: msg_099.c,v 1.1 2021/01/02 10:22:43 rillig Exp $ */
|
||||
/* $NetBSD: msg_099.c,v 1.2 2021/01/07 00:38:46 rillig Exp $ */
|
||||
# 3 "msg_099.c"
|
||||
|
||||
// Test for message: %s undefined [99]
|
||||
|
||||
TODO: "Add example code that triggers the above message."
|
||||
TODO: "Add example code that almost triggers the above message."
|
||||
void
|
||||
example(int defined_variable)
|
||||
{
|
||||
int ok = defined_variable;
|
||||
int error = undefined_variable;
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
msg_099.c(6): syntax error ':' [249]
|
||||
msg_099.c(10): undefined_variable undefined [99]
|
||||
|
Loading…
Reference in New Issue
Block a user