Search This Blog

Tuesday, September 28, 2010

How to check C source code against the current standard?

Programmer Question

I'm continuing to learn C and would like to adhere to whatever is the current standard, but finding a good reference to that seems to be problem.



From what I've found online (mostly through Google and Wikipedia) is that the current standard used today is C99, more formally the ISO/IEC 9899:1999 standard.



When I'm writing C code, I often bring up a browser and do simple web searches for things like finding out the exact return values to the stdio.h function scanf. Mostly I just want to get into a good practice of adhering to the current standard, but even if I search for the specific string "C99 printf" or something like it, there doesn't seem to be one single place to find a definitive spec.



So I have two questions:



1) Is there a central C99 spec that is available online, maintained by the organization responsible for this standard?



[edit]: This first question has already been answered here: http://stackoverflow.com/questions/81656/where-do-i-find-the-current-c-or-c-standard-documents. Thanks to James McNellis for pointing this out.



2) Is there a program that can parse a C source file to make sure it adheres to the C99 spec? I know there are programs like this to parse XHTML files and it seems like there should be one for C99 as well...



[edit]:
I should also mention that I'm doing C development using gcc, specifically version 3.4.4.
When I go to the main gcc website (http://gcc.gnu.org/) I'm still running into difficulty figuring out which compiler version supports which C specification.



Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails