lint: fix wording of diagnostics about 'C99 extension'
The term 'extension' means an extension to a C standard. C99 by itself is not an extension but a revision of the C standard.
This commit is contained in:
parent
4451bd67b0
commit
4f890ce92c
|
@ -1,13 +1,13 @@
|
|||
/* $NetBSD: msg_039.c,v 1.4 2022/06/20 21:13:36 rillig Exp $ */
|
||||
/* $NetBSD: msg_039.c,v 1.5 2023/09/14 21:53:02 rillig Exp $ */
|
||||
# 3 "msg_039.c"
|
||||
|
||||
/* Test for message: zero-sized array '%s' in struct is a C99 extension [39] */
|
||||
/* Test for message: zero-sized array '%s' in struct requires C99 or later [39] */
|
||||
|
||||
/* lint1-flags: -w */
|
||||
|
||||
struct s {
|
||||
/* expect+2: warning: zero sized array is a C99 extension [322] */
|
||||
/* expect+1: warning: zero-sized array 'member' in struct is a C99 extension [39] */
|
||||
/* expect+2: warning: zero sized array requires C99 or later [322] */
|
||||
/* expect+1: warning: zero-sized array 'member' in struct requires C99 or later [39] */
|
||||
char member[0];
|
||||
char member2;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: msg_047.c,v 1.5 2022/06/20 21:13:36 rillig Exp $ */
|
||||
/* $NetBSD: msg_047.c,v 1.6 2023/09/14 21:53:02 rillig Exp $ */
|
||||
# 3 "msg_047.c"
|
||||
|
||||
/* Test for message: zero sized %s is a C99 feature [47] */
|
||||
|
@ -11,8 +11,8 @@ struct empty {
|
|||
/* expect-1: error: zero sized struct is a C99 feature [47] */
|
||||
|
||||
struct zero_sized {
|
||||
/* expect+2: error: zero sized array is a C99 extension [322] */
|
||||
/* expect+1: error: zero-sized array 'dummy' in struct is a C99 extension [39] */
|
||||
/* expect+2: error: zero sized array requires C99 or later [322] */
|
||||
/* expect+1: error: zero-sized array 'dummy' in struct requires C99 or later [39] */
|
||||
char dummy[0];
|
||||
};
|
||||
/* expect-1: error: zero sized struct is a C99 feature [47] */
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* $NetBSD: msg_322.c,v 1.3 2022/06/17 06:59:16 rillig Exp $ */
|
||||
/* $NetBSD: msg_322.c,v 1.4 2023/09/14 21:53:02 rillig Exp $ */
|
||||
# 3 "msg_322.c"
|
||||
|
||||
/* Test for message: zero sized array is a C99 extension [322] */
|
||||
/* Test for message: zero sized array requires C99 or later [322] */
|
||||
|
||||
/* lint1-flags: -sw */
|
||||
|
||||
/* expect+1: error: zero sized array is a C99 extension [322] */
|
||||
/* expect+1: error: zero sized array requires C99 or later [322] */
|
||||
typedef int empty_array[0];
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/* $NetBSD: msg_343.c,v 1.9 2023/03/28 14:44:35 rillig Exp $ */
|
||||
/* $NetBSD: msg_343.c,v 1.10 2023/09/14 21:53:02 rillig Exp $ */
|
||||
# 3 "msg_343.c"
|
||||
|
||||
/* Test for message: static array size is a C11 extension [343] */
|
||||
/* Test for message: static array size requires C11 or later [343] */
|
||||
|
||||
/* lint1-flags: -Sw -X 351 */
|
||||
|
||||
void takes_int_pointer(int []);
|
||||
void takes_int_pointer_with_ignored_size(int [3]);
|
||||
/* expect+1: error: static array size is a C11 extension [343] */
|
||||
/* expect+1: error: static array size requires C11 or later [343] */
|
||||
void takes_int_array(int[static 3]);
|
||||
/* expect+1: error: syntax error '3' [249] */
|
||||
void takes_volatile_int_array(int[volatile 3]);
|
||||
|
@ -25,7 +25,7 @@ returns_int_pointer_with_ignored_size(int a[3])
|
|||
}
|
||||
|
||||
int
|
||||
/* expect+1: error: static array size is a C11 extension [343] */
|
||||
/* expect+1: error: static array size requires C11 or later [343] */
|
||||
returns_int_array(int a[static 3])
|
||||
{
|
||||
return a[0];
|
||||
|
@ -45,5 +45,5 @@ returns_volatile_int_array(int a[volatile 3])
|
|||
* message does not make it into the actual diagnostic.
|
||||
*/
|
||||
/* expect+2: error: syntax error ']' [249] */
|
||||
/* expect+1: error: static array size is a C11 extension [343] */
|
||||
/* expect+1: error: static array size requires C11 or later [343] */
|
||||
void invalid_storage_class(int a[const typedef 3]);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%{
|
||||
/* $NetBSD: cgram.y,v 1.472 2023/08/26 10:43:53 rillig Exp $ */
|
||||
/* $NetBSD: cgram.y,v 1.473 2023/09/14 21:53:02 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
|
||||
|
@ -35,7 +35,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(__RCSID)
|
||||
__RCSID("$NetBSD: cgram.y,v 1.472 2023/08/26 10:43:53 rillig Exp $");
|
||||
__RCSID("$NetBSD: cgram.y,v 1.473 2023/09/14 21:53:02 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
@ -1448,7 +1448,7 @@ array_size:
|
|||
/* C11 6.7.6.3p7 */
|
||||
if ($2 != STATIC)
|
||||
yyerror("Bad attribute");
|
||||
/* static array size is a C11 extension */
|
||||
/* static array size requires C11 or later */
|
||||
c11ism(343);
|
||||
$$ = $3;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: decl.c,v 1.378 2023/08/26 10:43:53 rillig Exp $ */
|
||||
/* $NetBSD: decl.c,v 1.379 2023/09/14 21:53:02 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
|
||||
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(__RCSID)
|
||||
__RCSID("$NetBSD: decl.c,v 1.378 2023/08/26 10:43:53 rillig Exp $");
|
||||
__RCSID("$NetBSD: decl.c,v 1.379 2023/09/14 21:53:02 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -1113,7 +1113,7 @@ declare_member(sym_t *dsym)
|
|||
*/
|
||||
int sz = length_in_bits(dsym->s_type, dsym->s_name);
|
||||
if (sz == 0 && t == ARRAY && dsym->s_type->t_dim == 0) {
|
||||
/* zero-sized array '%s' in struct is a C99 extension */
|
||||
/* zero-sized array '%s' in struct requires C99 or later */
|
||||
c99ism(39, dsym->s_name);
|
||||
}
|
||||
|
||||
|
@ -1252,7 +1252,7 @@ block_derive_array(type_t *stp, bool dim, int len)
|
|||
/* negative array dimension (%d) */
|
||||
error(20, len);
|
||||
} else if (len == 0 && dim) {
|
||||
/* zero sized array is a C99 extension */
|
||||
/* zero sized array requires C99 or later */
|
||||
c99ism(322);
|
||||
} else if (len == 0 && !dim)
|
||||
tp->t_incomplete_array = true;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: err.c,v 1.217 2023/08/26 10:43:53 rillig Exp $ */
|
||||
/* $NetBSD: err.c,v 1.218 2023/09/14 21:53:02 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Jochen Pohl
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(__RCSID)
|
||||
__RCSID("$NetBSD: err.c,v 1.217 2023/08/26 10:43:53 rillig Exp $");
|
||||
__RCSID("$NetBSD: err.c,v 1.218 2023/09/14 21:53:02 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
@ -94,7 +94,7 @@ static const char *const msgs[] = {
|
|||
"illegal bit-field size: %d", /* 36 */
|
||||
"zero size bit-field", /* 37 */
|
||||
"function illegal in structure or union", /* 38 */
|
||||
"zero-sized array '%s' in struct is a C99 extension", /* 39 */
|
||||
"zero-sized array '%s' in struct requires C99 or later", /* 39 */
|
||||
"", /* never used */ /* 40 */
|
||||
"bit-field in union is very unusual", /* 41 */
|
||||
"forward reference to enum type", /* 42 */
|
||||
|
@ -377,7 +377,7 @@ static const char *const msgs[] = {
|
|||
"compound literals are a C99/GCC extension", /* 319 */
|
||||
"'({ ... })' is a GCC extension", /* 320 */
|
||||
"array initializer with designators is a C99 feature", /* 321 */
|
||||
"zero sized array is a C99 extension", /* 322 */
|
||||
"zero sized array requires C99 or later", /* 322 */
|
||||
"continue in 'do ... while (0)' loop", /* 323 */
|
||||
"suggest cast from '%s' to '%s' on op '%s' to avoid overflow", /* 324 */
|
||||
"variable declaration in for loop", /* 325 */
|
||||
|
@ -398,7 +398,7 @@ static const char *const msgs[] = {
|
|||
"initialization with '[a...b]' is a GCC extension", /* 340 */
|
||||
"argument to '%s' must be 'unsigned char' or EOF, not '%s'", /* 341 */
|
||||
"argument to '%s' must be cast to 'unsigned char', not to '%s'", /* 342 */
|
||||
"static array size is a C11 extension", /* 343 */
|
||||
"static array size requires C11 or later", /* 343 */
|
||||
"bit-field of type plain 'int' has implementation-defined signedness", /* 344 */
|
||||
"generic selection requires C11 or later", /* 345 */
|
||||
"call to '%s' effectively discards 'const' from argument", /* 346 */
|
||||
|
|
Loading…
Reference in New Issue