Do not use '#endif/#else xxx'; it is not allowed for ANSI C
This commit is contained in:
parent
abb411daac
commit
a38be6605e
|
@ -87,7 +87,7 @@ LLlex()
|
||||||
else { /* read ahead and return the old one */
|
else { /* read ahead and return the old one */
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_comment_ahead();
|
lint_comment_ahead();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
dot = ahead;
|
dot = ahead;
|
||||||
/* the following test is performed due to the dual
|
/* the following test is performed due to the dual
|
||||||
task of LLlex(): it is also called for parsing the
|
task of LLlex(): it is also called for parsing the
|
||||||
|
@ -345,7 +345,7 @@ garbage:
|
||||||
ptok->tk_fund = INT;
|
ptok->tk_fund = INT;
|
||||||
return ptok->tk_symb = INTEGER;
|
return ptok->tk_symb = INTEGER;
|
||||||
}
|
}
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
ptok->tk_symb = (
|
ptok->tk_symb = (
|
||||||
idef->id_reserved
|
idef->id_reserved
|
||||||
? idef->id_reserved
|
? idef->id_reserved
|
||||||
|
@ -462,7 +462,7 @@ skipcomment()
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_start_comment();
|
lint_start_comment();
|
||||||
lint_comment_char(c);
|
lint_comment_char(c);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
do {
|
do {
|
||||||
while (c != '*') {
|
while (c != '*') {
|
||||||
if (class(c) == STNL) {
|
if (class(c) == STNL) {
|
||||||
|
@ -471,14 +471,14 @@ skipcomment()
|
||||||
NoUnstack--;
|
NoUnstack--;
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_end_comment();
|
lint_end_comment();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
oldc = c;
|
oldc = c;
|
||||||
c = GetChar();
|
c = GetChar();
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_comment_char(c);
|
lint_comment_char(c);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
} /* last Character seen was '*' */
|
} /* last Character seen was '*' */
|
||||||
c = GetChar();
|
c = GetChar();
|
||||||
if ( c != '/' && oldc == '/')
|
if ( c != '/' && oldc == '/')
|
||||||
|
@ -486,11 +486,11 @@ skipcomment()
|
||||||
oldc = '*';
|
oldc = '*';
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_comment_char(c);
|
lint_comment_char(c);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
} while (c != '/');
|
} while (c != '/');
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_end_comment();
|
lint_end_comment();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
NoUnstack--;
|
NoUnstack--;
|
||||||
}
|
}
|
||||||
#endif /* NOPP */
|
#endif /* NOPP */
|
||||||
|
|
|
@ -49,7 +49,7 @@ extern int ReplaceMacros; /* "LLlex.c" */
|
||||||
extern int AccDefined; /* "LLlex.c" */
|
extern int AccDefined; /* "LLlex.c" */
|
||||||
extern int Unstacked; /* "LLlex.c" */
|
extern int Unstacked; /* "LLlex.c" */
|
||||||
extern int UnknownIdIsZero; /* "LLlex.c" */
|
extern int UnknownIdIsZero; /* "LLlex.c" */
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
extern int EoiForNewline; /* "LLlex.c" */
|
extern int EoiForNewline; /* "LLlex.c" */
|
||||||
extern int AccFileSpecifier; /* "LLlex.c" */
|
extern int AccFileSpecifier; /* "LLlex.c" */
|
||||||
extern int File_Inserted; /* "LLlex.c" */
|
extern int File_Inserted; /* "LLlex.c" */
|
||||||
|
|
|
@ -2,4 +2,4 @@ distr:
|
||||||
echo '#ifndef lint' > Version.c
|
echo '#ifndef lint' > Version.c
|
||||||
echo 'char Version[] = "ACK ANSI C compiler Version XXX";' | \
|
echo 'char Version[] = "ACK ANSI C compiler Version XXX";' | \
|
||||||
sed "s/XXX/`RC -i`/" >> Version.c
|
sed "s/XXX/`RC -i`/" >> Version.c
|
||||||
echo '#endif lint' >> Version.c
|
echo '#endif' >> Version.c
|
||||||
|
|
|
@ -14,7 +14,7 @@ extern int
|
||||||
float_align, double_align, lngdbl_align,
|
float_align, double_align, lngdbl_align,
|
||||||
pointer_align,
|
pointer_align,
|
||||||
struct_align, union_align;
|
struct_align, union_align;
|
||||||
#else NOCROSS
|
#else /* NOCROSS */
|
||||||
#define short_align ((int)AL_SHORT)
|
#define short_align ((int)AL_SHORT)
|
||||||
#define word_align ((int)AL_WORD)
|
#define word_align ((int)AL_WORD)
|
||||||
#define int_align ((int)AL_INT)
|
#define int_align ((int)AL_INT)
|
||||||
|
@ -25,6 +25,6 @@ extern int
|
||||||
#define pointer_align ((int)AL_POINTER)
|
#define pointer_align ((int)AL_POINTER)
|
||||||
#define struct_align ((int)AL_STRUCT)
|
#define struct_align ((int)AL_STRUCT)
|
||||||
#define union_align ((int)AL_UNION)
|
#define union_align ((int)AL_UNION)
|
||||||
#endif NOCROSS
|
#endif /* NOCROSS */
|
||||||
|
|
||||||
extern arith align();
|
extern arith align();
|
||||||
|
|
|
@ -258,7 +258,7 @@ any2arith(expp, oper)
|
||||||
want to keep enums and ints separate
|
want to keep enums and ints separate
|
||||||
*/
|
*/
|
||||||
int2int(expp, int_type);
|
int2int(expp, int_type);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
break;
|
break;
|
||||||
case FLOAT:
|
case FLOAT:
|
||||||
/* only when it is a parameter and the default promotion should
|
/* only when it is a parameter and the default promotion should
|
||||||
|
@ -273,7 +273,7 @@ any2arith(expp, oper)
|
||||||
case FIELD:
|
case FIELD:
|
||||||
field2arith(expp);
|
field2arith(expp);
|
||||||
break;
|
break;
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
default:
|
default:
|
||||||
expr_error(*expp, "operator %s on non-numerical operand (%s)",
|
expr_error(*expp, "operator %s on non-numerical operand (%s)",
|
||||||
symbol2str(oper), symbol2str(fund));
|
symbol2str(oper), symbol2str(fund));
|
||||||
|
@ -500,7 +500,7 @@ opnd2logical(expp, oper)
|
||||||
else
|
else
|
||||||
if (fund == FIELD)
|
if (fund == FIELD)
|
||||||
field2arith(expp);
|
field2arith(expp);
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
switch (fund = (*expp)->ex_type->tp_fund) {
|
switch (fund = (*expp)->ex_type->tp_fund) {
|
||||||
case CHAR:
|
case CHAR:
|
||||||
case SHORT:
|
case SHORT:
|
||||||
|
@ -575,7 +575,7 @@ any2opnd(expp, oper)
|
||||||
case FIELD:
|
case FIELD:
|
||||||
field2arith(expp);
|
field2arith(expp);
|
||||||
break;
|
break;
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -620,7 +620,7 @@ field2arith(expp)
|
||||||
ch3bin(expp, RIGHT, intexpr(other_bits, INT));
|
ch3bin(expp, RIGHT, intexpr(other_bits, INT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
/* switch_sign_fp() negates the given floating constant expression,
|
/* switch_sign_fp() negates the given floating constant expression,
|
||||||
* and frees the string representing the old value.
|
* and frees the string representing the old value.
|
||||||
|
|
|
@ -19,13 +19,13 @@
|
||||||
|
|
||||||
#include <em_arith.h> /* obtain definition of "arith" */
|
#include <em_arith.h> /* obtain definition of "arith" */
|
||||||
|
|
||||||
#else SPECIAL_ARITHMETICS
|
#else /* SPECIAL_ARITHMETICS */
|
||||||
|
|
||||||
/* All preprocessor arithmetic should be done in longs.
|
/* All preprocessor arithmetic should be done in longs.
|
||||||
*/
|
*/
|
||||||
#define arith long /* dummy */
|
#define arith long /* dummy */
|
||||||
|
|
||||||
#endif SPECIAL_ARITHMETICS
|
#endif /* SPECIAL_ARITHMETICS */
|
||||||
|
|
||||||
#define arith_size (sizeof(arith))
|
#define arith_size (sizeof(arith))
|
||||||
#define arith_sign ((arith) 1 << (arith_size * 8 - 1))
|
#define arith_sign ((arith) 1 << (arith_size * 8 - 1))
|
||||||
|
|
|
@ -21,4 +21,4 @@
|
||||||
#else
|
#else
|
||||||
#define ASSERT(exp)
|
#define ASSERT(exp)
|
||||||
#define NOTREACHED()
|
#define NOTREACHED()
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
extern arith NewLocal();
|
extern arith NewLocal();
|
||||||
#define LocalPtrVar() NewLocal(pointer_size, pointer_align, reg_pointer, REGISTER)
|
#define LocalPtrVar() NewLocal(pointer_size, pointer_align, reg_pointer, REGISTER)
|
||||||
#define LocalIntVar() NewLocal(int_size, int_align, reg_any, REGISTER)
|
#define LocalIntVar() NewLocal(int_size, int_align, reg_any, REGISTER)
|
||||||
#endif STB
|
#endif /* STB */
|
||||||
|
|
||||||
/* Because EM does not support the loading and storing of
|
/* Because EM does not support the loading and storing of
|
||||||
objects having other sizes than word fragment and multiple,
|
objects having other sizes than word fragment and multiple,
|
||||||
|
@ -86,7 +86,7 @@ store_block(sz, al)
|
||||||
C_asp(ATW(sz));
|
C_asp(ATW(sz));
|
||||||
FreeLocal(dst);
|
FreeLocal(dst);
|
||||||
FreeLocal(src);
|
FreeLocal(src);
|
||||||
#else STB
|
#else /* STB */
|
||||||
/* address of destination lies on the stack */
|
/* address of destination lies on the stack */
|
||||||
|
|
||||||
/* push address of first byte of block on stack onto
|
/* push address of first byte of block on stack onto
|
||||||
|
@ -98,7 +98,7 @@ store_block(sz, al)
|
||||||
C_loc(sz); /* number of bytes to transfer */
|
C_loc(sz); /* number of bytes to transfer */
|
||||||
C_cal("__stb"); /* call transfer routine */
|
C_cal("__stb"); /* call transfer routine */
|
||||||
C_asp(pointer_size + pointer_size + int_size + ATW(sz));
|
C_asp(pointer_size + pointer_size + int_size + ATW(sz));
|
||||||
#endif STB
|
#endif /* STB */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ load_block(sz, al)
|
||||||
copy_loop(sz, src, dst);
|
copy_loop(sz, src, dst);
|
||||||
FreeLocal(dst);
|
FreeLocal(dst);
|
||||||
FreeLocal(src);
|
FreeLocal(src);
|
||||||
#else STB
|
#else /* STB */
|
||||||
arith esz = ATW(sz) - pointer_size;
|
arith esz = ATW(sz) - pointer_size;
|
||||||
C_asp(-esz); /* allocate stack block */
|
C_asp(-esz); /* allocate stack block */
|
||||||
C_lor((arith)1); /* push & of stack block as dst */
|
C_lor((arith)1); /* push & of stack block as dst */
|
||||||
|
@ -134,7 +134,7 @@ load_block(sz, al)
|
||||||
C_loc(sz); /* # bytes to copy */
|
C_loc(sz); /* # bytes to copy */
|
||||||
C_cal("__stb"); /* library copy routine */
|
C_cal("__stb"); /* library copy routine */
|
||||||
C_asp(int_size + pointer_size + pointer_size);
|
C_asp(int_size + pointer_size + pointer_size);
|
||||||
#endif STB
|
#endif /* STB */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,11 +158,11 @@ copy_block(sz, al)
|
||||||
copy_loop(sz, src, dst);
|
copy_loop(sz, src, dst);
|
||||||
FreeLocal(dst);
|
FreeLocal(dst);
|
||||||
FreeLocal(src);
|
FreeLocal(src);
|
||||||
#else STB
|
#else /* STB */
|
||||||
C_loc(sz); /* # bytes to copy */
|
C_loc(sz); /* # bytes to copy */
|
||||||
C_cal("__stb"); /* library copy routine */
|
C_cal("__stb"); /* library copy routine */
|
||||||
C_asp(int_size + pointer_size + pointer_size);
|
C_asp(int_size + pointer_size + pointer_size);
|
||||||
#endif STB
|
#endif /* STB */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ copy_loop(sz, src, dst)
|
||||||
C_df_ilb(l_stop);
|
C_df_ilb(l_stop);
|
||||||
FreeLocal(tmp_sz);
|
FreeLocal(tmp_sz);
|
||||||
}
|
}
|
||||||
#endif STB
|
#endif /* STB */
|
||||||
|
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ ch3cast(expp, oper, tp)
|
||||||
ch3cast(expp, oper, tp->tp_up);
|
ch3cast(expp, oper, tp->tp_up);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
switch (oper) {
|
switch (oper) {
|
||||||
default: qual_lev = -1; break;
|
default: qual_lev = -1; break;
|
||||||
case CAST: qual_lev = -999; break; /* ??? hack */
|
case CAST: qual_lev = -999; break; /* ??? hack */
|
||||||
|
@ -259,9 +259,9 @@ ch3cast(expp, oper, tp)
|
||||||
else {
|
else {
|
||||||
int2int(expp, tp);
|
int2int(expp, tp);
|
||||||
}
|
}
|
||||||
#else LINT
|
#else /* LINT */
|
||||||
int2int(expp, tp);
|
int2int(expp, tp);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (oldi && !i) {
|
if (oldi && !i) {
|
||||||
|
@ -271,9 +271,9 @@ ch3cast(expp, oper, tp)
|
||||||
else {
|
else {
|
||||||
int2float(expp, tp);
|
int2float(expp, tp);
|
||||||
}
|
}
|
||||||
#else LINT
|
#else /* LINT */
|
||||||
int2float(expp, tp);
|
int2float(expp, tp);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (!oldi && i) {
|
if (!oldi && i) {
|
||||||
|
@ -283,9 +283,9 @@ ch3cast(expp, oper, tp)
|
||||||
else {
|
else {
|
||||||
float2int(expp, tp);
|
float2int(expp, tp);
|
||||||
}
|
}
|
||||||
#else LINT
|
#else /* LINT */
|
||||||
float2int(expp, tp);
|
float2int(expp, tp);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* !oldi && !i */
|
/* !oldi && !i */
|
||||||
|
@ -295,9 +295,9 @@ ch3cast(expp, oper, tp)
|
||||||
else {
|
else {
|
||||||
float2float(expp, tp);
|
float2float(expp, tp);
|
||||||
}
|
}
|
||||||
#else LINT
|
#else /* LINT */
|
||||||
float2float(expp, tp);
|
float2float(expp, tp);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -336,7 +336,7 @@ ch3cast(expp, oper, tp)
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
if (oper != CAST)
|
if (oper != CAST)
|
||||||
lint_ptr_conv(oldtp->tp_up->tp_fund, tp->tp_up->tp_fund);
|
lint_ptr_conv(oldtp->tp_up->tp_fund, tp->tp_up->tp_fund);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
exp->ex_type = tp; /* free conversion */
|
exp->ex_type = tp; /* free conversion */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -671,9 +671,9 @@ ch3asgn(expp, oper, expr)
|
||||||
#ifndef NOBITFIELD
|
#ifndef NOBITFIELD
|
||||||
exp = new_oper(fund == FIELD ? exp->ex_type->tp_up : exp->ex_type,
|
exp = new_oper(fund == FIELD ? exp->ex_type->tp_up : exp->ex_type,
|
||||||
exp, oper, expr);
|
exp, oper, expr);
|
||||||
#else NOBITFIELD
|
#else /* NOBITFIELD */
|
||||||
exp = new_oper(exp->ex_type, exp, oper, expr);
|
exp = new_oper(exp->ex_type, exp, oper, expr);
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
exp->OP_TYPE = tp; /* for EVAL() */
|
exp->OP_TYPE = tp; /* for EVAL() */
|
||||||
exp->ex_flags |= EX_SIDEEFFECTS;
|
exp->ex_flags |= EX_SIDEEFFECTS;
|
||||||
*expp = exp;
|
*expp = exp;
|
||||||
|
@ -695,7 +695,7 @@ is_integral_type(tp)
|
||||||
#ifndef NOBITFIELD
|
#ifndef NOBITFIELD
|
||||||
case FIELD:
|
case FIELD:
|
||||||
return is_integral_type(tp->tp_up);
|
return is_integral_type(tp->tp_up);
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -718,7 +718,7 @@ is_arith_type(tp)
|
||||||
#ifndef NOBITFIELD
|
#ifndef NOBITFIELD
|
||||||
case FIELD:
|
case FIELD:
|
||||||
return is_arith_type(tp->tp_up);
|
return is_arith_type(tp->tp_up);
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,7 +250,7 @@ ch3bin(expp, oper, expr)
|
||||||
) {
|
) {
|
||||||
hwarning("operands of : are constant and equal");
|
hwarning("operands of : are constant and equal");
|
||||||
}
|
}
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
*expp = new_oper((*expp)->ex_type, *expp, oper, expr);
|
*expp = new_oper((*expp)->ex_type, *expp, oper, expr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ ch3bin(expp, oper, expr)
|
||||||
if (is_cp_cst(*expp)) {
|
if (is_cp_cst(*expp)) {
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
hwarning("condition in ?: expression is constant");
|
hwarning("condition in ?: expression is constant");
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
*expp = (*expp)->VL_VALUE ?
|
*expp = (*expp)->VL_VALUE ?
|
||||||
expr->OP_LEFT : expr->OP_RIGHT;
|
expr->OP_LEFT : expr->OP_RIGHT;
|
||||||
(*expp)->ex_flags |= EX_ILVALUE;
|
(*expp)->ex_flags |= EX_ILVALUE;
|
||||||
|
@ -273,7 +273,7 @@ ch3bin(expp, oper, expr)
|
||||||
if (is_cp_cst(*expp)) {
|
if (is_cp_cst(*expp)) {
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
hwarning("constant expression ignored");
|
hwarning("constant expression ignored");
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
*expp = expr;
|
*expp = expr;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -75,7 +75,7 @@ ch3mon(oper, expp)
|
||||||
if ((*expp)->ex_type->tp_fund == FIELD)
|
if ((*expp)->ex_type->tp_fund == FIELD)
|
||||||
expr_error(*expp, "& applied to field variable");
|
expr_error(*expp, "& applied to field variable");
|
||||||
else
|
else
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
if (!(*expp)->ex_lvalue)
|
if (!(*expp)->ex_lvalue)
|
||||||
expr_error(*expp, "& applied to non-lvalue");
|
expr_error(*expp, "& applied to non-lvalue");
|
||||||
else if ((*expp)->ex_flags & EX_ILVALUE)
|
else if ((*expp)->ex_flags & EX_ILVALUE)
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#else
|
#else
|
||||||
#include "l_em.h"
|
#include "l_em.h"
|
||||||
#include "l_lint.h"
|
#include "l_lint.h"
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
#include "botch_free.h"
|
#include "botch_free.h"
|
||||||
#include <alloc.h>
|
#include <alloc.h>
|
||||||
#include "dataflow.h"
|
#include "dataflow.h"
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
#include "LLlex.h"
|
#include "LLlex.h"
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
#include "l_lint.h"
|
#include "l_lint.h"
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
#ifdef DBSYMTAB
|
#ifdef DBSYMTAB
|
||||||
#include <stb.h>
|
#include <stb.h>
|
||||||
#endif /* DBSYMTAB */
|
#endif /* DBSYMTAB */
|
||||||
|
@ -60,7 +60,7 @@ int func_notypegiven;
|
||||||
#ifdef USE_TMP
|
#ifdef USE_TMP
|
||||||
static int tmp_id;
|
static int tmp_id;
|
||||||
static int pro_id;
|
static int pro_id;
|
||||||
#endif USE_TMP
|
#endif /* USE_TMP */
|
||||||
|
|
||||||
extern char options[];
|
extern char options[];
|
||||||
extern char *symbol2str();
|
extern char *symbol2str();
|
||||||
|
@ -98,10 +98,10 @@ init_code(dst_file)
|
||||||
#ifdef USE_TMP
|
#ifdef USE_TMP
|
||||||
#ifdef PREPEND_SCOPES
|
#ifdef PREPEND_SCOPES
|
||||||
C_insertpart(tmp_id = C_getid());
|
C_insertpart(tmp_id = C_getid());
|
||||||
#endif PREPEND_SCOPES
|
#endif /* PREPEND_SCOPES */
|
||||||
#endif USE_TMP
|
#endif /* USE_TMP */
|
||||||
}
|
}
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
struct string_cst *str_list = 0;
|
struct string_cst *str_list = 0;
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ end_code()
|
||||||
C_ms_src((int)(LineNumber - 2), FileName);
|
C_ms_src((int)(LineNumber - 2), FileName);
|
||||||
C_close();
|
C_close();
|
||||||
}
|
}
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
#ifdef PREPEND_SCOPES
|
#ifdef PREPEND_SCOPES
|
||||||
prepend_scopes()
|
prepend_scopes()
|
||||||
|
@ -168,7 +168,7 @@ prepend_scopes()
|
||||||
|
|
||||||
#ifdef USE_TMP
|
#ifdef USE_TMP
|
||||||
C_beginpart(tmp_id);
|
C_beginpart(tmp_id);
|
||||||
#endif USE_TMP
|
#endif /* USE_TMP */
|
||||||
while (se != 0) {
|
while (se != 0) {
|
||||||
register struct def *df = se->se_idf->id_def;
|
register struct def *df = se->se_idf->id_def;
|
||||||
|
|
||||||
|
@ -179,9 +179,9 @@ prepend_scopes()
|
||||||
}
|
}
|
||||||
#ifdef USE_TMP
|
#ifdef USE_TMP
|
||||||
C_endpart(tmp_id);
|
C_endpart(tmp_id);
|
||||||
#endif USE_TMP
|
#endif /* USE_TMP */
|
||||||
}
|
}
|
||||||
#endif PREPEND_SCOPES
|
#endif /* PREPEND_SCOPES */
|
||||||
|
|
||||||
code_scope(text, def)
|
code_scope(text, def)
|
||||||
char *text;
|
char *text;
|
||||||
|
@ -250,11 +250,11 @@ begin_proc(ds, idf) /* to be called when entering a procedure */
|
||||||
}
|
}
|
||||||
#ifndef PREPEND_SCOPES
|
#ifndef PREPEND_SCOPES
|
||||||
code_scope(name, def);
|
code_scope(name, def);
|
||||||
#endif PREPEND_SCOPES
|
#endif /* PREPEND_SCOPES */
|
||||||
#ifdef DATAFLOW
|
#ifdef DATAFLOW
|
||||||
if (options['d'])
|
if (options['d'])
|
||||||
DfaStartFunction(name);
|
DfaStartFunction(name);
|
||||||
#endif DATAFLOW
|
#endif /* DATAFLOW */
|
||||||
|
|
||||||
|
|
||||||
/* set global function info */
|
/* set global function info */
|
||||||
|
@ -339,7 +339,7 @@ end_proc(fbytes)
|
||||||
#ifdef DATAFLOW
|
#ifdef DATAFLOW
|
||||||
if (options['d'])
|
if (options['d'])
|
||||||
DfaEndFunction();
|
DfaEndFunction();
|
||||||
#endif DATAFLOW
|
#endif /* DATAFLOW */
|
||||||
C_df_ilb(return2_label);
|
C_df_ilb(return2_label);
|
||||||
if (return_expr_occurred && func_res_label == 0) {
|
if (return_expr_occurred && func_res_label == 0) {
|
||||||
C_asp(-func_size);
|
C_asp(-func_size);
|
||||||
|
@ -468,7 +468,7 @@ code_declaration(idf, expr, lvl, sc)
|
||||||
if (expr) { /* code only if initialized */
|
if (expr) { /* code only if initialized */
|
||||||
#ifndef PREPEND_SCOPES
|
#ifndef PREPEND_SCOPES
|
||||||
code_scope(idf->id_text, def);
|
code_scope(idf->id_text, def);
|
||||||
#endif PREPEND_SCOPES
|
#endif /* PREPEND_SCOPES */
|
||||||
def->df_alloc = ALLOC_DONE;
|
def->df_alloc = ALLOC_DONE;
|
||||||
C_df_dnam(idf->id_text);
|
C_df_dnam(idf->id_text);
|
||||||
}
|
}
|
||||||
|
@ -600,9 +600,9 @@ loc_init(expr, id)
|
||||||
vl.vl_value = (arith)0;
|
vl.vl_value = (arith)0;
|
||||||
store_val(&vl, tp);
|
store_val(&vl, tp);
|
||||||
}
|
}
|
||||||
#else LINT
|
#else /* LINT */
|
||||||
id->id_def->df_set = 1;
|
id->id_def->df_set = 1;
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
free_expression(expr);
|
free_expression(expr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -616,7 +616,7 @@ bss(idf)
|
||||||
|
|
||||||
#ifndef PREPEND_SCOPES
|
#ifndef PREPEND_SCOPES
|
||||||
code_scope(idf->id_text, df);
|
code_scope(idf->id_text, df);
|
||||||
#endif PREPEND_SCOPES
|
#endif /* PREPEND_SCOPES */
|
||||||
#ifdef DBSYMTAB
|
#ifdef DBSYMTAB
|
||||||
if (options['g']) {
|
if (options['g']) {
|
||||||
stb_string(df, df->df_sc, idf->id_text);
|
stb_string(df, df->df_sc, idf->id_text);
|
||||||
|
@ -660,14 +660,14 @@ formal_cvt(hasproto,df)
|
||||||
LoadLocal(df->df_address, double_size);
|
LoadLocal(df->df_address, double_size);
|
||||||
#ifndef LINT
|
#ifndef LINT
|
||||||
conversion(double_type, float_type);
|
conversion(double_type, float_type);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
StoreLocal(df->df_address, tp->tp_size);
|
StoreLocal(df->df_address, tp->tp_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
code_expr(expr, val, code, tlbl, flbl)
|
code_expr(expr, val, code, tlbl, flbl)
|
||||||
struct expr *expr;
|
struct expr *expr;
|
||||||
label tlbl, flbl;
|
label tlbl, flbl;
|
||||||
|
@ -683,9 +683,9 @@ code_expr(expr, val, code, tlbl, flbl)
|
||||||
if (options['g']) db_line(expr->ex_file, (unsigned int)expr->ex_line);
|
if (options['g']) db_line(expr->ex_file, (unsigned int)expr->ex_line);
|
||||||
#endif
|
#endif
|
||||||
EVAL(expr, val, code, tlbl, flbl);
|
EVAL(expr, val, code, tlbl, flbl);
|
||||||
#else LINT
|
#else /* LINT */
|
||||||
lint_expr(expr, code ? USED : IGNORED);
|
lint_expr(expr, code ? USED : IGNORED);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The FOR/WHILE/DO/SWITCH stacking mechanism:
|
/* The FOR/WHILE/DO/SWITCH stacking mechanism:
|
||||||
|
|
|
@ -148,5 +148,5 @@ convtype(tp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
|
|
|
@ -34,4 +34,4 @@ DfaCallFunction(s)
|
||||||
print("DFA: %s: %s\n", CurrentFunction, s);
|
print("DFA: %s: %s\n", CurrentFunction, s);
|
||||||
++NumberOfCalls;
|
++NumberOfCalls;
|
||||||
}
|
}
|
||||||
#endif DATAFLOW
|
#endif /* DATAFLOW */
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
#include "l_lint.h"
|
#include "l_lint.h"
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
extern char options[];
|
extern char options[];
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ init_declarator(register struct decspecs *ds;)
|
||||||
declare_idf(ds, &Dc, level);
|
declare_idf(ds, &Dc, level);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_declare_idf(Dc.dc_idf, ds->ds_sc);
|
lint_declare_idf(Dc.dc_idf, ds->ds_sc);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
[
|
[
|
||||||
initializer(Dc.dc_idf, ds->ds_sc)
|
initializer(Dc.dc_idf, ds->ds_sc)
|
||||||
|
@ -209,7 +209,7 @@ init_declarator(register struct decspecs *ds;)
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
add_auto(Dc.dc_idf);
|
add_auto(Dc.dc_idf);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
remove_declarator(&Dc);
|
remove_declarator(&Dc);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
@ -240,7 +240,7 @@ initializer(struct idf *idf; int sc;)
|
||||||
if (AHEAD != '{' && AHEAD != STRING ) autoagg = 0;
|
if (AHEAD != '{' && AHEAD != STRING ) autoagg = 0;
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_statement();
|
lint_statement();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
if (globalflag) {
|
if (globalflag) {
|
||||||
struct expr ex;
|
struct expr ex;
|
||||||
code_declaration(idf, &ex, level, sc);
|
code_declaration(idf, &ex, level, sc);
|
||||||
|
@ -259,10 +259,10 @@ initializer(struct idf *idf; int sc;)
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
print_expr("initializer-expression", expr);
|
print_expr("initializer-expression", expr);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
change_state(idf, SET);
|
change_state(idf, SET);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
#ifdef DBSYMTAB
|
#ifdef DBSYMTAB
|
||||||
if (options['g'] && level >= L_LOCAL && expr) {
|
if (options['g'] && level >= L_LOCAL && expr) {
|
||||||
db_line(expr->ex_file, (unsigned) expr->ex_line);
|
db_line(expr->ex_file, (unsigned) expr->ex_line);
|
||||||
|
@ -541,7 +541,7 @@ bit_expression(struct field **fd;)
|
||||||
free_expression(expr);
|
free_expression(expr);
|
||||||
#ifdef NOBITFIELD
|
#ifdef NOBITFIELD
|
||||||
error("bitfields are not implemented");
|
error("bitfields are not implemented");
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ struct def { /* for ordinary tags */
|
||||||
char df_set;
|
char df_set;
|
||||||
int df_firstbrace; /* brace number of its first occurrence */
|
int df_firstbrace; /* brace number of its first occurrence */
|
||||||
int df_minlevel; /* the lowest level needed for this def */
|
int df_minlevel; /* the lowest level needed for this def */
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
arith df_address;
|
arith df_address;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -747,7 +747,7 @@ macroeq(s, t)
|
||||||
return (*s == '\0') && (*t == '\0');
|
return (*s == '\0') && (*t == '\0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else NOPP
|
#else /* NOPP */
|
||||||
|
|
||||||
struct idf *
|
struct idf *
|
||||||
GetIdentifier(skiponerr)
|
GetIdentifier(skiponerr)
|
||||||
|
@ -791,7 +791,7 @@ domacro()
|
||||||
EoiForNewline = 0;
|
EoiForNewline = 0;
|
||||||
SkipToNewLine();
|
SkipToNewLine();
|
||||||
}
|
}
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
|
|
||||||
do_line(l)
|
do_line(l)
|
||||||
|
|
|
@ -116,7 +116,7 @@ dumpidf(idf, opt)
|
||||||
}
|
}
|
||||||
print(" macro");
|
print(" macro");
|
||||||
}
|
}
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
if ((opt&2) && idf->id_reserved) {
|
if ((opt&2) && idf->id_reserved) {
|
||||||
if (!started++) {
|
if (!started++) {
|
||||||
newline();
|
newline();
|
||||||
|
@ -214,7 +214,7 @@ dumpsdefs(sdef, sdk)
|
||||||
print("L%d: ", sdef->sd_level);
|
print("L%d: ", sdef->sd_level);
|
||||||
#ifndef NOBITFIELD
|
#ifndef NOBITFIELD
|
||||||
if (sdk == selector)
|
if (sdk == selector)
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
print("selector %s at offset %lu in %s;",
|
print("selector %s at offset %lu in %s;",
|
||||||
type2str(sdef->sd_type),
|
type2str(sdef->sd_type),
|
||||||
sdef->sd_offset, type2str(sdef->sd_stype)
|
sdef->sd_offset, type2str(sdef->sd_stype)
|
||||||
|
@ -223,7 +223,7 @@ dumpsdefs(sdef, sdk)
|
||||||
else print("field %s at offset %lu;",
|
else print("field %s at offset %lu;",
|
||||||
type2str(sdef->sd_type), sdef->sd_offset
|
type2str(sdef->sd_type), sdef->sd_offset
|
||||||
);
|
);
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
sdef = (sdk == selector ? sdef->next : sdef->sd_sdef);
|
sdef = (sdk == selector ? sdef->next : sdef->sd_sdef);
|
||||||
}
|
}
|
||||||
dumplevel--;
|
dumplevel--;
|
||||||
|
@ -310,7 +310,7 @@ dumptype(tp)
|
||||||
fd->fd_shift, fd->fd_width);
|
fd->fd_shift, fd->fd_width);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
ops = 0;
|
ops = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -364,7 +364,7 @@ type2str(tp)
|
||||||
fd->fd_shift, fd->fd_width);
|
fd->fd_shift, fd->fd_width);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
ops = 0;
|
ops = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -500,4 +500,4 @@ p1_indent(lvl)
|
||||||
while (lvl--)
|
while (lvl--)
|
||||||
print(" ");
|
print(" ");
|
||||||
}
|
}
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <em.h>
|
#include <em.h>
|
||||||
#else
|
#else
|
||||||
#include "l_em.h"
|
#include "l_em.h"
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "lint.h"
|
#include "lint.h"
|
||||||
|
@ -45,7 +45,7 @@ int err_occurred = 0;
|
||||||
extern char options[];
|
extern char options[];
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
extern char loptions[];
|
extern char loptions[];
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
/* There are three general error-message functions:
|
/* There are three general error-message functions:
|
||||||
lexerror() lexical and pre-processor error messages
|
lexerror() lexical and pre-processor error messages
|
||||||
|
@ -151,7 +151,7 @@ debug(va_alist)
|
||||||
}
|
}
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
|
|
||||||
/*VARARGS*/
|
/*VARARGS*/
|
||||||
warning(va_alist)
|
warning(va_alist)
|
||||||
|
@ -232,7 +232,7 @@ awarning(va_alist) /* fmt, args */
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
/*VARARGS*/
|
/*VARARGS*/
|
||||||
lexerror(va_alist) /* fmt, args */
|
lexerror(va_alist) /* fmt, args */
|
||||||
|
@ -275,9 +275,9 @@ crash(va_alist) /* fmt, args */
|
||||||
C_close();
|
C_close();
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
sys_stop(S_ABORT);
|
sys_stop(S_ABORT);
|
||||||
#else DEBUG
|
#else /* DEBUG */
|
||||||
sys_stop(S_EXIT);
|
sys_stop(S_EXIT);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,9 +352,9 @@ _error(class, fn, ln, ap)
|
||||||
case WARNING:
|
case WARNING:
|
||||||
#ifndef LINT
|
#ifndef LINT
|
||||||
remark = "(warning)";
|
remark = "(warning)";
|
||||||
#else LINT
|
#else /* LINT */
|
||||||
remark = 0;
|
remark = 0;
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ERROR:
|
case ERROR:
|
||||||
|
@ -372,7 +372,7 @@ _error(class, fn, ln, ap)
|
||||||
case DO_DEBUG:
|
case DO_DEBUG:
|
||||||
remark = "(debug)";
|
remark = "(debug)";
|
||||||
break;
|
break;
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
default:
|
default:
|
||||||
/*NOTREACHED*/;
|
/*NOTREACHED*/;
|
||||||
}
|
}
|
||||||
|
@ -388,7 +388,7 @@ _error(class, fn, ln, ap)
|
||||||
/* we skip this message */
|
/* we skip this message */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
if (fn)
|
if (fn)
|
||||||
fprint(ERROUT, "\"%s\", line %u: ", fn, ln);
|
fprint(ERROUT, "\"%s\", line %u: ", fn, ln);
|
||||||
|
|
|
@ -347,7 +347,7 @@ EVAL(expr, val, code, true_label, false_label)
|
||||||
eval_field(expr, gencode);
|
eval_field(expr, gencode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
if (is_struct_or_union(tp->tp_fund) && ! gencode) {
|
if (is_struct_or_union(tp->tp_fund) && ! gencode) {
|
||||||
EVAL(right, LVAL, TRUE, NO_LABEL, NO_LABEL);
|
EVAL(right, LVAL, TRUE, NO_LABEL, NO_LABEL);
|
||||||
EVAL(left, LVAL, TRUE, NO_LABEL, NO_LABEL);
|
EVAL(left, LVAL, TRUE, NO_LABEL, NO_LABEL);
|
||||||
|
@ -400,7 +400,7 @@ EVAL(expr, val, code, true_label, false_label)
|
||||||
eval_field(expr, gencode);
|
eval_field(expr, gencode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
if (left->ex_class == Value) {
|
if (left->ex_class == Value) {
|
||||||
compl = 0; /* Value */
|
compl = 0; /* Value */
|
||||||
}
|
}
|
||||||
|
@ -513,7 +513,7 @@ EVAL(expr, val, code, true_label, false_label)
|
||||||
DfaCallFunction(
|
DfaCallFunction(
|
||||||
left->VL_IDF->id_text);
|
left->VL_IDF->id_text);
|
||||||
}
|
}
|
||||||
#endif DATAFLOW
|
#endif /* DATAFLOW */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
EVAL(left, LVAL, TRUE, NO_LABEL, NO_LABEL);
|
EVAL(left, LVAL, TRUE, NO_LABEL, NO_LABEL);
|
||||||
|
@ -1024,5 +1024,5 @@ operands(expr, gencode)
|
||||||
EVAL(expr->OP_LEFT, RVAL, gencode, NO_LABEL, NO_LABEL);
|
EVAL(expr->OP_LEFT, RVAL, gencode, NO_LABEL, NO_LABEL);
|
||||||
EVAL(expr->OP_RIGHT, RVAL, gencode, NO_LABEL, NO_LABEL);
|
EVAL(expr->OP_RIGHT, RVAL, gencode, NO_LABEL, NO_LABEL);
|
||||||
}
|
}
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ idf2expr(expr)
|
||||||
def->df_used = 1;
|
def->df_used = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
expr->ex_type = def->df_type;
|
expr->ex_type = def->df_type;
|
||||||
if (expr->ex_type == error_type) {
|
if (expr->ex_type == error_type) {
|
||||||
expr->ex_flags |= EX_ERROR;
|
expr->ex_flags |= EX_ERROR;
|
||||||
|
@ -189,7 +189,7 @@ idf2expr(expr)
|
||||||
expr->VL_LBL = def->df_address;
|
expr->VL_LBL = def->df_address;
|
||||||
expr->VL_VALUE = (arith)0;
|
expr->VL_VALUE = (arith)0;
|
||||||
}
|
}
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
else {
|
else {
|
||||||
expr->VL_CLASS = Name;
|
expr->VL_CLASS = Name;
|
||||||
expr->VL_IDF = idf;
|
expr->VL_IDF = idf;
|
||||||
|
@ -367,7 +367,7 @@ new_oper(tp, e1, oper, e2)
|
||||||
op->op_right = e2;
|
op->op_right = e2;
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_new_oper(expr);
|
lint_new_oper(expr);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
return expr;
|
return expr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ chk_cst_expr(expp)
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
print_expr("constant_expression", expr);
|
print_expr("constant_expression", expr);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
switch(expr->ex_type->tp_fund) {
|
switch(expr->ex_type->tp_fund) {
|
||||||
case CHAR:
|
case CHAR:
|
||||||
case SHORT:
|
case SHORT:
|
||||||
|
@ -447,7 +447,7 @@ is_ld_cst(expr)
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
if (expr->ex_class == String)
|
if (expr->ex_class == String)
|
||||||
return 1;
|
return 1;
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
return expr->ex_lvalue == 0 && expr->ex_class == Value;
|
return expr->ex_lvalue == 0 && expr->ex_class == Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ store_field(fd, uns, code, leftop, tmpvar)
|
||||||
FreeLocal(tmpvar);
|
FreeLocal(tmpvar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ declare_idf(ds, dc, lvl)
|
||||||
|
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
check_hiding(idf, lvl, sc); /* of some idf by this idf */
|
check_hiding(idf, lvl, sc); /* of some idf by this idf */
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
if (def && lvl == L_LOCAL && def->df_level == L_FORMAL2) {
|
if (def && lvl == L_LOCAL && def->df_level == L_FORMAL2) {
|
||||||
error("%s redeclared", idf->id_text);
|
error("%s redeclared", idf->id_text);
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,7 @@ declare_idf(ds, dc, lvl)
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
newdef->df_set = 0;
|
newdef->df_set = 0;
|
||||||
newdef->df_firstbrace = 0;
|
newdef->df_firstbrace = 0;
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
/* link it into the name list in the proper place */
|
/* link it into the name list in the proper place */
|
||||||
idf->id_def = newdef;
|
idf->id_def = newdef;
|
||||||
update_ahead(idf);
|
update_ahead(idf);
|
||||||
|
@ -520,7 +520,7 @@ declare_formals(idf, fp)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (options['t'])
|
if (options['t'])
|
||||||
dumpidftab("start declare_formals", 0);
|
dumpidftab("start declare_formals", 0);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
while (se) {
|
while (se) {
|
||||||
register struct def *def = se->se_idf->id_def;
|
register struct def *def = se->se_idf->id_def;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ struct id_u {
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
struct macro *idd_macro;
|
struct macro *idd_macro;
|
||||||
int idd_resmac; /* if nonzero: keyword of macroproc. */
|
int idd_resmac; /* if nonzero: keyword of macroproc. */
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
int idd_reserved; /* non-zero for reserved words */
|
int idd_reserved; /* non-zero for reserved words */
|
||||||
char *idd_file; /* file containing the occurrence */
|
char *idd_file; /* file containing the occurrence */
|
||||||
unsigned int idd_line; /* line number of the occurrence */
|
unsigned int idd_line; /* line number of the occurrence */
|
||||||
|
|
|
@ -93,4 +93,4 @@ init_pp()
|
||||||
/* defined(??) */
|
/* defined(??) */
|
||||||
macro_def(str2idf("defined", 0), "", 1, 1, NOUNDEF | FUNC);
|
macro_def(str2idf("defined", 0), "", 1, 1, NOUNDEF | FUNC);
|
||||||
}
|
}
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
|
@ -49,7 +49,7 @@ getwdir(fn)
|
||||||
|
|
||||||
int InputLevel;
|
int InputLevel;
|
||||||
extern int nestlevel;
|
extern int nestlevel;
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
int NoUnstack;
|
int NoUnstack;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ AtEoIT()
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
InputLevel--;
|
InputLevel--;
|
||||||
unstackrepl();
|
unstackrepl();
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ AtEoIF()
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
if (nestlevel != nestlow) lexwarning("missing #endif");
|
if (nestlevel != nestlow) lexwarning("missing #endif");
|
||||||
else
|
else
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
if (NoUnstack) lexerror("unexpected EOF");
|
if (NoUnstack) lexerror("unexpected EOF");
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
nestlevel = nestlow;
|
nestlevel = nestlow;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#else
|
#else
|
||||||
#include "l_em.h"
|
#include "l_em.h"
|
||||||
#include "l_lint.h"
|
#include "l_lint.h"
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include <alloc.h>
|
#include <alloc.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -60,7 +60,7 @@ initial_value(register struct type **tpp; register struct expr **expp;) :
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_expr(*expp, USED);
|
lint_expr(*expp, USED);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
if ((*expp)->ex_type->tp_fund == ARRAY)
|
if ((*expp)->ex_type->tp_fund == ARRAY)
|
||||||
array2pointer(*expp);
|
array2pointer(*expp);
|
||||||
if (tpp) {
|
if (tpp) {
|
||||||
|
@ -449,7 +449,7 @@ pad(tpx)
|
||||||
put_bf(tp, (arith)0);
|
put_bf(tp, (arith)0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
if (tp->tp_align >= word_align) while (sz >= word_size) {
|
if (tp->tp_align >= word_align) while (sz >= word_size) {
|
||||||
C_con_cst((arith) 0);
|
C_con_cst((arith) 0);
|
||||||
|
@ -489,7 +489,7 @@ check_ival(expp, tp)
|
||||||
expr = *expp;
|
expr = *expp;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
print_expr("init-expr after cast", expr);
|
print_expr("init-expr after cast", expr);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
if (!is_ld_cst(expr))
|
if (!is_ld_cst(expr))
|
||||||
illegal_init_cst(expr);
|
illegal_init_cst(expr);
|
||||||
else
|
else
|
||||||
|
@ -522,7 +522,7 @@ check_ival(expp, tp)
|
||||||
expr = *expp;
|
expr = *expp;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
print_expr("init-expr after cast", expr);
|
print_expr("init-expr after cast", expr);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
if (expr->ex_class == Float) {
|
if (expr->ex_class == Float) {
|
||||||
char buf[FLT_STRLEN];
|
char buf[FLT_STRLEN];
|
||||||
|
|
||||||
|
@ -546,7 +546,7 @@ and also to prevent runtime coercions for compile-time constants.
|
||||||
else
|
else
|
||||||
illegal_init_cst(expr);
|
illegal_init_cst(expr);
|
||||||
}
|
}
|
||||||
#endif NOTDEF
|
#endif /* NOTDEF */
|
||||||
else
|
else
|
||||||
illegal_init_cst(expr);
|
illegal_init_cst(expr);
|
||||||
break;
|
break;
|
||||||
|
@ -557,13 +557,13 @@ and also to prevent runtime coercions for compile-time constants.
|
||||||
expr = *expp;
|
expr = *expp;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
print_expr("init-expr after cast", expr);
|
print_expr("init-expr after cast", expr);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
if (is_cp_cst(expr))
|
if (is_cp_cst(expr))
|
||||||
put_bf(tp, expr->VL_VALUE);
|
put_bf(tp, expr->VL_VALUE);
|
||||||
else
|
else
|
||||||
illegal_init_cst(expr);
|
illegal_init_cst(expr);
|
||||||
break;
|
break;
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
case ERRONEOUS:
|
case ERRONEOUS:
|
||||||
if (! gen_error) gen_error = pack_level;
|
if (! gen_error) gen_error = pack_level;
|
||||||
|
@ -677,7 +677,7 @@ put_bf(tp, val)
|
||||||
offset = (arith)-1;
|
offset = (arith)-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
int
|
int
|
||||||
zero_bytes(sd)
|
zero_bytes(sd)
|
||||||
|
|
|
@ -208,4 +208,4 @@ make_format(argn, oldf)
|
||||||
*newf++ = '\0';
|
*newf++ = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#ifdef ANSI
|
#ifdef ANSI
|
||||||
#include <flt_arith.h>
|
#include <flt_arith.h>
|
||||||
#endif ANSI
|
#endif /* ANSI */
|
||||||
#include "arith.h" /* definition arith */
|
#include "arith.h" /* definition arith */
|
||||||
#include "label.h" /* definition label */
|
#include "label.h" /* definition label */
|
||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
|
@ -106,4 +106,4 @@ check_ev_order(esp1, esp2, expr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#ifdef ANSI
|
#ifdef ANSI
|
||||||
#include <flt_arith.h>
|
#include <flt_arith.h>
|
||||||
#endif ANSI
|
#endif /* ANSI */
|
||||||
#include "arith.h" /* definition arith */
|
#include "arith.h" /* definition arith */
|
||||||
#include "label.h" /* definition label */
|
#include "label.h" /* definition label */
|
||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
|
@ -450,6 +450,6 @@ print_esp(msg, esp)
|
||||||
}
|
}
|
||||||
print(">\n");
|
print(">\n");
|
||||||
}
|
}
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
|
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "interface.h"
|
#include "interface.h"
|
||||||
#ifdef ANSI
|
#ifdef ANSI
|
||||||
#include <flt_arith.h>
|
#include <flt_arith.h>
|
||||||
#endif ANSI
|
#endif /* ANSI */
|
||||||
#include "arith.h" /* definition arith */
|
#include "arith.h" /* definition arith */
|
||||||
#include "label.h" /* definition label */
|
#include "label.h" /* definition label */
|
||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
|
@ -424,4 +424,4 @@ lint_relop(left, right, oper)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "interface.h"
|
#include "interface.h"
|
||||||
#ifdef ANSI
|
#ifdef ANSI
|
||||||
#include <flt_arith.h>
|
#include <flt_arith.h>
|
||||||
#endif ANSI
|
#endif /* ANSI */
|
||||||
#include "arith.h"
|
#include "arith.h"
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "type.h"
|
#include "type.h"
|
||||||
|
@ -538,7 +538,7 @@ implicit_func_decl(idf, file, line)
|
||||||
output_def(&od);
|
output_def(&od);
|
||||||
/* The other fields are not used for this class. */
|
/* The other fields are not used for this class. */
|
||||||
}
|
}
|
||||||
#endif IMPLICIT
|
#endif /* IMPLICIT */
|
||||||
|
|
||||||
fill_outcall(ex, used)
|
fill_outcall(ex, used)
|
||||||
struct expr *ex;
|
struct expr *ex;
|
||||||
|
@ -552,7 +552,7 @@ fill_outcall(ex, used)
|
||||||
/* IFDC, first time */
|
/* IFDC, first time */
|
||||||
implicit_func_decl(idf, ex->ex_file, ex->ex_line);
|
implicit_func_decl(idf, ex->ex_file, ex->ex_line);
|
||||||
}
|
}
|
||||||
#endif IMPLICIT
|
#endif /* IMPLICIT */
|
||||||
|
|
||||||
OutCall.od_type = def->df_type->tp_up;
|
OutCall.od_type = def->df_type->tp_up;
|
||||||
OutCall.od_statnr = (def->df_sc == STATIC ? stat_number : 0);
|
OutCall.od_statnr = (def->df_sc == STATIC ? stat_number : 0);
|
||||||
|
@ -617,4 +617,4 @@ add_expr_arg(e)
|
||||||
OutCall.od_nrargs++;
|
OutCall.od_nrargs++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#ifdef ANSI
|
#ifdef ANSI
|
||||||
#include <flt_arith.h>
|
#include <flt_arith.h>
|
||||||
#endif ANSI
|
#endif /* ANSI */
|
||||||
#include "arith.h"
|
#include "arith.h"
|
||||||
#include "label.h"
|
#include "label.h"
|
||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#define dbg_lint_stack(m) /*print_lint_stack(m) /* or not */
|
#define dbg_lint_stack(m) /*print_lint_stack(m) /* or not */
|
||||||
#else
|
#else
|
||||||
#define dbg_lint_stack(m)
|
#define dbg_lint_stack(m)
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
|
|
||||||
extern char *symbol2str();
|
extern char *symbol2str();
|
||||||
extern char *func_name;
|
extern char *func_name;
|
||||||
|
@ -208,7 +208,7 @@ lint_1_global(idf, def)
|
||||||
case GLOBAL:
|
case GLOBAL:
|
||||||
#ifdef IMPLICIT
|
#ifdef IMPLICIT
|
||||||
case IMPLICIT:
|
case IMPLICIT:
|
||||||
#endif IMPLICIT
|
#endif /* IMPLICIT */
|
||||||
if (fund == ERRONEOUS)
|
if (fund == ERRONEOUS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1310,6 +1310,6 @@ print_lint_stack(msg)
|
||||||
print(" |--------------\n\n");
|
print(" |--------------\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
|
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
|
@ -49,4 +49,4 @@ struct macro {
|
||||||
#define K_PRAGMA 11
|
#define K_PRAGMA 11
|
||||||
#define K_UNDEF 12
|
#define K_UNDEF 12
|
||||||
#define K_FILE 100 /* for dependency generator */
|
#define K_FILE 100 /* for dependency generator */
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
|
@ -45,7 +45,7 @@ extern char *dep_file;
|
||||||
static File *dep_fd = STDOUT;
|
static File *dep_fd = STDOUT;
|
||||||
|
|
||||||
extern char *getwdir();
|
extern char *getwdir();
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
struct sp_id special_ids[] = {
|
struct sp_id special_ids[] = {
|
||||||
{"__setjmp", SP_SETJMP}, /* non-local goto's are registered */
|
{"__setjmp", SP_SETJMP}, /* non-local goto's are registered */
|
||||||
|
@ -75,11 +75,11 @@ int
|
||||||
pointer_align = AL_POINTER,
|
pointer_align = AL_POINTER,
|
||||||
struct_align = AL_STRUCT,
|
struct_align = AL_STRUCT,
|
||||||
union_align = AL_UNION;
|
union_align = AL_UNION;
|
||||||
#endif NOCROSS
|
#endif /* NOCROSS */
|
||||||
|
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
arith ifval; /* ifval will contain the result of the #if expression */
|
arith ifval; /* ifval will contain the result of the #if expression */
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
char *prog_name;
|
char *prog_name;
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ main(argc, argv)
|
||||||
inc_max = 10;
|
inc_max = 10;
|
||||||
|
|
||||||
init_pp(); /* initialise the preprocessor macros */
|
init_pp(); /* initialise the preprocessor macros */
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
/* Note: source file "-" indicates that the source is supplied
|
/* Note: source file "-" indicates that the source is supplied
|
||||||
as standard input. This is only allowed if INP_READ_IN_ONE is
|
as standard input. This is only allowed if INP_READ_IN_ONE is
|
||||||
|
@ -106,9 +106,9 @@ main(argc, argv)
|
||||||
*/
|
*/
|
||||||
#ifdef INP_READ_IN_ONE
|
#ifdef INP_READ_IN_ONE
|
||||||
while (argc > 1 && *argv[1] == '-')
|
while (argc > 1 && *argv[1] == '-')
|
||||||
#else INP_READ_IN_ONE
|
#else /* INP_READ_IN_ONE */
|
||||||
while (argc > 1 && *argv[1] == '-' && argv[1][1] != '\0')
|
while (argc > 1 && *argv[1] == '-' && argv[1][1] != '\0')
|
||||||
#endif INP_READ_IN_ONE
|
#endif /* INP_READ_IN_ONE */
|
||||||
{
|
{
|
||||||
char *par = &argv[1][1];
|
char *par = &argv[1][1];
|
||||||
|
|
||||||
|
@ -117,13 +117,13 @@ main(argc, argv)
|
||||||
}
|
}
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_init();
|
lint_init();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
compile(argc - 1, &argv[1]);
|
compile(argc - 1, &argv[1]);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (options['h']) hash_stat();
|
if (options['h']) hash_stat();
|
||||||
if (options['m']) Info();
|
if (options['m']) Info();
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
|
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
if (do_dependencies) {
|
if (do_dependencies) {
|
||||||
|
@ -199,13 +199,13 @@ char *s, *source;
|
||||||
else fprint(dep_fd, "%s\n", s);
|
else fprint(dep_fd, "%s\n", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
char *source = 0;
|
char *source = 0;
|
||||||
|
|
||||||
#ifdef GEN_NM_LIST
|
#ifdef GEN_NM_LIST
|
||||||
char *nmlist = 0;
|
char *nmlist = 0;
|
||||||
#endif GEN_NM_LIST
|
#endif /* GEN_NM_LIST */
|
||||||
|
|
||||||
compile(argc, argv)
|
compile(argc, argv)
|
||||||
char *argv[];
|
char *argv[];
|
||||||
|
@ -213,12 +213,12 @@ compile(argc, argv)
|
||||||
char *result;
|
char *result;
|
||||||
#ifndef LINT
|
#ifndef LINT
|
||||||
register char *destination = 0;
|
register char *destination = 0;
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
int pp_only = options['E'] || options['P'] || options['C'];
|
int pp_only = options['E'] || options['P'] || options['C'];
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (argc) {
|
switch (argc) {
|
||||||
|
@ -227,10 +227,10 @@ compile(argc, argv)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
if (!pp_only)
|
if (!pp_only)
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
#endif
|
#endif
|
||||||
fatal("%s: destination file not specified", prog_name);
|
fatal("%s: destination file not specified", prog_name);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifndef LINT
|
#ifndef LINT
|
||||||
|
@ -242,19 +242,19 @@ compile(argc, argv)
|
||||||
nmlist = argv[2];
|
nmlist = argv[2];
|
||||||
destination = argv[1];
|
destination = argv[1];
|
||||||
break;
|
break;
|
||||||
#endif GEN_NM_LIST
|
#endif /* GEN_NM_LIST */
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
#ifndef LINT
|
#ifndef LINT
|
||||||
#ifdef GEN_NM_LIST
|
#ifdef GEN_NM_LIST
|
||||||
fatal("use: %s source destination [namelist]", prog_name);
|
fatal("use: %s source destination [namelist]", prog_name);
|
||||||
#else GEN_NM_LIST
|
#else /* GEN_NM_LIST */
|
||||||
fatal("use: %s source destination", prog_name);
|
fatal("use: %s source destination", prog_name);
|
||||||
#endif GEN_NM_LIST
|
#endif /* GEN_NM_LIST */
|
||||||
#else LINT
|
#else /* LINT */
|
||||||
fatal("use: %s source", prog_name);
|
fatal("use: %s source", prog_name);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,33 +277,33 @@ compile(argc, argv)
|
||||||
&& strcmp(destination, "-") != 0
|
&& strcmp(destination, "-") != 0
|
||||||
? destination
|
? destination
|
||||||
: 0);
|
: 0);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
WorkingDir = getwdir(source);
|
WorkingDir = getwdir(source);
|
||||||
PushLex(); /* initialize lex machine */
|
PushLex(); /* initialize lex machine */
|
||||||
#else NOPP
|
#else /* NOPP */
|
||||||
GetToken(&ahead);
|
GetToken(&ahead);
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
if (pp_only) /* run the preprocessor as if it is stand-alone */
|
if (pp_only) /* run the preprocessor as if it is stand-alone */
|
||||||
preprocess();
|
preprocess();
|
||||||
else
|
else
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
{
|
{
|
||||||
/* compile the source text */
|
/* compile the source text */
|
||||||
C_program();
|
C_program();
|
||||||
|
|
||||||
#ifdef PREPEND_SCOPES
|
#ifdef PREPEND_SCOPES
|
||||||
prepend_scopes();
|
prepend_scopes();
|
||||||
#endif PREPEND_SCOPES
|
#endif /* PREPEND_SCOPES */
|
||||||
|
|
||||||
#ifndef LINT
|
#ifndef LINT
|
||||||
end_code();
|
end_code();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (options['u']) {
|
if (options['u']) {
|
||||||
|
@ -311,7 +311,7 @@ compile(argc, argv)
|
||||||
}
|
}
|
||||||
if (options['f'] || options['t'])
|
if (options['f'] || options['t'])
|
||||||
dumpidftab("end of main", options['f'] ? 7 : 0);
|
dumpidftab("end of main", options['f'] ? 7 : 0);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
}
|
}
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
PopLex();
|
PopLex();
|
||||||
|
@ -465,7 +465,7 @@ preprocess()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
Info()
|
Info()
|
||||||
{
|
{
|
||||||
|
@ -497,7 +497,7 @@ Info()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
|
|
||||||
No_Mem() /* called by alloc package */
|
No_Mem() /* called by alloc package */
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,12 +29,12 @@ extern int inc_total;
|
||||||
int do_dependencies = 0;
|
int do_dependencies = 0;
|
||||||
char *dep_file = 0;
|
char *dep_file = 0;
|
||||||
|
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
char options[128]; /* one for every char */
|
char options[128]; /* one for every char */
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
char loptions[128]; /* one for every char */
|
char loptions[128]; /* one for every char */
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
extern int idfsize;
|
extern int idfsize;
|
||||||
extern int density;
|
extern int density;
|
||||||
|
@ -55,9 +55,9 @@ next_option: /* to allow combined one-char options */
|
||||||
default:
|
default:
|
||||||
#ifndef LINT
|
#ifndef LINT
|
||||||
fatal("illegal option: %c", opt);
|
fatal("illegal option: %c", opt);
|
||||||
#else LINT
|
#else /* LINT */
|
||||||
warning("illegal option: %c", opt);
|
warning("illegal option: %c", opt);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '-':
|
case '-':
|
||||||
|
@ -76,8 +76,8 @@ next_option: /* to allow combined one-char options */
|
||||||
case 'm':
|
case 'm':
|
||||||
options[opt] = 1;
|
options[opt] = 1;
|
||||||
break;
|
break;
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
#ifdef DBSYMTAB
|
#ifdef DBSYMTAB
|
||||||
case 'g': /* symbol table for debugger */
|
case 'g': /* symbol table for debugger */
|
||||||
options['g'] = 1;
|
options['g'] = 1;
|
||||||
|
@ -88,7 +88,7 @@ next_option: /* to allow combined one-char options */
|
||||||
#ifndef LINT
|
#ifndef LINT
|
||||||
#ifdef DATAFLOW
|
#ifdef DATAFLOW
|
||||||
case 'd':
|
case 'd':
|
||||||
#endif DATAFLOW
|
#endif /* DATAFLOW */
|
||||||
case 'p': /* procentry/procexit */
|
case 'p': /* procentry/procexit */
|
||||||
case 'L' : /* no fil/lin */
|
case 'L' : /* no fil/lin */
|
||||||
case 'n': /* use no registers */
|
case 'n': /* use no registers */
|
||||||
|
@ -101,7 +101,7 @@ next_option: /* to allow combined one-char options */
|
||||||
options['w'] = 1; /* implies -a */
|
options['w'] = 1; /* implies -a */
|
||||||
options['s'] = 1;
|
options['s'] = 1;
|
||||||
goto next_option;
|
goto next_option;
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
case 'h': /* heuristic tests */
|
case 'h': /* heuristic tests */
|
||||||
|
@ -113,7 +113,7 @@ next_option: /* to allow combined one-char options */
|
||||||
case 'L': /* lintlibrary */
|
case 'L': /* lintlibrary */
|
||||||
loptions[opt] = 1;
|
loptions[opt] = 1;
|
||||||
goto next_option;
|
goto next_option;
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
case 'D' : { /* -Dname : predefine name */
|
case 'D' : { /* -Dname : predefine name */
|
||||||
|
@ -170,7 +170,7 @@ next_option: /* to allow combined one-char options */
|
||||||
}
|
}
|
||||||
else inctable[inc_pos] = 0;
|
else inctable[inc_pos] = 0;
|
||||||
break;
|
break;
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
case 'M': /* maximum identifier length */
|
case 'M': /* maximum identifier length */
|
||||||
idfsize = txt2int(&text);
|
idfsize = txt2int(&text);
|
||||||
|
@ -186,7 +186,7 @@ next_option: /* to allow combined one-char options */
|
||||||
stat_number = txt2int(&text);
|
stat_number = txt2int(&text);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
case 'T' : {
|
case 'T' : {
|
||||||
#ifdef USE_TMP
|
#ifdef USE_TMP
|
||||||
|
@ -195,9 +195,9 @@ next_option: /* to allow combined one-char options */
|
||||||
C_tmpdir = text;
|
C_tmpdir = text;
|
||||||
else
|
else
|
||||||
C_tmpdir = ".";
|
C_tmpdir = ".";
|
||||||
#else USE_TMP
|
#else /* USE_TMP */
|
||||||
warning("-T option ignored");
|
warning("-T option ignored");
|
||||||
#endif USE_TMP
|
#endif /* USE_TMP */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ next_option: /* to allow combined one-char options */
|
||||||
case 'U' : /* -Uname : undefine predefined */
|
case 'U' : /* -Uname : undefine predefined */
|
||||||
if (*text) do_undef(str2idf(text, 0));
|
if (*text) do_undef(str2idf(text, 0));
|
||||||
break;
|
break;
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
#ifndef LINT
|
#ifndef LINT
|
||||||
#ifndef NOCROSS
|
#ifndef NOCROSS
|
||||||
|
@ -273,9 +273,9 @@ next_option: /* to allow combined one-char options */
|
||||||
case 'r': /* adjust bitfields right */
|
case 'r': /* adjust bitfields right */
|
||||||
#ifndef NOBITFIELD
|
#ifndef NOBITFIELD
|
||||||
options['r'] = 1;
|
options['r'] = 1;
|
||||||
#else NOBITFIELD
|
#else /* NOBITFIELD */
|
||||||
warning("bitfields are not implemented");
|
warning("bitfields are not implemented");
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
break;
|
break;
|
||||||
case 'S': /* initial struct alignment */
|
case 'S': /* initial struct alignment */
|
||||||
if (sz != (arith)0)
|
if (sz != (arith)0)
|
||||||
|
@ -294,8 +294,8 @@ next_option: /* to allow combined one-char options */
|
||||||
case 'S':
|
case 'S':
|
||||||
density = txt2int(&text);
|
density = txt2int(&text);
|
||||||
break;
|
break;
|
||||||
#endif NOCROSS
|
#endif /* NOCROSS */
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,11 +61,11 @@
|
||||||
#include "def.h"
|
#include "def.h"
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
#include "l_lint.h"
|
#include "l_lint.h"
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
#ifndef NOPP
|
#ifndef NOPP
|
||||||
extern arith ifval;
|
extern arith ifval;
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
extern error();
|
extern error();
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ control_if_expression
|
||||||
"sizeof not allowed in preprocessor");
|
"sizeof not allowed in preprocessor");
|
||||||
ifval = expr->VL_VALUE;
|
ifval = expr->VL_VALUE;
|
||||||
free_expression(expr);
|
free_expression(expr);
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ external_definition
|
||||||
declare_idf(&Ds, &Dc, level);
|
declare_idf(&Ds, &Dc, level);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_ext_def(Dc.dc_idf, Ds.ds_sc);
|
lint_ext_def(Dc.dc_idf, Ds.ds_sc);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
[
|
[
|
||||||
function(&Ds, &Dc)
|
function(&Ds, &Dc)
|
||||||
|
@ -185,7 +185,7 @@ non_function(register struct decspecs *ds; register struct declarator *dc;)
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_non_function_decl(ds, dc);
|
lint_non_function_decl(ds, dc);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
[
|
[
|
||||||
','
|
','
|
||||||
|
@ -204,7 +204,7 @@ function(struct decspecs *ds; struct declarator *dc;)
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_start_function();
|
lint_start_function();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
idf_initialized(idf);
|
idf_initialized(idf);
|
||||||
stack_level(); /* L_FORMAL1 declarations */
|
stack_level(); /* L_FORMAL1 declarations */
|
||||||
declare_params(dc);
|
declare_params(dc);
|
||||||
|
@ -218,21 +218,21 @@ function(struct decspecs *ds; struct declarator *dc;)
|
||||||
declare_formals(idf, &fbytes);
|
declare_formals(idf, &fbytes);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_formals();
|
lint_formals();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
compound_statement
|
compound_statement
|
||||||
{
|
{
|
||||||
end_proc(fbytes);
|
end_proc(fbytes);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_implicit_return();
|
lint_implicit_return();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
unstack_level(); /* L_FORMAL2 declarations */
|
unstack_level(); /* L_FORMAL2 declarations */
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_end_formals();
|
lint_end_formals();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
unstack_level(); /* L_FORMAL1 declarations */
|
unstack_level(); /* L_FORMAL1 declarations */
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_end_function();
|
lint_end_function();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
|
@ -204,7 +204,7 @@ declare_protos(dc)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (options['t'])
|
if (options['t'])
|
||||||
dumpidftab("start declare_protos", 0);
|
dumpidftab("start declare_protos", 0);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
du = dc->dc_decl_unary;
|
du = dc->dc_decl_unary;
|
||||||
while (du) {
|
while (du) {
|
||||||
if (du->du_fund == FUNCTION) {
|
if (du->du_fund == FUNCTION) {
|
||||||
|
@ -261,7 +261,7 @@ declare_protos(dc)
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (options['t'])
|
if (options['t'])
|
||||||
dumpidftab("end declare_protos", 0);
|
dumpidftab("end declare_protos", 0);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -790,4 +790,4 @@ stash(repl, ch, stashraw)
|
||||||
*args->a_rawptr++ = ch;
|
*args->a_rawptr++ = ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
|
@ -15,7 +15,7 @@ extern arith
|
||||||
pointer_size;
|
pointer_size;
|
||||||
|
|
||||||
extern arith max_int, max_unsigned; /* cstoper.c */
|
extern arith max_int, max_unsigned; /* cstoper.c */
|
||||||
#else NOCROSS
|
#else /* NOCROSS */
|
||||||
#define short_size ((arith)SZ_SHORT)
|
#define short_size ((arith)SZ_SHORT)
|
||||||
#define word_size ((arith)SZ_WORD)
|
#define word_size ((arith)SZ_WORD)
|
||||||
#define dword_size ((arith)2*SZ_WORD)
|
#define dword_size ((arith)2*SZ_WORD)
|
||||||
|
@ -33,5 +33,5 @@ extern arith max_int, max_unsigned; /* cstoper.c */
|
||||||
#define max_int ((arith)2147483647)
|
#define max_int ((arith)2147483647)
|
||||||
#define max_unsigned ((arith)4294967295)
|
#define max_unsigned ((arith)4294967295)
|
||||||
#endif
|
#endif
|
||||||
#endif NOCROSS
|
#endif /* NOCROSS */
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ skipspaces(ch, skipnl)
|
||||||
return ch;
|
return ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif NOPP
|
#endif /* NOPP */
|
||||||
|
|
||||||
SkipToNewLine()
|
SkipToNewLine()
|
||||||
{
|
{
|
||||||
|
|
|
@ -304,4 +304,4 @@ stb_string(df, kind, str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif DBSYMTAB
|
#endif /* DBSYMTAB */
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <em.h>
|
#include <em.h>
|
||||||
#else
|
#else
|
||||||
#include "l_em.h"
|
#include "l_em.h"
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "botch_free.h"
|
#include "botch_free.h"
|
||||||
#include <alloc.h>
|
#include <alloc.h>
|
||||||
|
@ -56,7 +56,7 @@ stack_level() {
|
||||||
local_level = stl;
|
local_level = stl;
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_start_local();
|
lint_start_local();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
|
|
||||||
stack_idf(idf, stl)
|
stack_idf(idf, stl)
|
||||||
|
@ -110,11 +110,11 @@ unstack_level()
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (options['t'])
|
if (options['t'])
|
||||||
dumpidftab("before unstackidfs", 0);
|
dumpidftab("before unstackidfs", 0);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
|
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_end_local(local_level);
|
lint_end_local(local_level);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
/* The implementation below is more careful than strictly
|
/* The implementation below is more careful than strictly
|
||||||
necessary. Optimists may optimize it afterwards.
|
necessary. Optimists may optimize it afterwards.
|
||||||
|
@ -172,7 +172,7 @@ unstack_level()
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (options['t'])
|
if (options['t'])
|
||||||
dumpidftab("after unstackidfs", 0);
|
dumpidftab("after unstackidfs", 0);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
}
|
}
|
||||||
|
|
||||||
unstack_world()
|
unstack_world()
|
||||||
|
@ -188,11 +188,11 @@ unstack_world()
|
||||||
|
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_end_global(local_level);
|
lint_end_global(local_level);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
#ifdef GEN_NM_LIST
|
#ifdef GEN_NM_LIST
|
||||||
open_name_list();
|
open_name_list();
|
||||||
#endif GEN_NM_LIST
|
#endif /* GEN_NM_LIST */
|
||||||
|
|
||||||
while (se) {
|
while (se) {
|
||||||
register struct idf *idf = se->se_idf;
|
register struct idf *idf = se->se_idf;
|
||||||
|
@ -218,7 +218,7 @@ unstack_world()
|
||||||
def->df_initialized ? "init" : "no init",
|
def->df_initialized ? "init" : "no init",
|
||||||
def->df_used ? "used" : "not used");
|
def->df_used ? "used" : "not used");
|
||||||
}
|
}
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
if (def->df_sc == STATIC
|
if (def->df_sc == STATIC
|
||||||
&& def->df_type->tp_fund == FUNCTION
|
&& def->df_type->tp_fund == FUNCTION
|
||||||
&& !def->df_initialized) {
|
&& !def->df_initialized) {
|
||||||
|
@ -236,7 +236,7 @@ unstack_world()
|
||||||
#ifdef GEN_NM_LIST
|
#ifdef GEN_NM_LIST
|
||||||
if (def->df_sc != STATIC)
|
if (def->df_sc != STATIC)
|
||||||
namelist(idf->id_text); /* may be common */
|
namelist(idf->id_text); /* may be common */
|
||||||
#endif GEN_NM_LIST
|
#endif /* GEN_NM_LIST */
|
||||||
def->df_alloc = ALLOC_DONE; /* see Note below */
|
def->df_alloc = ALLOC_DONE; /* see Note below */
|
||||||
}
|
}
|
||||||
se = se->next;
|
se = se->next;
|
||||||
|
@ -278,4 +278,4 @@ namelist(nm)
|
||||||
sys_write(nfp, "\n", 1);
|
sys_write(nfp, "\n", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif GEN_NM_LIST
|
#endif /* GEN_NM_LIST */
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#else
|
#else
|
||||||
#include "l_em.h"
|
#include "l_em.h"
|
||||||
#include "l_lint.h"
|
#include "l_lint.h"
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "botch_free.h"
|
#include "botch_free.h"
|
||||||
|
@ -46,7 +46,7 @@ statement
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_statement();
|
lint_statement();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
:
|
:
|
||||||
%if (AHEAD != ':')
|
%if (AHEAD != ':')
|
||||||
|
@ -75,7 +75,7 @@ statement
|
||||||
code_break();
|
code_break();
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_break_stmt();
|
lint_break_stmt();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
';'
|
';'
|
||||||
|
|
|
|
||||||
|
@ -84,7 +84,7 @@ statement
|
||||||
code_continue();
|
code_continue();
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_continue_stmt();
|
lint_continue_stmt();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
';'
|
';'
|
||||||
|
|
|
|
||||||
|
@ -105,7 +105,7 @@ expression_statement
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
print_expr("expression_statement", expr);
|
print_expr("expression_statement", expr);
|
||||||
#endif DEBUG
|
#endif /* DEBUG */
|
||||||
code_expr(expr, RVAL, FALSE, NO_LABEL, NO_LABEL);
|
code_expr(expr, RVAL, FALSE, NO_LABEL, NO_LABEL);
|
||||||
free_expression(expr);
|
free_expression(expr);
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ label
|
||||||
*/
|
*/
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_label();
|
lint_label();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
define_label(idf);
|
define_label(idf);
|
||||||
C_df_ilb((label)idf->id_label->df_address);
|
C_df_ilb((label)idf->id_label->df_address);
|
||||||
}
|
}
|
||||||
|
@ -156,14 +156,14 @@ if_statement
|
||||||
/* else fall through */
|
/* else fall through */
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
start_if_part(1);
|
start_if_part(1);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
code_expr(expr, RVAL, TRUE, l_true, l_false);
|
code_expr(expr, RVAL, TRUE, l_true, l_false);
|
||||||
C_df_ilb(l_true);
|
C_df_ilb(l_true);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
start_if_part(0);
|
start_if_part(0);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
free_expression(expr);
|
free_expression(expr);
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ if_statement
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
start_else_part();
|
start_else_part();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
C_bra(l_end);
|
C_bra(l_end);
|
||||||
C_df_ilb(l_false);
|
C_df_ilb(l_false);
|
||||||
}
|
}
|
||||||
|
@ -182,14 +182,14 @@ if_statement
|
||||||
{ C_df_ilb(l_end);
|
{ C_df_ilb(l_end);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
end_if_else_stmt();
|
end_if_else_stmt();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
|
|
|
|
||||||
empty
|
empty
|
||||||
{ C_df_ilb(l_false);
|
{ C_df_ilb(l_false);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
end_if_stmt();
|
end_if_stmt();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
;
|
;
|
||||||
|
@ -223,7 +223,7 @@ while_statement
|
||||||
}
|
}
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
start_while_stmt(expr);
|
start_while_stmt(expr);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
')'
|
')'
|
||||||
statement
|
statement
|
||||||
|
@ -235,7 +235,7 @@ while_statement
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
end_loop_body();
|
end_loop_body();
|
||||||
end_loop_stmt();
|
end_loop_stmt();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ do_statement
|
||||||
stack_stmt(l_break, l_continue);
|
stack_stmt(l_break, l_continue);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
start_do_stmt();
|
start_do_stmt();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
statement
|
statement
|
||||||
WHILE
|
WHILE
|
||||||
|
@ -260,7 +260,7 @@ do_statement
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
end_loop_body();
|
end_loop_body();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
C_df_ilb(l_continue);
|
C_df_ilb(l_continue);
|
||||||
}
|
}
|
||||||
expression(&expr)
|
expression(&expr)
|
||||||
|
@ -272,13 +272,13 @@ do_statement
|
||||||
}
|
}
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
end_do_stmt(1, expr->VL_VALUE != (arith)0);
|
end_do_stmt(1, expr->VL_VALUE != (arith)0);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
code_expr(expr, RVAL, TRUE, l_body, l_break);
|
code_expr(expr, RVAL, TRUE, l_body, l_break);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
end_do_stmt(0, 0);
|
end_do_stmt(0, 0);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
C_df_ilb(l_break);
|
C_df_ilb(l_break);
|
||||||
}
|
}
|
||||||
|
@ -332,13 +332,13 @@ for_statement
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
start_for_stmt(e_test);
|
start_for_stmt(e_test);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
statement
|
statement
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
end_loop_body();
|
end_loop_body();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
C_df_ilb(l_continue);
|
C_df_ilb(l_continue);
|
||||||
if (e_incr)
|
if (e_incr)
|
||||||
code_expr(e_incr, RVAL, FALSE,
|
code_expr(e_incr, RVAL, FALSE,
|
||||||
|
@ -351,7 +351,7 @@ for_statement
|
||||||
free_expression(e_incr);
|
free_expression(e_incr);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
end_loop_stmt();
|
end_loop_stmt();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -368,14 +368,14 @@ switch_statement
|
||||||
code_startswitch(&expr);
|
code_startswitch(&expr);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
start_switch_part(is_cp_cst(expr));
|
start_switch_part(is_cp_cst(expr));
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
')'
|
')'
|
||||||
statement
|
statement
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
end_switch_stmt();
|
end_switch_stmt();
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
code_endswitch();
|
code_endswitch();
|
||||||
free_expression(expr);
|
free_expression(expr);
|
||||||
}
|
}
|
||||||
|
@ -392,7 +392,7 @@ case_statement
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_case_stmt(0);
|
lint_case_stmt(0);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
code_case(expr);
|
code_case(expr);
|
||||||
free_expression(expr);
|
free_expression(expr);
|
||||||
}
|
}
|
||||||
|
@ -407,7 +407,7 @@ default_statement
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_case_stmt(1);
|
lint_case_stmt(1);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
code_default();
|
code_default();
|
||||||
}
|
}
|
||||||
':'
|
':'
|
||||||
|
@ -425,13 +425,13 @@ return_statement
|
||||||
{
|
{
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_ret_conv(expr);
|
lint_ret_conv(expr);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
||||||
do_return_expr(expr);
|
do_return_expr(expr);
|
||||||
free_expression(expr);
|
free_expression(expr);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_return_stmt(VALRETURNED);
|
lint_return_stmt(VALRETURNED);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
|
|
|
|
||||||
empty
|
empty
|
||||||
|
@ -439,7 +439,7 @@ return_statement
|
||||||
do_return();
|
do_return();
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_return_stmt(NOVALRETURNED);
|
lint_return_stmt(NOVALRETURNED);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
';'
|
';'
|
||||||
|
@ -458,7 +458,7 @@ jump
|
||||||
C_bra((label)idf->id_label->df_address);
|
C_bra((label)idf->id_label->df_address);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
lint_jump_stmt(idf);
|
lint_jump_stmt(idf);
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ add_sel(stp, tp, idf, sdefpp, szp, fd) /* this is horrible */
|
||||||
arith offset;
|
arith offset;
|
||||||
#ifndef NOBITFIELD
|
#ifndef NOBITFIELD
|
||||||
extern arith add_field();
|
extern arith add_field();
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
struct tag *tg = stp->tp_idf->id_tag; /* or union */
|
struct tag *tg = stp->tp_idf->id_tag; /* or union */
|
||||||
struct sdef *sdef = idf->id_sdef;
|
struct sdef *sdef = idf->id_sdef;
|
||||||
|
@ -90,10 +90,10 @@ add_sel(stp, tp, idf, sdefpp, szp, fd) /* this is horrible */
|
||||||
*/
|
*/
|
||||||
offset = add_field(szp, fd, &tp, idf, stp);
|
offset = add_field(szp, fd, &tp, idf, stp);
|
||||||
}
|
}
|
||||||
#else NOBITFIELD
|
#else /* NOBITFIELD */
|
||||||
offset = align(*szp, tp->tp_align);
|
offset = align(*szp, tp->tp_align);
|
||||||
field_busy = 0;
|
field_busy = 0;
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
}
|
}
|
||||||
else { /* (stp->tp_fund == UNION) */
|
else { /* (stp->tp_fund == UNION) */
|
||||||
if (fd) offset = add_field(szp, fd, &tp, idf, stp);
|
if (fd) offset = add_field(szp, fd, &tp, idf, stp);
|
||||||
|
@ -119,7 +119,7 @@ add_sel(stp, tp, idf, sdefpp, szp, fd) /* this is horrible */
|
||||||
#ifndef NOBITFIELD
|
#ifndef NOBITFIELD
|
||||||
if (tp->tp_fund == FIELD)
|
if (tp->tp_fund == FIELD)
|
||||||
tp->tp_field->fd_sdef = newsdef;
|
tp->tp_field->fd_sdef = newsdef;
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
stack_idf(idf, stack_level_of(lvl));
|
stack_idf(idf, stack_level_of(lvl));
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ add_field(szp, fd, fdtpp, idf, stp)
|
||||||
|
|
||||||
return field_offset;
|
return field_offset;
|
||||||
}
|
}
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
/* some utilities */
|
/* some utilities */
|
||||||
int
|
int
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <em.h>
|
#include <em.h>
|
||||||
#else
|
#else
|
||||||
#include "l_em.h"
|
#include "l_em.h"
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "botch_free.h"
|
#include "botch_free.h"
|
||||||
#include <alloc.h>
|
#include <alloc.h>
|
||||||
|
|
|
@ -33,7 +33,7 @@ struct tokenname tkspec[] = { /* the names of the special tokens */
|
||||||
{FLOATING, "floating"},
|
{FLOATING, "floating"},
|
||||||
{0, ""}
|
{0, ""}
|
||||||
};
|
};
|
||||||
#endif ____
|
#endif /* ____ */
|
||||||
|
|
||||||
#ifdef ____
|
#ifdef ____
|
||||||
struct tokenname tkcomp[] = { /* names of the composite tokens */
|
struct tokenname tkcomp[] = { /* names of the composite tokens */
|
||||||
|
@ -61,7 +61,7 @@ struct tokenname tkcomp[] = { /* names of the composite tokens */
|
||||||
{ELLIPSIS, "..."},
|
{ELLIPSIS, "..."},
|
||||||
{0, ""}
|
{0, ""}
|
||||||
};
|
};
|
||||||
#endif ____
|
#endif /* ____ */
|
||||||
|
|
||||||
struct tokenname tkidf[] = { /* names of the identifier tokens */
|
struct tokenname tkidf[] = { /* names of the identifier tokens */
|
||||||
{AUTO, "auto"},
|
{AUTO, "auto"},
|
||||||
|
@ -129,7 +129,7 @@ struct tokenname tkfunny[] = { /* internal keywords */
|
||||||
{FLOAT2FLOAT, "float2float"},
|
{FLOAT2FLOAT, "float2float"},
|
||||||
{0, ""}
|
{0, ""}
|
||||||
};
|
};
|
||||||
#endif ____
|
#endif /* ____ */
|
||||||
|
|
||||||
reserve(resv)
|
reserve(resv)
|
||||||
register struct tokenname resv[];
|
register struct tokenname resv[];
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
extern struct type *function_of(), *array_of();
|
extern struct type *function_of(), *array_of();
|
||||||
#ifndef NOBITFIELD
|
#ifndef NOBITFIELD
|
||||||
extern struct type *field_of();
|
extern struct type *field_of();
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
/* To be created dynamically in main() from defaults or from command
|
/* To be created dynamically in main() from defaults or from command
|
||||||
line parameters.
|
line parameters.
|
||||||
|
@ -84,7 +84,7 @@ construct_type(fund, tp, qual, count, pl)
|
||||||
case FIELD:
|
case FIELD:
|
||||||
dtp = field_of(tp, qual);
|
dtp = field_of(tp, qual);
|
||||||
break;
|
break;
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
case FUNCTION:
|
case FUNCTION:
|
||||||
if (tp->tp_fund == FUNCTION) {
|
if (tp->tp_fund == FUNCTION) {
|
||||||
|
@ -228,7 +228,7 @@ field_of(tp, qual)
|
||||||
dtp->tp_typequal = qual;
|
dtp->tp_typequal = qual;
|
||||||
return dtp;
|
return dtp;
|
||||||
}
|
}
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
arith
|
arith
|
||||||
size_of_type(tp, nm)
|
size_of_type(tp, nm)
|
||||||
|
|
|
@ -64,7 +64,7 @@ extern struct type
|
||||||
|
|
||||||
#ifndef NOBITFIELD
|
#ifndef NOBITFIELD
|
||||||
extern struct type *field_of();
|
extern struct type *field_of();
|
||||||
#endif NOBITFIELD
|
#endif /* NOBITFIELD */
|
||||||
|
|
||||||
extern struct type
|
extern struct type
|
||||||
*schar_type, *uchar_type,
|
*schar_type, *uchar_type,
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <em.h>
|
#include <em.h>
|
||||||
#else
|
#else
|
||||||
#include "l_em.h"
|
#include "l_em.h"
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
#include <em_arith.h>
|
#include <em_arith.h>
|
||||||
#include <em_reg.h>
|
#include <em_reg.h>
|
||||||
#include <alloc.h>
|
#include <alloc.h>
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
static struct localvar *FreeTmps;
|
static struct localvar *FreeTmps;
|
||||||
#ifdef USE_TMP
|
#ifdef USE_TMP
|
||||||
static int loc_id;
|
static int loc_id;
|
||||||
#endif USE_TMP
|
#endif /* USE_TMP */
|
||||||
|
|
||||||
#ifdef PEEPHOLE
|
#ifdef PEEPHOLE
|
||||||
#undef REGCOUNT
|
#undef REGCOUNT
|
||||||
|
@ -48,7 +48,7 @@ LocalInit()
|
||||||
{
|
{
|
||||||
#ifdef USE_TMP
|
#ifdef USE_TMP
|
||||||
C_insertpart(loc_id = C_getid());
|
C_insertpart(loc_id = C_getid());
|
||||||
#endif USE_TMP
|
#endif /* USE_TMP */
|
||||||
}
|
}
|
||||||
|
|
||||||
arith
|
arith
|
||||||
|
@ -244,4 +244,4 @@ AddrLocal(off)
|
||||||
if (p) p->t_regtype = -1;
|
if (p) p->t_regtype = -1;
|
||||||
C_lal(off);
|
C_lal(off);
|
||||||
}
|
}
|
||||||
#endif LINT
|
#endif /* LINT */
|
||||||
|
|
Loading…
Reference in a new issue