* device/include/mcs51/P89c51RD2.h,
[fw/sdcc] / src / SDCC.y
index a5a0f32994af2952e10d8afc223b5baf109d6383..aae308d1e4db81a653b71fc7b79c9922d7565434 100644 (file)
@@ -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);