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?

About the Author

William G. Wong | Senior Content Director - Electronic Design and Microwaves & RF

I am Editor of Electronic Design focusing on embedded, software, and systems. As Senior Content Director, I also manage Microwaves & RF and I work with a great team of editors to provide engineers, programmers, developers and technical managers with interesting and useful articles and videos on a regular basis. Check out our free newsletters to see the latest content.

You can send press releases for new products for possible coverage on the website. I am also interested in receiving contributed articles for publishing on our website. Use our template and send to me along with a signed release form. 

Check out my blog, AltEmbedded on Electronic Design, as well as his latest articles on this site that are listed below. 

You can visit my social media via these links:

I earned a Bachelor of Electrical Engineering at the Georgia Institute of Technology and a Masters in Computer Science from Rutgers University. I still do a bit of programming using everything from C and C++ to Rust and Ada/SPARK. I do a bit of PHP programming for Drupal websites. I have posted a few Drupal modules.  

I still get a hand on software and electronic hardware. Some of this can be found on our Kit Close-Up video series. You can also see me on many of our TechXchange Talk videos. I am interested in a range of projects from robotics to artificial intelligence. 

Sponsored Recommendations

Comments

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