X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCC.y;h=aae308d1e4db81a653b71fc7b79c9922d7565434;hb=3c6609328d3c2c966f983c6791c18a6e11590b90;hp=a5a0f32994af2952e10d8afc223b5baf109d6383;hpb=a8b6b80ff9fcad4aba5bb339e95db62f75f9eb61;p=fw%2Fsdcc diff --git a/src/SDCC.y b/src/SDCC.y index a5a0f329..aae308d1 100644 --- a/src/SDCC.y +++ b/src/SDCC.y @@ -186,9 +186,9 @@ function_attribute ; function_attributes - : USING CONSTANT { + : USING constant_expr { $$ = newLink(SPECIFIER) ; - FUNC_REGBANK($$) = (int) floatFromVal($2); + FUNC_REGBANK($$) = (int) floatFromVal(constExprValue($2,TRUE)); } | REENTRANT { $$ = newLink (SPECIFIER); FUNC_ISREENT($$)=1; @@ -578,8 +578,8 @@ storage_class_specifier Interrupt_storage : INTERRUPT { $$ = INTNO_UNSPEC ; } - | INTERRUPT CONSTANT - { int intno = (int) floatFromVal($2); + | INTERRUPT constant_expr + { int intno = (int) floatFromVal(constExprValue($2,TRUE)); if ((intno >= 0) && (intno <= INTNO_MAX)) $$ = intno; else @@ -909,9 +909,9 @@ struct_declarator_list struct_declarator : declarator | ':' constant_expr { - int bitsize; + unsigned int bitsize; $$ = newSymbol (genSymName(NestLevel),NestLevel) ; - bitsize= (int) floatFromVal(constExprValue($2,TRUE)); + bitsize= (unsigned int) floatFromVal(constExprValue($2,TRUE)); if (bitsize > (port->s.int_size * 8)) { bitsize = port->s.int_size * 8; werror(E_BITFLD_SIZE, bitsize); @@ -922,8 +922,8 @@ struct_declarator } | declarator ':' constant_expr { - int bitsize; - bitsize= (int) floatFromVal(constExprValue($3,TRUE)); + unsigned int bitsize; + bitsize= (unsigned int) floatFromVal(constExprValue($3,TRUE)); if (bitsize > (port->s.int_size * 8)) { bitsize = port->s.int_size * 8; werror(E_BITFLD_SIZE, bitsize);