Module Name: src Committed By: rillig Date: Sat Sep 4 12:30:46 UTC 2021
Modified Files: src/usr.bin/xlint/lint1: cgram.y check-msgs.lua decl.c func.c init.c tree.c Log Message: lint: spell out abbreviations in comments No functional change. To generate a diff of this commit: cvs rdiff -u -r1.359 -r1.360 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.11 -r1.12 src/usr.bin/xlint/lint1/check-msgs.lua cvs rdiff -u -r1.229 -r1.230 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.122 -r1.123 src/usr.bin/xlint/lint1/func.c cvs rdiff -u -r1.208 -r1.209 src/usr.bin/xlint/lint1/init.c cvs rdiff -u -r1.376 -r1.377 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.359 src/usr.bin/xlint/lint1/cgram.y:1.360 --- src/usr.bin/xlint/lint1/cgram.y:1.359 Sat Aug 28 13:29:26 2021 +++ src/usr.bin/xlint/lint1/cgram.y Sat Sep 4 12:30:46 2021 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.359 2021/08/28 13:29:26 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.360 2021/09/04 12:30:46 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.359 2021/08/28 13:29:26 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.360 2021/09/04 12:30:46 rillig Exp $"); #endif #include <limits.h> @@ -1559,7 +1559,7 @@ designator: /* C99 6.7.8 "Initializati T_LBRACK range T_RBRACK { add_designator_subscript($2); if (!Sflag) - /* array initializer with des.s is a C9X feature */ + /* array initializer with designators is a C9X ... */ warning(321); } | T_POINT identifier { Index: src/usr.bin/xlint/lint1/check-msgs.lua diff -u src/usr.bin/xlint/lint1/check-msgs.lua:1.11 src/usr.bin/xlint/lint1/check-msgs.lua:1.12 --- src/usr.bin/xlint/lint1/check-msgs.lua:1.11 Tue Jun 15 08:37:56 2021 +++ src/usr.bin/xlint/lint1/check-msgs.lua Sat Sep 4 12:30:46 2021 @@ -1,9 +1,9 @@ #! /usr/bin/lua --- $NetBSD: check-msgs.lua,v 1.11 2021/06/15 08:37:56 rillig Exp $ +-- $NetBSD: check-msgs.lua,v 1.12 2021/09/04 12:30:46 rillig Exp $ --[[ -usage: lua ./check-msgs.lua *.c +usage: lua ./check-msgs.lua *.c *.y Check that the message text in the comments of the C source code matches the actual user-visible message text in err.c. @@ -48,22 +48,6 @@ local function check_message(fname, line msg = msg:gsub("%*/", "**") msg = msg:gsub("\\(.)", "%1") - -- allow a few abbreviations to be used in the code - comment = comment:gsub("arg%.", "argument") - comment = comment:gsub("comb%.", "combination") - comment = comment:gsub("conv%.", "conversion") - comment = comment:gsub("decl%.", "declaration") - comment = comment:gsub("defn%.", "definition") - comment = comment:gsub("des%.s", "designators") - comment = comment:gsub("expr%.", "expression") - comment = comment:gsub("func%.", "function") - comment = comment:gsub("incomp%.", "incompatible") - comment = comment:gsub("init%.", "initialize") - comment = comment:gsub("param%.", "parameter") - comment = comment:gsub("req%.", "requires") - comment = comment:gsub("poss%.", "possibly") - comment = comment:gsub("trad%.", "traditional") - if comment == msg then return end Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.229 src/usr.bin/xlint/lint1/decl.c:1.230 --- src/usr.bin/xlint/lint1/decl.c:1.229 Sat Sep 4 12:05:54 2021 +++ src/usr.bin/xlint/lint1/decl.c Sat Sep 4 12:30:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.229 2021/09/04 12:05:54 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.230 2021/09/04 12:30:46 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.229 2021/09/04 12:05:54 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.230 2021/09/04 12:30:46 rillig Exp $"); #endif #include <sys/param.h> @@ -1070,7 +1070,7 @@ check_type(sym_t *sym) if (dcs->d_ctx == PROTO_ARG) { if (sym->s_scl != ABSTRACT) { lint_assert(sym->s_name != unnamed); - /* void param. cannot have name: %s */ + /* void parameter cannot have ... */ error(61, sym->s_name); *tpp = gettyp(INT); } @@ -1741,7 +1741,7 @@ newtag(sym_t *tag, scl_t scl, bool decl, /* "struct a;" */ if (!tflag) { if (!sflag) - /* decl. introduces new type ... */ + /* declaration introduces new ... */ warning(44, storage_class_name(scl), tag->s_name); tag = pushdown(tag); @@ -1762,9 +1762,8 @@ newtag(sym_t *tag, scl_t scl, bool decl, /* base type is really '%s %s' */ warning(45, storage_class_name(tag->s_scl), tag->s_name); - /* declaration introduces new type in ANSI C: %s %s */ if (!sflag) { - /* decl. introduces new type in ANSI C: %s %s */ + /* declaration introduces new type in ... */ warning(44, storage_class_name(scl), tag->s_name); } @@ -2360,7 +2359,7 @@ check_old_style_definition(sym_t *rdsym, */ if (!eqtype(arg->s_type, parg->s_type, true, true, &dowarn) || dowarn) { - /* prototype does not match old style defn., arg #%d */ + /* prototype does not match old style ... */ error(299, n); msg = true; } @@ -2542,7 +2541,7 @@ check_func_lint_directives(void) if (arg->s_type->t_tspec != PTR || ((t = arg->s_type->t_subt->t_tspec) != CHAR && t != UCHAR && t != SCHAR)) { - /* arg. %d must be 'char *' for PRINTFLIKE/SCANFLIKE */ + /* argument %d must be 'char *' for PRINTFLIKE/... */ warning(293, narg); printflike_argnum = scanflike_argnum = -1; } @@ -2697,7 +2696,7 @@ check_local_redeclaration(const sym_t *d */ if (tflag) { if (hflag) - /* decl. hides parameter: %s */ + /* declaration hides parameter: %s */ warning(91, dsym->s_name); rmsym(rsym); } Index: src/usr.bin/xlint/lint1/func.c diff -u src/usr.bin/xlint/lint1/func.c:1.122 src/usr.bin/xlint/lint1/func.c:1.123 --- src/usr.bin/xlint/lint1/func.c:1.122 Sat Aug 28 13:29:26 2021 +++ src/usr.bin/xlint/lint1/func.c Sat Sep 4 12:30:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: func.c,v 1.122 2021/08/28 13:29:26 rillig Exp $ */ +/* $NetBSD: func.c,v 1.123 2021/09/04 12:30:46 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: func.c,v 1.122 2021/08/28 13:29:26 rillig Exp $"); +__RCSID("$NetBSD: func.c,v 1.123 2021/09/04 12:30:46 rillig Exp $"); #endif #include <stdlib.h> @@ -697,7 +697,7 @@ switch1(tnode_t *tn) if (tn != NULL && tflag) { t = tn->tn_type->t_tspec; if (t == LONG || t == ULONG || t == QUAD || t == UQUAD) { - /* switch expr. must be of type 'int' in trad. C */ + /* switch expression must be of type 'int' in ... */ warning(271); } } Index: src/usr.bin/xlint/lint1/init.c diff -u src/usr.bin/xlint/lint1/init.c:1.208 src/usr.bin/xlint/lint1/init.c:1.209 --- src/usr.bin/xlint/lint1/init.c:1.208 Sat Aug 14 12:46:23 2021 +++ src/usr.bin/xlint/lint1/init.c Sat Sep 4 12:30:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.208 2021/08/14 12:46:23 rillig Exp $ */ +/* $NetBSD: init.c,v 1.209 2021/09/04 12:30:46 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: init.c,v 1.208 2021/08/14 12:46:23 rillig Exp $"); +__RCSID("$NetBSD: init.c,v 1.209 2021/09/04 12:30:46 rillig Exp $"); #endif #include <stdlib.h> @@ -319,7 +319,7 @@ check_trad_no_auto_aggregate(const sym_t if (has_automatic_storage_duration(sym) && !is_scalar(sym->s_type->t_tspec)) { - /* no automatic aggregate initialization in trad. C */ + /* no automatic aggregate initialization in traditional C */ warning(188); } } Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.376 src/usr.bin/xlint/lint1/tree.c:1.377 --- src/usr.bin/xlint/lint1/tree.c:1.376 Sat Sep 4 10:09:19 2021 +++ src/usr.bin/xlint/lint1/tree.c Sat Sep 4 12:30:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.376 2021/09/04 10:09:19 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.377 2021/09/04 12:30:46 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.376 2021/09/04 10:09:19 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.377 2021/09/04 12:30:46 rillig Exp $"); #endif #include <float.h> @@ -1067,7 +1067,7 @@ typeok_colon_pointer(const mod_t *mp, co if ((lst == VOID && rst == FUNC) || (lst == FUNC && rst == VOID)) { /* (void *)0 handled above */ if (sflag) - /* ANSI C forbids conv. of %s to %s, op %s */ + /* ANSI C forbids conversion of %s to %s, op %s */ warning(305, "function pointer", "'void *'", mp->m_name); return; @@ -1465,11 +1465,11 @@ check_assign_void_pointer(op_t op, int a warning(303, rts, lts); break; case FARG: - /* ANSI C forbids conv. of %s to %s, arg #%d */ + /* ANSI C forbids conversion of %s to %s, arg #%d */ warning(304, rts, lts, arg); break; default: - /* ANSI C forbids conv. of %s to %s, op %s */ + /* ANSI C forbids conversion of %s to %s, op %s */ warning(305, rts, lts, op_name(op)); break; } @@ -1535,7 +1535,7 @@ check_assign_pointer_integer(op_t op, in warning(183, lx, type_name(ltp), rx, type_name(rtp)); break; case FARG: - /* illegal comb. of %s (%s) and %s (%s), arg #%d */ + /* illegal combination of %s (%s) and %s (%s), arg #%d */ warning(154, lx, type_name(ltp), rx, type_name(rtp), arg); break; @@ -2141,11 +2141,11 @@ check_integer_conversion(op_t op, int ar /* conversion from '%s' may lose accuracy */ if (aflag > 0) { if (op == FARG) { - /* conv. from '%s' to '%s' may lose ... */ + /* conversion from '%s' to '%s' may ... */ warning(298, type_name(tn->tn_type), type_name(tp), arg); } else { - /* conv. from '%s' to '%s' may lose accuracy */ + /* conversion from '%s' to '%s' may ... */ warning(132, type_name(tn->tn_type), type_name(tp)); } @@ -2297,7 +2297,7 @@ convert_constant_floating(op_t op, int a if (v->v_ldbl > max || v->v_ldbl < min) { lint_assert(nt != LDOUBLE); if (op == FARG) { - /* conv. of '%s' to '%s' is out of range, ... */ + /* conversion of '%s' to '%s' is out of range, ... */ warning(295, type_name(gettyp(ot)), type_name(tp), arg); } else { @@ -2346,7 +2346,7 @@ convert_constant_check_range_bitor(size_ uint64_t xmask, op_t op) { if (nsz < osz && (v->v_quad & xmask) != 0) { - /* constant truncated by conv., op %s */ + /* constant truncated by conversion, op %s */ warning(306, op_name(op)); } }