C Standards: More Or Less

Dec. 9, 2002
C and C++ standards keep compiler vendors in line, while system and application developers appreciate the portability aspects. But embedded developers de-mand more and sometimes less than what the standards specify. These days, DSP...

C and C++ standards keep compiler vendors in line, while system and application developers appreciate the portability aspects. But embedded developers de-mand more and sometimes less than what the standards specify.

These days, DSP developers use C and C++ more often than not, and DSP architectures tend to support C and C++. There isn't much conflict for integer or floating-point DSP support, but fixed point is another matter. Here, DSP-C extensions come into play. A fixed-point data type is added on top of other memory- and device-related features.

Many companies have tried to address the fixed-point problem with varying degrees of success. Motorola utilizes C macros and function definitions, which offers the advantage of working with most C compilers. As a result, the same technique can be used with Motorola's compilers, or third-party compilers.

Of the various extensions, DSP-C looks to be the best bet as a new ISO standard (see "DSP-C 'Fix-Points' C," p. 71). Check out Technical Report No. 18037. MISRA C (The Motor Industry Software Reliability Association) and Embedded C++ (EC++) are subsets of C and C++, respectively. ISO standardization may not be right around the corner, but both are de facto standards.

Many programmers despise subsets, but MISRA C and EC++ are really needed. MISRA C is designed to improve reliability and safety. That's a tough job for a language where shooting one's own foot is a common pastime. EC++ is designed to reduce the execution footprint for C++ applications. C++ features added to C (e.g., templates and exception handling) are invaluable in most situations. Still, they add overhead. EC++ attempts to streamline C++.

C and C++ compilers, especially those targeted for embedded systems, support one or more of these standards. Although it's nice to have options, which one do you choose? More or less?

Sponsored Recommendations

TTI Transportation Resource Center

April 8, 2024
From sensors to vehicle electrification, from design to production, on-board and off-board a TTI Transportation Specialist will help you keep moving into the future. TTI has been...

Cornell Dubilier: Push EV Charging to Higher Productivity and Lower Recharge Times

April 8, 2024
Optimized for high efficiency power inverter/converter level 3 EV charging systems, CDE capacitors offer high capacitance values, low inductance (< 5 nH), high ripple current ...

TTI Hybrid & Electric Vehicles Line Card

April 8, 2024
Components for Infrastructure, Connectivity and On-board Systems TTI stocks the premier electrical components that hybrid and electric vehicle manufacturers and suppliers need...

Bourns: Automotive-Grade Components for the Rough Road Ahead

April 8, 2024
The electronics needed for transportation today is getting increasingly more demanding and sophisticated, requiring not only high quality components but those that interface well...

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!