declar.str
declarator.c
decspecs.c
-decspecs.str
+decspecs.h
def.str
domacro.c
dumpidf.c
# The Sun-3 version is faster when the text-size exceeds 180K! ARRGH
EXTRA_O =
-STRSRC = code.str declar.str decspecs.str def.str expr.str field.str \
+STRSRC = code.str declar.str def.str expr.str field.str \
estack.str util.str proto.str replace.str \
idf.str macro.str stack.str stmt.str struct.str switch.str type.str \
l_brace.str l_state.str l_outdef.str
# generated source files
-GHSTRSRC = code.h declar.h decspecs.h def.h expr.h field.h \
+GHSTRSRC = code.h declar.h def.h expr.h field.h \
estack.h util.h proto.h replace.h \
idf.h macro.h stack.h stmt.h struct.h switch.h type.h \
l_brace.h l_state.h l_outdef.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 l_em.h l_lint.h
+ file_info.h tokenname.h l_em.h l_lint.h decspecs.h
HFILES = $(HSRC) $(GHSRC) $(GHSTRSRC)
code.h: make.allocd
declar.h: make.allocd
-decspecs.h: make.allocd
def.h: make.allocd
expr.h: make.allocd
field.h: make.allocd
/* global function info */
char *func_name;
struct type *func_type;
+#ifdef LINT
int func_notypegiven;
+#endif
#ifdef USE_TMP
static int tmp_id;
else {
func_type = def->df_type->tp_up;
}
+#ifdef LINT
func_notypegiven = ds->ds_notypegiven;
+#endif
func_size = ATW(func_type->tp_size);
sp_occurred[SP_SETJMP] = 0;
ASSERT(level != L_FORMAL1);
- /*
- if (ds->ds_notypegiven && !ds->ds_sc_given)
- strict("data definition lacking type or storage class");
- */
-
if ( level == L_GLOBAL &&
(ds->ds_sc == AUTO || ds->ds_sc == REGISTER)
) {
--- /dev/null
+/*
+ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
+ * See the copyright notice in the ACK home directory, in the file "Copyright".
+ */
+/* $Header$ */
+/* DECLARATION SPECIFIER DEFINITION */
+
+struct decspecs {
+ struct decspecs *next;
+ struct type *ds_type; /* single type */
+ int ds_notypegiven; /* set if type not given explicitly */
+ int ds_typedef; /* 1 if type was a user typedef */
+ int ds_sc_given; /* 1 if the st. class is explicitly given */
+ int ds_sc; /* storage class, given or implied */
+ int ds_size; /* LONG, SHORT or 0 */
+ int ds_unsigned; /* SIGNED, UNSIGNED or 0 */
+ int ds_typequal; /* type qualifiers - see type.str */
+};
+
+extern struct type *qualifier_type();
+extern struct decspecs null_decspecs;
}
[ %if (DOT != IDENTIFIER || AHEAD == IDENTIFIER)
decl_specifiers(&Ds)
- [
- declarator(&Dc)
- {
- declare_idf(&Ds, &Dc, level);
-#ifdef LINT
- lint_ext_def(Dc.dc_idf, Ds.ds_sc);
-#endif LINT
- }
- [
- function(&Ds, &Dc)
- |
- non_function(&Ds, &Dc)
- ]
- |
- ';'
- ]
|
{do_decspecs(&Ds);}
+ ]
+ [
declarator(&Dc)
{
declare_idf(&Ds, &Dc, level);
lint_ext_def(Dc.dc_idf, Ds.ds_sc);
#endif LINT
}
- function(&Ds, &Dc)
+ [
+ function(&Ds, &Dc)
+ |
+ { if (! Ds.ds_sc_given && Ds.ds_notypegiven) {
+ strict("declaration specifiers missing");
+ }
+ }
+ non_function(&Ds, &Dc)
+ ]
+ |
+ { if (! Ds.ds_sc_given && Ds.ds_notypegiven) {
+ strict("declaration missing");
+ }
+ }
+ ';'
]
{remove_declarator(&Dc); flush_strings(); }
;