Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/01/06 15:24
Read: times


 
#115297 - ansi incompatabilities
Responding to: ???'s previous message
Deviations from the compliance:

* functions are not always reentrant.
* 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, e.g.:

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

* 'long long' (64 bit integers) not supported.
* 'double' precision floating point not supported.
* No support for setjmp and longjmp (for now).
* 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 but not valid in SDCC */
{
...
}

* 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()' */



List of 22 messages in thread
TopicAuthorDate
SDCC and Keil C compatibility            01/01/70 00:00      
   major differences            01/01/70 00:00      
   ansi incompatabilities            01/01/70 00:00      
   SDCC vs keil            01/01/70 00:00      
      other way round :)            01/01/70 00:00      
   SDCC vs Keil Part 2            01/01/70 00:00      
      actualy            01/01/70 00:00      
         thanks            01/01/70 00:00      
            sfr declarations NOT compatible            01/01/70 00:00      
               too bad            01/01/70 00:00      
                  Perhaps it is?            01/01/70 00:00      
                     indeed            01/01/70 00:00      
                     it almost is            01/01/70 00:00      
               the root of many evils            01/01/70 00:00      
   Another important difference!            01/01/70 00:00      
   fast & efficient code            01/01/70 00:00      
   Problem with porting code            01/01/70 00:00      
      bla bla            01/01/70 00:00      
      semicolon missing            01/01/70 00:00      
      set TI=1 in your init_uart()            01/01/70 00:00      
      Have you looked at this?            01/01/70 00:00      
      General Tip: Disable all extensions            01/01/70 00:00      

Back to Subject List