lint: spell check
This commit is contained in:
parent
9f14734d43
commit
0ab178ad4b
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: emit.c,v 1.6 2014/04/17 18:52:03 christos Exp $ */
|
||||
/* $NetBSD: emit.c,v 1.7 2020/12/28 21:24:55 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Jochen Pohl
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(__RCSID) && !defined(lint)
|
||||
__RCSID("$NetBSD: emit.c,v 1.6 2014/04/17 18:52:03 christos Exp $");
|
||||
__RCSID("$NetBSD: emit.c,v 1.7 2020/12/28 21:24:55 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
|
@ -184,7 +184,7 @@ outqchar(int c)
|
|||
}
|
||||
|
||||
/*
|
||||
* write a strint to the output buffer
|
||||
* write a string to the output buffer
|
||||
* the string must not contain any characters which
|
||||
* should be quoted
|
||||
*/
|
||||
|
@ -200,7 +200,7 @@ outstrg(const char *s)
|
|||
}
|
||||
|
||||
/*
|
||||
* write an integer value to toe output buffer
|
||||
* write an integer value to the output buffer
|
||||
*/
|
||||
void
|
||||
outint(int i)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: lint.h,v 1.16 2020/12/28 18:49:02 rillig Exp $ */
|
||||
/* $NetBSD: lint.h,v 1.17 2020/12/28 21:24:55 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Jochen Pohl
|
||||
|
@ -46,7 +46,7 @@
|
|||
#include "param.h"
|
||||
|
||||
/*
|
||||
* Type specifiers, used in type structures (type_t) and otherwere.
|
||||
* Type specifiers, used in type structures (type_t) and elsewhere.
|
||||
*/
|
||||
typedef enum {
|
||||
NOTSPEC = 0,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mem.c,v 1.8 2020/02/10 04:54:01 christos Exp $ */
|
||||
/* $NetBSD: mem.c,v 1.9 2020/12/28 21:24:55 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Jochen Pohl
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(__RCSID) && !defined(lint)
|
||||
__RCSID("$NetBSD: mem.c,v 1.8 2020/02/10 04:54:01 christos Exp $");
|
||||
__RCSID("$NetBSD: mem.c,v 1.9 2020/12/28 21:24:55 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -137,3 +137,4 @@ xmapalloc(size_t len)
|
|||
err(1, "Cannot map memory for %lu bytes", (unsigned long)len);
|
||||
return p;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: param.h,v 1.5 2003/09/21 17:06:40 martin Exp $ */
|
||||
/* $NetBSD: param.h,v 1.6 2020/12/28 21:24:55 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Jochen Pohl
|
||||
|
@ -38,14 +38,14 @@
|
|||
#define STRBLEN 256
|
||||
|
||||
/*
|
||||
* This defines the size of memory blocks which are used to allocate
|
||||
* memory in larger chunks.
|
||||
* The size of memory blocks which are used to allocate memory in larger
|
||||
* chunks.
|
||||
*/
|
||||
#define MBLKSIZ ((size_t)0x4000)
|
||||
|
||||
/*
|
||||
* Sizes of hash tables
|
||||
* Should be a prime. Possible primes are
|
||||
* Should be primes. Possible primes are
|
||||
* 307, 401, 503, 601, 701, 809, 907, 1009, 1103, 1201, 1301, 1409, 1511.
|
||||
*
|
||||
* HSHSIZ1 symbol table 1st pass
|
||||
|
@ -67,7 +67,7 @@
|
|||
#define WCHAR INT
|
||||
|
||||
/*
|
||||
* And the sparc64 long double code generation is broken in old gcc.
|
||||
* The sparc64 long double code generation is broken in old gcc.
|
||||
*/
|
||||
#if !defined(__sparc64__) || !defined(__GNUC__) || __GNUC__ > 2
|
||||
typedef long double ldbl_t;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%{
|
||||
/* $NetBSD: cgram.y,v 1.109 2020/12/28 19:47:42 rillig Exp $ */
|
||||
/* $NetBSD: cgram.y,v 1.110 2020/12/28 21:24:55 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.109 2020/12/28 19:47:42 rillig Exp $");
|
||||
__RCSID("$NetBSD: cgram.y,v 1.110 2020/12/28 21:24:55 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
|
@ -52,7 +52,7 @@ extern char *yytext;
|
|||
int blklev;
|
||||
|
||||
/*
|
||||
* level for memory allocation. Normaly the same as blklev.
|
||||
* level for memory allocation. Normally the same as blklev.
|
||||
* An exception is the declaration of arguments in prototypes. Memory
|
||||
* for these can't be freed after the declaration, but symbols must
|
||||
* be removed from the symbol table after the declaration.
|
||||
|
@ -611,7 +611,7 @@ type_attribute_list:
|
|||
;
|
||||
|
||||
clrtyp:
|
||||
{
|
||||
/* empty */ {
|
||||
clrtyp();
|
||||
}
|
||||
;
|
||||
|
@ -697,8 +697,8 @@ struct_spec:
|
|||
* STDC requires that "struct a;" always introduces
|
||||
* a new tag if "a" is not declared at current level
|
||||
*
|
||||
* yychar is valid because otherwise the parser would
|
||||
* not been able to decide if he must shift or reduce
|
||||
* yychar is valid because otherwise the parser would not
|
||||
* have been able to decide if it must shift or reduce
|
||||
*/
|
||||
$$ = mktag($2, $1, 0, yychar == T_SEMI);
|
||||
}
|
||||
|
@ -995,7 +995,7 @@ type_init_decls:
|
|||
;
|
||||
|
||||
notype_init_decl:
|
||||
notype_decl opt_asm_or_symbolrename {
|
||||
notype_decl opt_asm_or_symbolrename {
|
||||
idecl($1, 0, $2);
|
||||
chksz($1);
|
||||
}
|
||||
|
@ -1007,7 +1007,7 @@ notype_init_decl:
|
|||
;
|
||||
|
||||
type_init_decl:
|
||||
type_decl opt_asm_or_symbolrename {
|
||||
type_decl opt_asm_or_symbolrename {
|
||||
idecl($1, 0, $2);
|
||||
chksz($1);
|
||||
}
|
||||
|
@ -1342,7 +1342,7 @@ lorange:
|
|||
}
|
||||
;
|
||||
range:
|
||||
constant {
|
||||
constant {
|
||||
$$.lo = toicon($1, 1);
|
||||
$$.hi = $$.lo + 1;
|
||||
}
|
||||
|
@ -1390,7 +1390,7 @@ init_rbrace:
|
|||
;
|
||||
|
||||
type_name:
|
||||
{
|
||||
{
|
||||
pushdecl(ABSTRACT);
|
||||
} abstract_declaration {
|
||||
popdecl();
|
||||
|
@ -1702,8 +1702,8 @@ for_start:
|
|||
}
|
||||
;
|
||||
for_exprs:
|
||||
for_start declspecs deftyp notype_init_decls T_SEMI opt_expr
|
||||
T_SEMI opt_expr T_RPARN {
|
||||
for_start declspecs deftyp notype_init_decls T_SEMI opt_expr
|
||||
T_SEMI opt_expr T_RPARN {
|
||||
c99ism(325);
|
||||
for1(NULL, $6, $8);
|
||||
CLRWFLGS(__FILE__, __LINE__);
|
||||
|
@ -1971,7 +1971,7 @@ string:
|
|||
;
|
||||
|
||||
string2:
|
||||
T_STRING {
|
||||
T_STRING {
|
||||
if (tflag) {
|
||||
/* concatenated strings are illegal in traditional C */
|
||||
warning(219);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: decl.c,v 1.72 2020/12/28 18:49:02 rillig Exp $ */
|
||||
/* $NetBSD: decl.c,v 1.73 2020/12/28 21:24:55 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.72 2020/12/28 18:49:02 rillig Exp $");
|
||||
__RCSID("$NetBSD: decl.c,v 1.73 2020/12/28 21:24:55 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
|
@ -57,7 +57,7 @@ static type_t *typetab;
|
|||
int enumval;
|
||||
|
||||
/*
|
||||
* pointer to top element of a stack which contains informations local
|
||||
* pointer to top element of a stack which contains information local
|
||||
* to nested declarations
|
||||
*/
|
||||
dinfo_t *dcs;
|
||||
|
@ -131,9 +131,9 @@ initdecl(void)
|
|||
}
|
||||
|
||||
/*
|
||||
* Returns a shared type structure vor arithmetic types and void.
|
||||
* Returns a shared type structure for arithmetic types and void.
|
||||
*
|
||||
* It's important do duplicate this structure (using duptyp() or tdupdyp())
|
||||
* It's important to duplicate this structure (using duptyp() or tdupdyp())
|
||||
* if it is to be modified (adding qualifiers or anything else).
|
||||
*/
|
||||
type_t *
|
||||
|
@ -246,7 +246,7 @@ addscl(scl_t sc)
|
|||
* deftyp() to build the type used for all declarators in this
|
||||
* declaration.
|
||||
*
|
||||
* Is tp->t_typedef 1, the type comes from a previously defined typename.
|
||||
* If tp->t_typedef is 1, the type comes from a previously defined typename.
|
||||
* Otherwise it comes from a type specifier (int, long, ...) or a
|
||||
* struct/union/enum tag.
|
||||
*/
|
||||
|
@ -627,7 +627,7 @@ popdecl(void)
|
|||
* Symbols declared in (nested) structs or enums are
|
||||
* part of the next level (they are removed from the
|
||||
* symbol table if the symbols of the outher level are
|
||||
* removed)
|
||||
* removed).
|
||||
*/
|
||||
if ((*dcs->d_ldlsym = di->d_dlsyms) != NULL)
|
||||
dcs->d_ldlsym = di->d_ldlsym;
|
||||
|
@ -649,8 +649,8 @@ popdecl(void)
|
|||
/*
|
||||
* casts and sizeof
|
||||
* Append all symbols declared in the abstract declaration
|
||||
* to the list of symbols declared in the surounding decl.
|
||||
* or block.
|
||||
* to the list of symbols declared in the surrounding
|
||||
* declaration or block.
|
||||
* XXX I'm not sure whether they should be removed from the
|
||||
* symbol table now or later.
|
||||
*/
|
||||
|
@ -716,7 +716,7 @@ clrtyp(void)
|
|||
}
|
||||
|
||||
/*
|
||||
* Create a type structure from the informations gathered in
|
||||
* Create a type structure from the information gathered in
|
||||
* the declaration stack.
|
||||
* Complain about storage classes which are not possible in current
|
||||
* context.
|
||||
|
@ -882,7 +882,7 @@ mrgtspec(tspec_t t, tspec_t s)
|
|||
}
|
||||
|
||||
/*
|
||||
* Return the length of a type in bit.
|
||||
* Return the length of a type in bits.
|
||||
*
|
||||
* Printing a message if the outhermost dimension of an array is 0 must
|
||||
* be done by the caller. All other problems are reported by length()
|
||||
|
@ -1111,7 +1111,7 @@ decl1str(sym_t *dsym)
|
|||
/*
|
||||
* bit field
|
||||
*
|
||||
* only unsigned und signed int are protable bit-field types
|
||||
* only unsigned and signed int are portable bit-field types
|
||||
*(at least in ANSI C, in traditional C only unsigned int)
|
||||
*/
|
||||
if (t == CHAR || t == UCHAR || t == SCHAR ||
|
||||
|
@ -1297,7 +1297,7 @@ mergepq(pqinf_t *p1, pqinf_t *p2)
|
|||
}
|
||||
|
||||
/*
|
||||
* Followint 3 functions extend the type of a declarator with
|
||||
* The following 3 functions extend the type of a declarator with
|
||||
* pointer, function and array types.
|
||||
*
|
||||
* The current type is the Type built by deftyp() (dcs->d_type) and
|
||||
|
@ -1498,8 +1498,7 @@ chkfdef(sym_t *sym, int msg)
|
|||
|
||||
/*
|
||||
* Process the name in a declarator.
|
||||
* If the symbol does already exists, a new one is created.
|
||||
* The symbol becomes one of the storage classes EXTERN, STATIC, AUTO or
|
||||
* The symbol gets one of the storage classes EXTERN, STATIC, AUTO or
|
||||
* TYPEDEF.
|
||||
* s_def and s_reg are valid after dname().
|
||||
*/
|
||||
|
@ -1521,7 +1520,7 @@ dname(sym_t *sym)
|
|||
switch (dcs->d_ctx) {
|
||||
case MOS:
|
||||
case MOU:
|
||||
/* Parent setzen */
|
||||
/* Set parent */
|
||||
sym->s_styp = dcs->d_tagtyp->t_str;
|
||||
sym->s_def = DEF;
|
||||
sym->s_value.v_tspec = INT;
|
||||
|
@ -1772,7 +1771,7 @@ scltoa(scl_t sc)
|
|||
}
|
||||
|
||||
/*
|
||||
* tp points to the type of the, tag, fmem to the list of members/enums.
|
||||
* tp points to the type of the tag, fmem to the list of members/enums.
|
||||
*/
|
||||
type_t *
|
||||
compltag(type_t *tp, sym_t *fmem)
|
||||
|
@ -1782,7 +1781,7 @@ compltag(type_t *tp, sym_t *fmem)
|
|||
int n;
|
||||
sym_t *mem;
|
||||
|
||||
/* from now a complete type */
|
||||
/* from now on the type is complete */
|
||||
setcompl(tp, 0);
|
||||
|
||||
if ((t = tp->t_tspec) != ENUM) {
|
||||
|
@ -1827,11 +1826,11 @@ compltag(type_t *tp, sym_t *fmem)
|
|||
}
|
||||
|
||||
/*
|
||||
* Processes the name of an enumerator in en enum declaration.
|
||||
* Processes the name of an enumerator in an enum declaration.
|
||||
*
|
||||
* sym points to the enumerator
|
||||
* val is the value of the enumerator
|
||||
* impl is 1 if the value of the enumerator was not explicit specified.
|
||||
* impl is 1 if the value of the enumerator was not explicitly specified.
|
||||
*/
|
||||
sym_t *
|
||||
ename(sym_t *sym, int val, int impl)
|
||||
|
@ -1847,9 +1846,9 @@ ename(sym_t *sym, int val, int impl)
|
|||
/* redeclaration of %s */
|
||||
error(27, sym->s_name);
|
||||
/*
|
||||
* inside blocks it should not too complicated
|
||||
* to find the position of the previous
|
||||
* declaration
|
||||
* inside blocks it should not be too
|
||||
* complicated to find the position of the
|
||||
* previous declaration
|
||||
*/
|
||||
if (blklev == 0)
|
||||
prevdecl(-1, sym);
|
||||
|
@ -1922,9 +1921,9 @@ decl1ext(sym_t *dsym, int initflg)
|
|||
if ((rdsym = dcs->d_rdcsym) != NULL) {
|
||||
|
||||
/*
|
||||
* If the old symbol stems from a old style function definition
|
||||
* we have remembered the params in rdsmy->s_args and compare
|
||||
* them with the params of the prototype.
|
||||
* If the old symbol stems from an old style function
|
||||
* definition, we have remembered the params in rdsmy->s_args
|
||||
* and compare them with the params of the prototype.
|
||||
*/
|
||||
if (rdsym->s_osdef && dsym->s_type->t_proto) {
|
||||
redec = chkosdef(rdsym, dsym);
|
||||
|
@ -1941,7 +1940,7 @@ decl1ext(sym_t *dsym, int initflg)
|
|||
}
|
||||
|
||||
/*
|
||||
* Overtake the rememberd params if the new symbol
|
||||
* Take over the remembered params if the new symbol
|
||||
* is not a prototype.
|
||||
*/
|
||||
if (rdsym->s_osdef && !dsym->s_type->t_proto) {
|
||||
|
@ -1992,7 +1991,7 @@ decl1ext(sym_t *dsym, int initflg)
|
|||
}
|
||||
|
||||
/*
|
||||
* Copies informations about usage into a new symbol table entry of
|
||||
* Copies information about usage into a new symbol table entry of
|
||||
* the same symbol.
|
||||
*/
|
||||
void
|
||||
|
@ -2204,8 +2203,8 @@ eqargs(type_t *tp1, type_t *tp2, int *dowarn)
|
|||
/*
|
||||
* mnoarg() (matches functions with no argument type information)
|
||||
* returns 1 if all parameters of a prototype are compatible with
|
||||
* and old style function declaration.
|
||||
* This is the case if following conditions are met:
|
||||
* an old style function declaration.
|
||||
* This is the case if the following conditions are met:
|
||||
* 1. the prototype must have a fixed number of parameters
|
||||
* 2. no parameter is of type float
|
||||
* 3. no parameter is converted to another type if integer promotion
|
||||
|
@ -2288,7 +2287,7 @@ chkosdef(sym_t *rdsym, sym_t *dsym)
|
|||
}
|
||||
|
||||
/*
|
||||
* Complets a type by copying the dimension and prototype information
|
||||
* Completes a type by copying the dimension and prototype information
|
||||
* from a second compatible type.
|
||||
*
|
||||
* Following lines are legal:
|
||||
|
@ -2464,7 +2463,7 @@ cluparg(void)
|
|||
}
|
||||
|
||||
/*
|
||||
* print a warning for each argument off an old style function
|
||||
* print a warning for each argument of an old style function
|
||||
* definition which defaults to int
|
||||
*/
|
||||
for (arg = args; arg != NULL; arg = arg->s_nxt) {
|
||||
|
@ -2477,12 +2476,12 @@ cluparg(void)
|
|||
}
|
||||
|
||||
/*
|
||||
* If this is an old style function definition and a prototyp
|
||||
* If this is an old style function definition and a prototype
|
||||
* exists, compare the types of arguments.
|
||||
*/
|
||||
if (funcsym->s_osdef && funcsym->s_type->t_proto) {
|
||||
/*
|
||||
* If the number of arguments does not macht, we need not
|
||||
* If the number of arguments does not match, we need not
|
||||
* continue.
|
||||
*/
|
||||
narg = nparg = 0;
|
||||
|
@ -2508,7 +2507,7 @@ cluparg(void)
|
|||
/* prototype declaration */
|
||||
prevdecl(285, dcs->d_rdcsym);
|
||||
|
||||
/* from now the prototype is valid */
|
||||
/* from now on the prototype is valid */
|
||||
funcsym->s_osdef = 0;
|
||||
funcsym->s_args = NULL;
|
||||
|
||||
|
@ -2602,8 +2601,8 @@ decl1loc(sym_t *dsym, int initflg)
|
|||
|
||||
if (dsym->s_scl == EXTERN) {
|
||||
/*
|
||||
* XXX wenn die statische Variable auf Ebene 0 erst
|
||||
* spaeter definiert wird, haben wir die Brille auf.
|
||||
* XXX if the static variable at level 0 is only defined
|
||||
* later, checking will be possible.
|
||||
*/
|
||||
if (dsym->s_xsym == NULL) {
|
||||
outsym(dsym, EXTERN, dsym->s_def);
|
||||
|
@ -2628,7 +2627,7 @@ decl1loc(sym_t *dsym, int initflg)
|
|||
warning(87, dsym->s_name);
|
||||
break;
|
||||
case TYPEDEF:
|
||||
/* typedef hides external declaration: %s */
|
||||
/* typedef hides external declaration: %s */
|
||||
if (hflag)
|
||||
warning(88, dsym->s_name);
|
||||
break;
|
||||
|
@ -2687,13 +2686,13 @@ decl1loc(sym_t *dsym, int initflg)
|
|||
}
|
||||
|
||||
/*
|
||||
* Before we can check the size we must wait for a initialisation
|
||||
* Before we can check the size we must wait for a initialization
|
||||
* which may follow.
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
* Processes (re)declarations of external Symbols inside blocks.
|
||||
* Processes (re)declarations of external symbols inside blocks.
|
||||
*/
|
||||
static void
|
||||
ledecl(sym_t *dsym)
|
||||
|
@ -2746,9 +2745,8 @@ ledecl(sym_t *dsym)
|
|||
}
|
||||
|
||||
/*
|
||||
* Print an error or a warning if the symbol cant be initialized due
|
||||
* to type/storage class. Returnvalue is 1 if an error has been
|
||||
* detected.
|
||||
* Print an error or a warning if the symbol cannot be initialized due
|
||||
* to type/storage class. Return 1 if an error has been detected.
|
||||
*/
|
||||
static int
|
||||
chkinit(sym_t *sym)
|
||||
|
@ -2779,7 +2777,7 @@ chkinit(sym_t *sym)
|
|||
}
|
||||
|
||||
/*
|
||||
* Create a symbole for an abstract declaration.
|
||||
* Create a symbol for an abstract declaration.
|
||||
*/
|
||||
sym_t *
|
||||
aname(void)
|
||||
|
@ -2821,7 +2819,7 @@ globclup(void)
|
|||
mblklev = 0;
|
||||
|
||||
/*
|
||||
* remove all informations about pending lint directives without
|
||||
* remove all information about pending lint directives without
|
||||
* warnings.
|
||||
*/
|
||||
glclup(1);
|
||||
|
@ -2846,10 +2844,6 @@ void
|
|||
chksz(sym_t *dsym)
|
||||
{
|
||||
|
||||
/*
|
||||
* check size only for symbols which are defined and no function and
|
||||
* not typedef name
|
||||
*/
|
||||
if (dsym->s_def != DEF)
|
||||
return;
|
||||
if (dsym->s_scl == TYPEDEF)
|
||||
|
@ -2895,7 +2889,7 @@ setuflg(sym_t *sym, int fcall, int szof)
|
|||
/*
|
||||
* for function calls another record is written
|
||||
*
|
||||
* XXX Should symbols used in sizeof() treated as used or not?
|
||||
* XXX Should symbols used in sizeof() be treated as used or not?
|
||||
* Probably not, because there is no sense to declare an
|
||||
* external variable only to get their size.
|
||||
*/
|
||||
|
@ -2990,7 +2984,7 @@ chkvusg(int novar, sym_t *sym)
|
|||
return;
|
||||
|
||||
/*
|
||||
* XXX Only variables are checkd, although types should
|
||||
* XXX Only variables are checked, although types should
|
||||
* probably also be checked
|
||||
*/
|
||||
if ((sc = sym->s_scl) != EXTERN && sc != STATIC &&
|
||||
|
@ -3022,7 +3016,7 @@ chkvusg(int novar, sym_t *sym)
|
|||
if (sc == EXTERN) {
|
||||
/*
|
||||
* information about usage is taken over into the symbol
|
||||
* tabel entry at level 0 if the symbol was locally declared
|
||||
* table entry at level 0 if the symbol was locally declared
|
||||
* as an external symbol.
|
||||
*
|
||||
* XXX This is wrong for symbols declared static at level 0
|
||||
|
@ -3068,7 +3062,7 @@ chktusg(sym_t *sym)
|
|||
if (!incompl(sym->s_type))
|
||||
return;
|
||||
|
||||
/* complain alwasy about incomplet tags declared inside blocks */
|
||||
/* always complain about incomplete tags declared inside blocks */
|
||||
if (!zflag || dcs->d_ctx != EXTERN)
|
||||
return;
|
||||
|
||||
|
@ -3093,8 +3087,8 @@ chktusg(sym_t *sym)
|
|||
|
||||
/*
|
||||
* Called after the entire translation unit has been parsed.
|
||||
* Changes tentative definitions in definitions.
|
||||
* Performs some tests on global Symbols. Detected Problems are:
|
||||
* Changes tentative definitions into definitions.
|
||||
* Performs some tests on global symbols. Detected problems are:
|
||||
* - defined variables of incomplete type
|
||||
* - constant variables which are not initialized
|
||||
* - static symbols which are never used
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: emit1.c,v 1.22 2020/12/28 18:49:02 rillig Exp $ */
|
||||
/* $NetBSD: emit1.c,v 1.23 2020/12/28 21:24:55 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: emit1.c,v 1.22 2020/12/28 18:49:02 rillig Exp $");
|
||||
__RCSID("$NetBSD: emit1.c,v 1.23 2020/12/28 21:24:55 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
|
@ -52,7 +52,7 @@ static void outfstrg(strg_t *);
|
|||
* Write type into the output buffer.
|
||||
* The type is written as a sequence of substrings, each of which describes a
|
||||
* node of type type_t
|
||||
* a node is coded as follows:
|
||||
* a node is encoded as follows:
|
||||
* _Bool B
|
||||
* _Complex float s X
|
||||
* _Complex double X
|
||||
|
@ -219,10 +219,10 @@ outtt(sym_t *tag, sym_t *tdef)
|
|||
}
|
||||
|
||||
/*
|
||||
* write information about an global declared/defined symbol
|
||||
* write information about a globally declared/defined symbol
|
||||
* with storage class extern
|
||||
*
|
||||
* informations about function definitions are written in outfdef(),
|
||||
* information about function definitions are written in outfdef(),
|
||||
* not here
|
||||
*/
|
||||
void
|
||||
|
@ -233,7 +233,7 @@ outsym(sym_t *sym, scl_t sc, def_t def)
|
|||
* Static function declarations must also be written to the output
|
||||
* file. Compatibility of function declarations (for both static
|
||||
* and extern functions) must be checked in lint2. Lint1 can't do
|
||||
* this, especially not, if functions are declared at block level
|
||||
* this, especially not if functions are declared at block level
|
||||
* before their first declaration at level 0.
|
||||
*/
|
||||
if (sc != EXTERN && !(sc == STATIC && sym->s_type->t_tspec == FUNC))
|
||||
|
@ -610,6 +610,5 @@ outusg(sym_t *sym)
|
|||
/* necessary to delimit both numbers */
|
||||
outchar('x');
|
||||
|
||||
/* Den Namen des Symbols ausgeben */
|
||||
outname(sym->s_name);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: err.c,v 1.55 2020/12/28 19:07:43 rillig Exp $ */
|
||||
/* $NetBSD: err.c,v 1.56 2020/12/28 21:24:55 rillig Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Jochen Pohl
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(__RCSID) && !defined(lint)
|
||||
__RCSID("$NetBSD: err.c,v 1.55 2020/12/28 19:07:43 rillig Exp $");
|
||||
__RCSID("$NetBSD: err.c,v 1.56 2020/12/28 21:24:55 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -404,7 +404,7 @@ msglist(void)
|
|||
}
|
||||
|
||||
/*
|
||||
* If Fflag is not set lbasename() returns a pointer to the last
|
||||
* If Fflag is not set, lbasename() returns a pointer to the last
|
||||
* component of the path, otherwise it returns the argument.
|
||||
*/
|
||||
static const char *
|
||||
|
@ -426,7 +426,7 @@ lbasename(const char *path)
|
|||
}
|
||||
|
||||
static void
|
||||
verror( int n, va_list ap)
|
||||
verror(int n, va_list ap)
|
||||
{
|
||||
const char *fn;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: func.c,v 1.27 2020/12/28 18:49:02 rillig Exp $ */
|
||||
/* $NetBSD: func.c,v 1.28 2020/12/28 21:24:55 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.27 2020/12/28 18:49:02 rillig Exp $");
|
||||
__RCSID("$NetBSD: func.c,v 1.28 2020/12/28 21:24:55 rillig Exp $");
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
@ -68,9 +68,9 @@ int rchflg;
|
|||
* and case (label()).
|
||||
*
|
||||
* Control statements if, for, while and switch do not reset ftflg because
|
||||
* this must be done by the controled statement. At least for if this is
|
||||
* this must be done by the controlled statement. At least for if this is
|
||||
* important because ** FALLTHROUGH ** after "if (expr) stmnt" is evaluated
|
||||
* befor the following token, wich causes reduction of above, is read.
|
||||
* before the following token, wich causes reduction of above.
|
||||
* This means that ** FALLTHROUGH ** after "if ..." would always be ignored.
|
||||
*/
|
||||
int ftflg;
|
||||
|
@ -110,13 +110,13 @@ pos_t prflpos;
|
|||
pos_t scflpos;
|
||||
|
||||
/*
|
||||
* Are both plibflg and llibflg set, prototypes are writen as function
|
||||
* If both plibflg and llibflg are set, prototypes are written as function
|
||||
* definitions to the output file.
|
||||
*/
|
||||
int plibflg;
|
||||
|
||||
/*
|
||||
* Nonzero means that no warnings about constands in conditional
|
||||
* Nonzero means that no warnings about constants in conditional
|
||||
* context are printed.
|
||||
*/
|
||||
int ccflg;
|
||||
|
@ -205,11 +205,11 @@ chkreach(void)
|
|||
* Called after a function declaration which introduces a function definition
|
||||
* and before an (optional) old style argument declaration list.
|
||||
*
|
||||
* Puts all symbols declared in the Prototype or in an old style argument
|
||||
* Puts all symbols declared in the prototype or in an old style argument
|
||||
* list back to the symbol table.
|
||||
*
|
||||
* Does the usual checking of storage class, type (return value),
|
||||
* redeclaration etc..
|
||||
* redeclaration, etc.
|
||||
*/
|
||||
void
|
||||
funcdef(sym_t *fsym)
|
||||
|
@ -329,7 +329,7 @@ funcdef(sym_t *fsym)
|
|||
|
||||
if (fsym->s_osdef && !fsym->s_type->t_proto) {
|
||||
if (sflag && hflag && strcmp(fsym->s_name, "main") != 0)
|
||||
/* function definition is not a prototyp */
|
||||
/* function definition is not a prototype */
|
||||
warning(286);
|
||||
}
|
||||
|
||||
|
@ -756,7 +756,7 @@ do2(tnode_t *tn)
|
|||
{
|
||||
|
||||
/*
|
||||
* If there was a continue statement the expression controlling the
|
||||
* If there was a continue statement, the expression controlling the
|
||||
* loop is reached.
|
||||
*/
|
||||
if (cstk->c_cont)
|
||||
|
@ -1034,7 +1034,7 @@ doreturn(tnode_t *tn)
|
|||
|
||||
/*
|
||||
* Do some cleanup after a global declaration or definition.
|
||||
* Especially remove informations about unused lint comments.
|
||||
* Especially remove information about unused lint comments.
|
||||
*/
|
||||
void
|
||||
glclup(int silent)
|
||||
|
@ -1110,8 +1110,8 @@ argsused(int n)
|
|||
/*
|
||||
* VARARGS comment
|
||||
*
|
||||
* Makes that lint2 checks only the first n arguments for compatibility
|
||||
* to the function definition. A missing argument is taken to be 0.
|
||||
* Causes lint2 to check only the first n arguments for compatibility
|
||||
* with the function definition. A missing argument is taken to be 0.
|
||||
*/
|
||||
void
|
||||
varargs(int n)
|
||||
|
@ -1266,9 +1266,9 @@ bitfieldtype(int n)
|
|||
}
|
||||
|
||||
/*
|
||||
* PROTOTLIB in conjunction with LINTLIBRARY can be used to handle
|
||||
* PROTOLIB in conjunction with LINTLIBRARY can be used to handle
|
||||
* prototypes like function definitions. This is done if the argument
|
||||
* to PROTOLIB is nonzero. Otherwise prototypes are handled normaly.
|
||||
* to PROTOLIB is nonzero. Otherwise prototypes are handled normally.
|
||||
*/
|
||||
void
|
||||
protolib(int n)
|
||||
|
|
Loading…
Reference in New Issue