Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
The CAN/CSA-ISO/IEC TR 18037-09 (R2014) is the Canadian adoption of the international Information technology — Programming languages — C — Extensions to support embedded processors technical report. Published originally in 2009 and reaffirmed in 2014 by the Canadian Standards Association (CSA), this document provides essential guidance for extending the standard C language to meet the specific demands of embedded systems development. It defines new data types for fixed-point arithmetic, introduces named address spaces for accessing different memory regions, and outlines minimal I/O operations — all aimed at improving code portability and efficiency across a wide range of microcontrollers and embedded processors.
The scope of TR 18037 is to extend the C programming language (as defined by ISO/IEC 9899:1999, C99) with features that directly support embedded processor hardware. The extensions address common challenges in programming resource-constrained devices:
The document is a Technical Report (TR), meaning it provides guidance rather than mandatory requirements. However, it has been widely adopted by compiler vendors as a de facto standard for embedded C extensions.
TR 18037 introduces a set of optional extensions that a conforming implementation may support. The core technical additions from the report are categorized below.
The standard defines two families of fixed-point types: fractional (_Fract) and accumulative (_Accum). These types represent signed or unsigned fixed-point numbers with a specified integer and fractional bit count. Key characteristics include:
The following table summarises the basic fixed-point types as defined by the report (typical 32-bit implementation shown):
| Type | Signedness | Format (bits) | Approximate Range | Resolution |
|---|---|---|---|---|
_Fract | Unsigned / Signed | 1.15 / 1.0.15 | [-1.0, 1.0) | ~3.05e-5 |
_Accum | Unsigned / Signed | 8.8 / 8.8 (or 16.16) | [-256.0, 255.996) or larger | ~3.9e-3 (8.8) / ~1.5e-5 (16.16) |
_Sat modifier | — | Applies to any fixed-point type | Clamps to max/min | — |
Modifiers such as _Sat (saturation), unsigned, and explicit bit-width suffixes (_Fract32, _Accum32) allow tuning of range and precision. The standard also mandates a set of conversion rules, rounding modes (to nearest, toward zero, etc.), and overflow handling (wrap or saturate).
Named address spaces extend the C syntax so that developers can place objects in specific hardware memory regions. This is critical for Harvard-architecture devices (e.g., many microcontrollers) where program memory and data memory are separate. Common spaces include:
__flash — Read-only data stored in program space.__xdata — External data memory.__idata, __pdata — Internal or paged data memory.__io — Memory-mapped I/O registers (with possible side effects).The report defines a small set of intrinsics for reading and writing to memory-mapped I/O ports and registers. These operations guarantee access atomicity (where applicable) and inhibit optimisations that might reorder or eliminate I/O accesses. Typical operations include:
__readb(address) — Read a byte from an I/O address.__writeb(value, address) — Write a byte to an I/O address.__readw, __writew, etc.).These operations are optional; compilers that support TR 18037 may use alternative built-in functions or volatile-qualified pointers to achieve the same effect.
TR 18037 serves as a blueprint for compiler extension design. Many embedded toolchains, including GCC (through fixed-point built-ins and named address space attributes) and commercial compilers from IAR, ARM, and Renesas, have implemented parts of the report.
Key implementation considerations:
Because TR 18037 is a Technical Report and not a full International Standard, “compliance” is interpreted as conformance to the report’s specifications. Compilers that claim support for the extensions should follow the semantics described in the document. Points to verify when evaluating compliance include:
_Fract, _Accum, and _Sat compile as expected?For CSA adoption, compliance with CAN/CSA-ISO/IEC TR 18037-09 (R2014) means that the product or tool claims to adhere to the requirements of ISO/IEC TR 18037:2009 (E) as corrected by its technical corrigenda. Users should consult the latest version of the ISO/IEC report for errata and amendments.
_Atomic qualifier and generic selections. Most compiler vendors implement the TR independently.-ffixed-point) and named address space extensions via attributes. IAR Embedded Workbench, ARM Compiler 5/6, and Renesas CC-RX also offer partial support. Not all features are uniformly implemented; check the specific compiler manual.Last reviewed: 2026. This article is based on CAN/CSA-ISO/IEC TR 18037-09 (R2014) and ISO/IEC TR 18037:2009. Always refer to the official CSA document for authoritative requirements.