git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@877
4a8a32a2-be11-0410-ad9d-
d568d2c75423
| SIGNED {
$$=newLink();
$$->class = SPECIFIER ;
| SIGNED {
$$=newLink();
$$->class = SPECIFIER ;
- SPEC_NOUN($$) = V_INT ;
SPEC_SIGNED($$) = 1 ;
}
| UNSIGNED {
$$=newLink();
$$->class = SPECIFIER ;
SPEC_SIGNED($$) = 1 ;
}
| UNSIGNED {
$$=newLink();
$$->class = SPECIFIER ;
- SPEC_NOUN($$) = V_INT ;
SPEC_USIGN($$) = 1 ;
}
| VOID {
SPEC_USIGN($$) = 1 ;
}
| VOID {
int i; /* index into the hash Table */
bucket *bp; /* temp bucket * */
int i; /* index into the hash Table */
bucket *bp; /* temp bucket * */
+ if (getenv("DEBUG_SANITY")) {
+ fprintf (stderr, "addSym: %s\n", sname);
+ }
/* Make sure sym is a symbol and not a structdef */
if (StructTab!=stab) checkTypeSanity(((symbol *)sym)->etype, sname);
/* Make sure sym is a symbol and not a structdef */
if (StructTab!=stab) checkTypeSanity(((symbol *)sym)->etype, sname);
- //printf ("sanity check skipped for %s\n", name);
+ if (getenv("DEBUG_SANITY")) {
+ printf ("sanity check skipped for %s\n", name);
+ }
return;
}
noun=nounName(dest);
return;
}
noun=nounName(dest);
- //printf ("checking sanity for %s\n", name);
+ if (getenv("DEBUG_SANITY")) {
+ printf ("checking sanity for %s\n", name);
+ }
if ((SPEC_NOUN(dest)==V_CHAR ||
SPEC_NOUN(dest)==V_FLOAT ||
if ((SPEC_NOUN(dest)==V_CHAR ||
SPEC_NOUN(dest)==V_FLOAT ||
// signed or unsigned for float double or void
werror (E_SIGNED_OR_UNSIGNED_INVALID, noun, name);
}
// signed or unsigned for float double or void
werror (E_SIGNED_OR_UNSIGNED_INVALID, noun, name);
}
+
+ if (!SPEC_NOUN(dest)) {
+ if (SPEC_SIGNED(dest) || SPEC_USIGN(dest)) {
+ SPEC_NOUN(dest)=V_INT;
+ }
+ }
+
if (SPEC_SIGNED(dest) && SPEC_USIGN(dest)) {
// signed AND unsigned
werror (E_SIGNED_AND_UNSIGNED_INVALID, noun, name);
if (SPEC_SIGNED(dest) && SPEC_USIGN(dest)) {
// signed AND unsigned
werror (E_SIGNED_AND_UNSIGNED_INVALID, noun, name);
/* we shouldn't redeclare the type */
if ((SPEC_NOUN (dest) && SPEC_NOUN (src)) &&
(SPEC_NOUN(dest) != SPEC_NOUN(src))) {
/* we shouldn't redeclare the type */
if ((SPEC_NOUN (dest) && SPEC_NOUN (src)) &&
(SPEC_NOUN(dest) != SPEC_NOUN(src))) {
+ if (getenv("DEBUG_SANITY")) {
+ fprintf (stderr, "mergeSpec: ");
+ }
werror(E_TWO_OR_MORE_DATA_TYPES, yylval.yychar);
}
werror(E_TWO_OR_MORE_DATA_TYPES, yylval.yychar);
}