Next Previous Contents

23. ANSI-Compliance.

Deviations from the compliancy.

  1. functions are not always reentrant.
  2. structures cannot be assigned values directly, cannot be passed as function parameters or assigned to each other and cannot be a return value from a function.
    eg
      
    

struct s { ... }; 
struct s s1, s2; 
foo() 
{ 
... 
s1 =
 s2 ; /* is invalid in SDCC although allowed in ANSI */ 
... 
}struct s foo1 (struct s parms) /* is invalid in SDCC although allowed in
 ANSI */ 
{ 
struct s rets; 
... 
return rets;/* is invalid in SDCC although
 allowed in ANSI */ 
}
 

  1. 'long long' (64 bit integers) not supported.
  2. 'double' precision floating point not supported.
  3. integral promotions are suppressed. What does this mean ? The compiler will not implicitly promote an integer expression to a higher order integer, exception is an assignment or parameter passing.
  4. No support for setjmp and longjmp (for now).
  5. Old K&R style function declarations are NOT allowed.

foo( i,j) /* this old style of function declarations */ 
int i,j; /* are
 valid in ANSI .. not valid in SDCC */ 
{ 
... 
}
 

  1. functions declared as pointers must be dereferenced during the call.
    int (*foo)();
      
    

   ... 
   /* has to be called like this */ 
   (*foo)();/* ansi standard
 allows calls to be made like 'foo()' */
 

Next Previous Contents