projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Applied patch #2762516
[fw/sdcc]
/
src
/
SDCC.y
diff --git
a/src/SDCC.y
b/src/SDCC.y
index 1196d705c150e0ba8aa2d3ccccfaf5e34f132d2c..fa165cef8a7241af3357d437e5b64218ae986435 100644
(file)
--- a/
src/SDCC.y
+++ b/
src/SDCC.y
@@
-198,7
+198,7
@@
function_attribute
function_attributes
: USING constant_expr {
$$ = newLink(SPECIFIER) ;
function_attributes
: USING constant_expr {
$$ = newLink(SPECIFIER) ;
- FUNC_REGBANK($$) = (int)
float
FromVal(constExprValue($2,TRUE));
+ FUNC_REGBANK($$) = (int)
ul
FromVal(constExprValue($2,TRUE));
}
| REENTRANT { $$ = newLink (SPECIFIER);
FUNC_ISREENT($$)=1;
}
| REENTRANT { $$ = newLink (SPECIFIER);
FUNC_ISREENT($$)=1;
@@
-521,7
+521,7
@@
declaration_specifiers
$$ = mergeSpec($1,$2, "type_specifier declaration_specifiers");
}
| function_specifier { $$ = $1; }
$$ = mergeSpec($1,$2, "type_specifier declaration_specifiers");
}
| function_specifier { $$ = $1; }
- | function_specifier declaration_specifiers {
+ | function_specifier declaration_specifiers {
/* if the decl $2 is not a specifier */
/* find the spec and replace it */
if ( !IS_SPEC($2)) {
/* if the decl $2 is not a specifier */
/* find the spec and replace it */
if ( !IS_SPEC($2)) {
@@
-580,7
+580,7
@@
function_specifier
Interrupt_storage
: INTERRUPT { $$ = INTNO_UNSPEC ; }
| INTERRUPT constant_expr
Interrupt_storage
: INTERRUPT { $$ = INTNO_UNSPEC ; }
| INTERRUPT constant_expr
- { int intno = (int)
float
FromVal(constExprValue($2,TRUE));
+ { int intno = (int)
ul
FromVal(constExprValue($2,TRUE));
if ((intno >= 0) && (intno <= INTNO_MAX))
$$ = intno;
else
if ((intno >= 0) && (intno <= INTNO_MAX))
$$ = intno;
else
@@
-598,7
+598,7
@@
type_specifier
/* add this to the storage class specifier */
SPEC_ABSA($1) = 1; /* set the absolute addr flag */
/* now get the abs addr from value */
/* add this to the storage class specifier */
SPEC_ABSA($1) = 1; /* set the absolute addr flag */
/* now get the abs addr from value */
- SPEC_ADDR($1) = (unsigned
) float
FromVal(constExprValue($3,TRUE)) ;
+ SPEC_ADDR($1) = (unsigned
int) ul
FromVal(constExprValue($3,TRUE)) ;
}
;
}
;
@@
-709,7
+709,7
@@
type_specifier2
symbol *sym;
sym_link *p ;
sym = findSym(TypedefTab,NULL,$1) ;
symbol *sym;
sym_link *p ;
sym = findSym(TypedefTab,NULL,$1) ;
- $$ = p = copyLinkChain(sym
->type
);
+ $$ = p = copyLinkChain(sym
? sym->type : NULL
);
SPEC_TYPEDEF(getSpec(p)) = 0;
ignoreTypedefType = 1;
}
SPEC_TYPEDEF(getSpec(p)) = 0;
ignoreTypedefType = 1;
}
@@
-918,7
+918,7
@@
struct_declarator
| ':' constant_expr {
unsigned int bitsize;
$$ = newSymbol (genSymName(NestLevel),NestLevel) ;
| ':' constant_expr {
unsigned int bitsize;
$$ = newSymbol (genSymName(NestLevel),NestLevel) ;
- bitsize
= (unsigned int) float
FromVal(constExprValue($2,TRUE));
+ bitsize
= (unsigned int) ul
FromVal(constExprValue($2,TRUE));
if (bitsize > (port->s.int_size * 8)) {
bitsize = port->s.int_size * 8;
werror(E_BITFLD_SIZE, bitsize);
if (bitsize > (port->s.int_size * 8)) {
bitsize = port->s.int_size * 8;
werror(E_BITFLD_SIZE, bitsize);
@@
-926,11
+926,12
@@
struct_declarator
if (!bitsize)
bitsize = BITVAR_PAD;
$$->bitVar = bitsize;
if (!bitsize)
bitsize = BITVAR_PAD;
$$->bitVar = bitsize;
+ $$->bitUnnamed = 1;
}
| declarator ':' constant_expr
{
unsigned int bitsize;
}
| declarator ':' constant_expr
{
unsigned int bitsize;
- bitsize
= (unsigned int) float
FromVal(constExprValue($3,TRUE));
+ bitsize
= (unsigned int) ul
FromVal(constExprValue($3,TRUE));
if (bitsize > (port->s.int_size * 8)) {
bitsize = port->s.int_size * 8;
werror(E_BITFLD_SIZE, bitsize);
if (bitsize > (port->s.int_size * 8)) {
bitsize = port->s.int_size * 8;
werror(E_BITFLD_SIZE, bitsize);
@@
-1028,7
+1029,7
@@
opt_assign_expr
{
werror(E_ENUM_NON_INTEGER);
SNPRINTF(lbuff, sizeof(lbuff),
{
werror(E_ENUM_NON_INTEGER);
SNPRINTF(lbuff, sizeof(lbuff),
- "%d",
(int) float
FromVal(val));
+ "%d",
(int) ul
FromVal(val));
val = constVal(lbuff);
}
$$ = cenum = val ;
val = constVal(lbuff);
}
$$ = cenum = val ;
@@
-1036,11
+1037,11
@@
opt_assign_expr
| {
if (cenum) {
SNPRINTF(lbuff, sizeof(lbuff),
| {
if (cenum) {
SNPRINTF(lbuff, sizeof(lbuff),
- "%d",
(int) float
FromVal(cenum)+1);
+ "%d",
(int) ul
FromVal(cenum)+1);
$$ = cenum = constVal(lbuff);
}
else {
$$ = cenum = constVal(lbuff);
}
else {
- $$ = cenum = const
Val("0"
);
+ $$ = cenum = const
CharVal(0
);
}
}
;
}
}
;
@@
-1133,7
+1134,7
@@
declarator2
}
else
{
}
else
{
- if ((size = (int)
float
FromVal(tval)) < 0)
+ if ((size = (int)
ul
FromVal(tval)) < 0)
{
werror(E_NEGATIVE_ARRAY_SIZE, $1->name);
size = 1;
{
werror(E_NEGATIVE_ARRAY_SIZE, $1->name);
size = 1;
@@
-1203,7
+1204,7
@@
pointer
}
| unqualified_pointer type_specifier_list pointer
{
}
| unqualified_pointer type_specifier_list pointer
{
- $$ = $1 ;
+ $$ = $1 ;
if (IS_SPEC($2) && DCL_TYPE($3) == UPOINTER) {
DCL_PTR_CONST($1) = SPEC_CONST($2);
DCL_PTR_VOLATILE($1) = SPEC_VOLATILE($2);
if (IS_SPEC($2) && DCL_TYPE($3) == UPOINTER) {
DCL_PTR_CONST($1) = SPEC_CONST($2);
DCL_PTR_VOLATILE($1) = SPEC_VOLATILE($2);
@@
-1228,12
+1229,12
@@
pointer
DCL_TYPE($3) = EEPPOINTER;
break;
default:
DCL_TYPE($3) = EEPPOINTER;
break;
default:
- // this could be just "constant"
+ // this could be just "constant"
// werror(W_PTR_TYPE_INVALID);
;
}
}
// werror(W_PTR_TYPE_INVALID);
;
}
}
- else
+ else
werror (W_PTR_TYPE_INVALID);
$$->next = $3 ;
}
werror (W_PTR_TYPE_INVALID);
$$->next = $3 ;
}
@@
-1349,7
+1350,7
@@
abstract_declarator2
value *val ;
$$ = newLink (DECLARATOR);
DCL_TYPE($$) = ARRAY ;
value *val ;
$$ = newLink (DECLARATOR);
DCL_TYPE($$) = ARRAY ;
- DCL_ELEM($$) = (int)
float
FromVal(val = constExprValue($2,TRUE));
+ DCL_ELEM($$) = (int)
ul
FromVal(val = constExprValue($2,TRUE));
}
| abstract_declarator2 '[' ']' {
$$ = newLink (DECLARATOR);
}
| abstract_declarator2 '[' ']' {
$$ = newLink (DECLARATOR);
@@
-1362,7
+1363,7
@@
abstract_declarator2
value *val ;
$$ = newLink (DECLARATOR);
DCL_TYPE($$) = ARRAY ;
value *val ;
$$ = newLink (DECLARATOR);
DCL_TYPE($$) = ARRAY ;
- DCL_ELEM($$) = (int)
float
FromVal(val = constExprValue($3,TRUE));
+ DCL_ELEM($$) = (int)
ul
FromVal(val = constExprValue($3,TRUE));
$$->next = $1 ;
}
| '(' ')' { $$ = NULL;}
$$->next = $1 ;
}
| '(' ')' { $$ = NULL;}
@@
-1550,6
+1551,8
@@
selection_statement
{
noLineno++ ;
$$ = createIf ($3, $6, $7 );
{
noLineno++ ;
$$ = createIf ($3, $6, $7 );
+ $$->lineno = $3->lineno;
+ $$->filename = $3->filename;
noLineno--;
}
| SWITCH '(' expr ')' {
noLineno--;
}
| SWITCH '(' expr ')' {
@@
-1630,7
+1633,8
@@
iteration_statement
noLineno++ ;
$$ = createWhile ( $1, STACK_POP(continueStack),
STACK_POP(breakStack), $3, $6 );
noLineno++ ;
$$ = createWhile ( $1, STACK_POP(continueStack),
STACK_POP(breakStack), $3, $6 );
- $$->lineno = $1->lineDef ;
+ $$->lineno = $1->lineDef;
+ $$->filename = $1->fileDef;
noLineno-- ;
}
| do statement WHILE '(' expr ')' ';'
noLineno-- ;
}
| do statement WHILE '(' expr ')' ';'
@@
-1639,7
+1643,8
@@
iteration_statement
noLineno++ ;
$$ = createDo ( $1 , STACK_POP(continueStack),
STACK_POP(breakStack), $5, $2);
noLineno++ ;
$$ = createDo ( $1 , STACK_POP(continueStack),
STACK_POP(breakStack), $5, $2);
- $$->lineno = $1->lineDef ;
+ $$->lineno = $1->lineDef;
+ $$->filename = $1->fileDef;
noLineno-- ;
}
| for '(' expr_opt ';' expr_opt ';' expr_opt ')' statement
noLineno-- ;
}
| for '(' expr_opt ';' expr_opt ';' expr_opt ')' statement