Difference between revisions of "Standard compliance"

From SDCC wiki
Jump to: navigation, search
(ISO C99)
m (ISO C11: Implemented generic selection)
 
(8 intermediate revisions by one user not shown)
Line 5: Line 5:
 
* Data type double.
 
* Data type double.
 
* Structures and unions can not be assigned, passed as function parameters or return values.
 
* Structures and unions can not be assigned, passed as function parameters or return values.
* Diagnosis for qualifiers occuring multiple times in qualifier-specifier lists (sdcc always behaves according to the C99 standard in this respect).
+
* K & R style function declarations.
  
 
Not yet implemented in some ports:
 
Not yet implemented in some ports:
Line 29: Line 29:
 
* Compound literals.
 
* Compound literals.
 
* Variable-length arrays.
 
* Variable-length arrays.
* Integer constants and modulo for long long, unsigned long long, int_fast64_t, int_least64_t, int64_t, uint_fast64_t, uint_least64_t, uint64_t.
+
* Integer constants for long long, unsigned long long, int_fast64_t, int_least64_t, int64_t, uint_fast64_t, uint_least64_t, uint64_t.
* Float classification macros in math.h.
+
  
 
Not yet implemented in some ports:
 
Not yet implemented in some ports:
Line 45: Line 44:
 
* Intermingled declarations and code (variable declaration no longer restricted to file scope or the start of a compound statement (block)).
 
* Intermingled declarations and code (variable declaration no longer restricted to file scope or the start of a compound statement (block)).
 
* Compound literals.
 
* Compound literals.
* Integer constants and modulo for long long, unsigned long long, int_fast64_t, int_least64_t, int64_t, uint_fast64_t, uint_least64_t, uint64_t.
+
* Integer constants for long long, unsigned long long, int_fast64_t, int_least64_t, int64_t, uint_fast64_t, uint_least64_t, uint64_t.
* Float classification macros in math.h (C11 requires more than C99).
+
* _Alignas alignment specifier.
+
* Type-generic expressions.
+
 
* Improved Unicode support.
 
* Improved Unicode support.
* Static assertions.
 
  
 
Not yet implemented in some ports:
 
Not yet implemented in some ports:
Line 58: Line 53:
  
 
== Embedded C ==
 
== Embedded C ==
While sdcc supports some of this standard's features (e.g. fixed-point math on the pic port, named address spaces in the mcs51 port) it does so in a way inconsistent with the standard.
+
SDCC supports Embedded C named address spaces, both intrinsic (depending on the port) and user-defined.
Standard-compliant named address spaces are currently supported for bank-switching of data memory only.
+
The fixed-point math support in the pic ports is not standard-compliant.
 +
Other parts of the standard are not supported.

Latest revision as of 20:14, 12 August 2015

Contents

[edit] ISO C90 and ANSI C89

Use --std-c89 to compile in this mode.

Not yet implemented in sdcc:

  • Data type double.
  • Structures and unions can not be assigned, passed as function parameters or return values.
  • K & R style function declarations.

Not yet implemented in some ports:

  • Functions are not reentrant unless explicitly declared as such or --stack-auto is specified in the mcs51, hc08 and s08 ports.

[edit] ISO C95

Not yet implemented in sdcc:

  • Data type double.
  • Structures and unions can not be assigned, passed as function parameters or return values.
  • Diagnosis for qualifiers occuring multiple times in qualifier-specifier lists (sdcc always behaves according to the C99 standard in this respect).

Not yet implemented in some ports:

  • Functions are not reentrant unless explicitly declared as such or --stack-auto is specified in the mcs51, hc08 and s08 ports.

[edit] ISO C99

Use --std-c99 to compile in this mode.

Not yet implemented in sdcc:

  • Data type double, long double.
  • Structures and unions can not be assigned, passed as function parameters or return values.
  • Intermingled declarations and code (variable declaration no longer restricted to file scope or the start of a compound statement (block)).
  • Compound literals.
  • Variable-length arrays.
  • Integer constants for long long, unsigned long long, int_fast64_t, int_least64_t, int64_t, uint_fast64_t, uint_least64_t, uint64_t.

Not yet implemented in some ports:

  • Support for _Bool / bool is incomplete (no pointers to bool, or bool inside a struct) in the mcs51, ds390 and xa51 ports.
  • Functions are not reentrant unless explicitly declared as such or --stack-auto is specified in the mcs51, hc08 and s08 ports.
  • There is no support for data types long long, unsigned long long, int_fast64_t, int_least64_t, int64_t, uint_fast64_t, uint_least64_t, uint64_t in the mcs51, ds390, ds400, pic14, pic16 and xa51 ports.

[edit] ISO C11

Use --std-c11 to compile in this mode.

Not yet implemented in sdcc:

  • Data type double, long double.
  • Structures and unions can not be assigned, passed as function parameters or return values.
  • Intermingled declarations and code (variable declaration no longer restricted to file scope or the start of a compound statement (block)).
  • Compound literals.
  • Integer constants for long long, unsigned long long, int_fast64_t, int_least64_t, int64_t, uint_fast64_t, uint_least64_t, uint64_t.
  • Improved Unicode support.

Not yet implemented in some ports:

  • Support for _Bool / bool is incomplete (no pointers to bool, or bool inside a struct) in the mcs51, ds390 and xa51 ports.
  • Functions are not reentrant unless explicitly declared as such or --stack-auto is specified in the mcs51, hc08 and s08 ports.
  • There is no support for data types long long, unsigned long long, int_fast64_t, int_least64_t, int64_t, uint_fast64_t, uint_least64_t, uint64_t in the mcs51, ds390, ds400, pic14, pic16 and xa51 ports.

[edit] Embedded C

SDCC supports Embedded C named address spaces, both intrinsic (depending on the port) and user-defined. The fixed-point math support in the pic ports is not standard-compliant. Other parts of the standard are not supported.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox