def.str
domacro.c
dumpidf.c
-em_lint.h
error.c
estack.str
eval.c
l_class.h
l_comment.h
l_comment.c
+l_em.h
l_ev_ord.c
l_lint.c
l_lint.h
HSRC = LLlex.h align.h arith.h assert.h atw.h class.h \
input.h interface.h label.h level.h mes.h sizes.h specials.h \
- file_info.h tokenname.h em_lint.h l_lint.h
+ file_info.h tokenname.h l_em.h l_lint.h
HFILES = $(HSRC) $(GHSRC) $(GHSTRSRC)
code.o: declar.h
code.o: decspecs.h
code.o: def.h
-code.o: em_lint.h
+code.o: l_em.h
code.o: expr.h
code.o: file_info.h
code.o: idf.h
error.o: arith.h
error.o: debug.h
error.o: def.h
-error.o: em_lint.h
+error.o: l_em.h
error.o: errout.h
error.o: expr.h
error.o: file_info.h
stack.o: botch_free.h
stack.o: debug.h
stack.o: def.h
-stack.o: em_lint.h
+stack.o: l_em.h
stack.o: idf.h
stack.o: level.h
stack.o: lint.h
switch.o: code.h
switch.o: debug.h
switch.o: density.h
-switch.o: em_lint.h
+switch.o: l_em.h
switch.o: expr.h
switch.o: idf.h
switch.o: label.h
util.o: Lpars.h
util.o: align.h
util.o: def.h
-util.o: em_lint.h
+util.o: l_em.h
util.o: lint.h
util.o: nocross.h
util.o: nofloat.h
statement.o: code.h
statement.o: debug.h
statement.o: def.h
-statement.o: em_lint.h
+statement.o: l_em.h
statement.o: expr.h
statement.o: file_info.h
statement.o: idf.h
ival.o: assert.h
ival.o: debug.h
ival.o: def.h
-ival.o: em_lint.h
+ival.o: l_em.h
ival.o: estack.h
ival.o: expr.h
ival.o: field.h
#ifndef LINT
#include <em.h>
#else
-#include "em_lint.h"
+#include "l_em.h"
#include "l_lint.h"
#endif LINT
#include "botch_free.h"
#ifndef LINT
#include <em.h>
#else
-#include "em_lint.h"
+#include "l_em.h"
#endif LINT
#include "nopp.h"
#endif
#ifdef LINT
- if ( def && def->df_level < lvl
- && !( lvl == L_FORMAL2
- || def->df_level == L_UNIVERSAL
- || sc == GLOBAL
- || sc == EXTERN
- )
- ) {
- /* there is already a definition for this non-extern name
- on a more global level
- */
- warning("%s is already defined as a %s",
- idf->id_text,
- def->df_level == L_GLOBAL ? "global" :
- def->df_level == L_FORMAL2 ? "formal" :
- "more global local"
- );
- }
+ check_hiding(idf, lvl, sc); /* of some idf by this idf */
#endif LINT
if (def &&
error("cannot redeclare %s to static",
idf->id_text);
else {
-#ifdef LINT /* warn unconditionally */
+#ifdef LINT
+ /* warn unconditionally */
warning("%s redeclared to static",
idf->id_text);
#else LINT
#ifndef LINT
#include <em.h>
#else
-#include "em_lint.h"
+#include "l_em.h"
#include "l_lint.h"
#endif LINT
#include "debug.h"
--- /dev/null
+/*
+ * (c) copyright 1990 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
+/* $Header$ */
+
+/*
+ * This file can be considered the em_code.h file of lint.
+ * Those code generating functions that are used by cem and that have not
+ * been defined away by #ifdef LINT, are defined away here. Note that this a
+ * fairly random collection. E.g. it does not include C_open(), since the
+ * standard C-open() C_close() sequence is protected by #ifdef LINT, but it
+ * does include C_close() since the latter is also called in other places,
+ * to terminate the compilation process.
+ */
+
+#define store_block(sz, al)
+#define load_block(sz, al)
+
+#define C_asp(c)
+#define C_bra(b)
+#define C_cal(p)
+#define C_csa(w)
+#define C_csb(w)
+#define C_fil_dlb(g,o)
+#define C_lae_dlb(g,o)
+#define C_lal(c)
+#define C_lin(c)
+#define C_loi(c)
+#define C_lol(c)
+#define C_sdl(c)
+#define C_sti(c)
+#define C_stl(c)
+
+#define C_busy() 0
+#define C_close()
+
+#define C_df_dlb(l)
+#define C_df_dnam(s)
+#define C_df_ilb(l)
+
+#define C_pro_narg(s)
+#define C_end(l)
+
+#define C_exa_dnam(s)
+#define C_ina_dnam(s)
+#define C_ina_dlb(l)
+#define C_exp(s)
+#define C_inp(s)
+
+#define C_bss_cst(n,w,i)
+
+#define C_con_cst(v)
+#define C_con_icon(v,s)
+#define C_con_ucon(v,s)
+#define C_con_fcon(v,s)
+#define C_con_scon(v,s)
+#define C_con_dnam(v,s)
+#define C_con_dlb(v,s)
+#define C_con_pnam(v)
+
+#define C_rom_cst(v)
+#define C_rom_icon(v,s)
+#define C_rom_scon(v,s)
+#define C_rom_ilb(v)
+
+#define C_ldl(l)
+
+#define C_mes_begin(ms)
+#define C_mes_end()
+
+#define C_ms_gto()
+#define C_ms_par(b)
+#define C_ms_reg(o,s,t,c)
+
#include <alloc.h> /* for st_free */
#include "interface.h"
#include "assert.h"
+#ifdef ANSI
+#include <flt_arith.h>
+#endif ANSI
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
#include "stack.h"
#include "type.h"
#include "level.h"
-#include "nofloat.h"
#include "l_lint.h"
#include "l_state.h"
#include "debug.h"
#include "interface.h"
#include "assert.h"
+#ifdef ANSI
+#include <flt_arith.h>
+#endif ANSI
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
#include "stack.h"
#include "type.h"
#include "level.h"
-#include "nofloat.h"
#include "l_lint.h"
#include "l_state.h"
#include "l_outdef.h"
#include <alloc.h> /* for st_free */
#include "interface.h"
+#ifdef ANSI
+#include <flt_arith.h>
+#endif ANSI
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
#include "stack.h"
#include "type.h"
#include "level.h"
-#include "nofloat.h"
#include "l_state.h"
extern char *symbol2str();
PRIVATE lint_conversion();
PRIVATE int numsize();
+check_hiding(idf, lvl, sc)
+ struct idf *idf;
+ int lvl;
+ int sc;
+{
+ /* Checks if there is already a definition for this non-extern
+ name on a more global level.
+ */
+ struct def *def = idf->id_def;
+
+ if ( def && def->df_level < lvl
+ && ! ( lvl == L_FORMAL2
+ || def->df_level == L_UNIVERSAL
+ || sc == GLOBAL
+ || sc == EXTERN
+ )
+ ) {
+ warning("%s is already defined as a %s",
+ idf->id_text,
+ def->df_level == L_GLOBAL ? "global" :
+ def->df_level == L_FORMAL2 ? "formal" :
+ "more global local"
+ );
+ }
+}
+
lint_new_oper(expr)
struct expr *expr;
{
#include <alloc.h>
#include "interface.h"
+#ifdef ANSI
+#include <flt_arith.h>
+#endif ANSI
#include "arith.h"
#include "assert.h"
#include "type.h"
+#include "declar.h"
+#include "decspecs.h"
#include "LLlex.h"
#include "Lpars.h"
#include "stack.h"
PRIVATE outarg();
PRIVATE outargstring();
PRIVATE outargtype();
-PRIVATE implicit_func_decl();
PRIVATE fill_arg();
lint_declare_idf(idf, sc)
}
}
+lint_non_function_decl(ds, dc)
+ struct decspecs *ds;
+ struct declarator *dc;
+{
+ register struct def *def = dc->dc_idf->id_def;
+ register int is_function = def->df_type->tp_fund == FUNCTION;
+
+ if (is_function)
+ def2decl(ds->ds_sc);
+ if (def->df_sc != TYPEDEF)
+ outdef();
+}
+
lint_ext_def(idf, sc)
struct idf *idf;
{
}
}
+#ifdef IMPLICIT
PRIVATE
implicit_func_decl(idf, file, line)
struct idf *idf;
output_def(&od);
/* The other fields are not used for this class. */
}
+#endif IMPLICIT
fill_outcall(ex, used)
struct expr *ex;
register struct idf *idf = ex->OP_LEFT->VL_IDF;
register struct def *def = idf->id_def;
+#ifdef IMPLICIT
if (def->df_sc == IMPLICIT && !idf->id_def->df_used) {
/* IFDC, first time */
implicit_func_decl(idf, ex->ex_file, ex->ex_line);
}
+#endif IMPLICIT
OutCall.od_type = def->df_type->tp_up;
OutCall.od_statnr = (def->df_sc == STATIC ? stat_number : 0);
#include "interface.h"
#include "assert.h"
#include "debug.h"
+#ifdef ANSI
+#include <flt_arith.h>
+#endif ANSI
#include "arith.h"
#include "label.h"
#include "expr.h"
#include "stack.h"
#include "type.h"
#include "level.h"
-#include "nofloat.h"
#include "l_lint.h"
#include "l_brace.h"
#include "l_state.h"
case STATIC:
case EXTERN:
case GLOBAL:
+#ifdef IMPLICIT
case IMPLICIT:
+#endif IMPLICIT
if (fund == ERRONEOUS)
break;
]
{
#ifdef LINT
- if (dc->dc_idf->id_def->df_type->tp_fund == FUNCTION)
- def2decl(ds->ds_sc);
- if (dc->dc_idf->id_def->df_sc != TYPEDEF)
- outdef();
+ lint_non_function_decl(ds, dc);
#endif LINT
}
[
#ifndef LINT
#include <em.h>
#else
-#include "em_lint.h"
+#include "l_em.h"
#endif LINT
#include "debug.h"
#include "botch_free.h"
#ifndef LINT
#include <em.h>
#else
-#include "em_lint.h"
+#include "l_em.h"
#include "l_lint.h"
#endif LINT
#ifndef LINT
#include <em.h>
#else
-#include "em_lint.h"
+#include "l_em.h"
#endif LINT
#include "debug.h"
#include "botch_free.h"
#ifndef LINT
#include <em.h>
#else
-#include "em_lint.h"
+#include "l_em.h"
#endif LINT
#include <em_arith.h>
#include <em_reg.h>