fixed type of sizeof (decreases size!)
fixed bug with typedef of function with block scope
This commit is contained in:
parent
96d5009bef
commit
8a00e32bc8
5 changed files with 10 additions and 29 deletions
|
@ -85,6 +85,8 @@ suppress warning messages.
|
||||||
suppress stricts.
|
suppress stricts.
|
||||||
.IP \fB\-a\fR
|
.IP \fB\-a\fR
|
||||||
suppress warnings and stricts.
|
suppress warnings and stricts.
|
||||||
|
.IP \fB\-o\fR
|
||||||
|
suppress warnings and stricts about old-style.
|
||||||
.IP \fB\-\-\fItext\fR
|
.IP \fB\-\-\fItext\fR
|
||||||
.br
|
.br
|
||||||
where \fItext\fR can be either of the above or
|
where \fItext\fR can be either of the above or
|
||||||
|
|
|
@ -294,39 +294,17 @@ fill_int_expr(ex, ivalue, fund)
|
||||||
case INT:
|
case INT:
|
||||||
ex->ex_type = int_type;
|
ex->ex_type = int_type;
|
||||||
break;
|
break;
|
||||||
case INTEGER:
|
case UNSIGNED:
|
||||||
if (ivalue >= 0 && ivalue <= max_int) {
|
ex->ex_type = uint_type;
|
||||||
ex->ex_type = int_type;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
/*FALL THROUGH*/
|
|
||||||
case LONG:
|
case LONG:
|
||||||
ex->ex_type =
|
ex->ex_type = long_type;
|
||||||
(ivalue & (1L << (8*long_size - 1))) ? ulong_type
|
|
||||||
: long_type;
|
|
||||||
break;
|
break;
|
||||||
case ULONG:
|
case ULONG:
|
||||||
ex->ex_type = ulong_type;
|
ex->ex_type = ulong_type;
|
||||||
break;
|
break;
|
||||||
case UNSIGNED:
|
|
||||||
/* We cannot make a test like
|
|
||||||
ivalue <= max_unsigned
|
|
||||||
because, if
|
|
||||||
sizeof(arith) == int_size
|
|
||||||
holds, max_unsigned may be a negative arith in
|
|
||||||
which case the comparison results in an unexpected
|
|
||||||
answer.
|
|
||||||
*/
|
|
||||||
ex->ex_type =
|
|
||||||
(ivalue & ~max_int) ?
|
|
||||||
( (ivalue & ~max_unsigned) ?
|
|
||||||
( ivalue & (1L<<(8*long_size-1)) ?
|
|
||||||
ulong_type : long_type
|
|
||||||
) : uint_type
|
|
||||||
) : int_type;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
crash("(intexpr) bad fund %s\n", symbol2str(fund));
|
crash("(fill_int_expr) bad fund %s\n", symbol2str(fund));
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
ex->ex_class = Value;
|
ex->ex_class = Value;
|
||||||
|
|
|
@ -250,7 +250,7 @@ declare_idf(ds, dc, lvl)
|
||||||
if (lvl != L_GLOBAL) { /* 3.5.1 */
|
if (lvl != L_GLOBAL) { /* 3.5.1 */
|
||||||
if (sc == 0)
|
if (sc == 0)
|
||||||
sc = GLOBAL;
|
sc = GLOBAL;
|
||||||
else if (sc != EXTERN) {
|
else if (sc != EXTERN && sc != TYPEDEF) {
|
||||||
error("illegal storage class %s for function with block-scope"
|
error("illegal storage class %s for function with block-scope"
|
||||||
, symbol2str(sc));
|
, symbol2str(sc));
|
||||||
ds->ds_sc = sc = EXTERN;
|
ds->ds_sc = sc = EXTERN;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
cat <<'--EOT--'
|
cat <<'--EOT--'
|
||||||
/* Generated by make.tokfile */
|
/* Generated by make.tokfile */
|
||||||
/* $Header: */
|
/* $Header$ */
|
||||||
--EOT--
|
--EOT--
|
||||||
|
|
||||||
sed '
|
sed '
|
||||||
|
|
|
@ -12,6 +12,7 @@ m generate file.o: file1.h format dependency lines
|
||||||
M set identifier length
|
M set identifier length
|
||||||
n don't generate register messages
|
n don't generate register messages
|
||||||
L don't generate linenumbers and filename indications
|
L don't generate linenumbers and filename indications
|
||||||
|
o no warnings or stricts about normal old-style constuctions
|
||||||
p trace
|
p trace
|
||||||
P in running the preprocessor do not output '# line' lines
|
P in running the preprocessor do not output '# line' lines
|
||||||
R restricted C
|
R restricted C
|
||||||
|
|
Loading…
Add table
Reference in a new issue