On Mar 8, 2013, at 2:01 PM, David Woodhouse <[email protected]> wrote:
> On Fri, 2013-03-08 at 21:49 +0000, Mcdaniel, Daryl wrote: >> The EDK II code base does not support C99 for non-platform-specific >> code, only C95 is supported. >> This is because we must support a compiler which is only C89 (Strict >> mode) or C95 with extensions. > > I'm a little confused by this. Why "must" we support such an ancient > compiler? Why can't we have a whip-round and buy them a licence for GCC > or CLANG, for crying out loud? > > Why would someone be stuck on such a compiler, and yet *still* be > updating to newer EDK2 code? That seems rather schizophrenic. > > It looks like we're missing appropriate -std= arguments for GCC, if we > really do want to be stuck on a language which is 20 years old. > > And as we progress further into the 21st century, I expect support for > ancient obsolete versions of the C standard will become less and less > reliable. You'll end up with breakage on *modern* compilers, just to > support the Luddites. Is that really a path we want to go down? > David I'm with you on this, and I would point to the behavior of modern compilers (as our examples on the list show) follow the C99 definition of undefined behavior. It is my understanding that MSVC does not fully support C99, just a subset of features. Other than something like named struct elements I think a lot of the incompatibilities don't mater to the edk2 as we don't use standard headers, libraries, or even main(). So by default we subset ourselves out of lot of the language spec (parts of the Environment, and all of the Library chapter), and this means we don't notice MSVC lack of C99 support on a day to day basis. When Mike Kinney and I started coding the edk2 I don't remember ever talking about C95. I seem to remember we talked about the C99 subset supported by MSVC, but this was a long time ago so hopefully Mike will correct me if my memory is wrong. The only restriction for ISO/IEC ISO/IEC 9899:199409 (C95) I know about relates to the the StdLib https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/StdLib/ReadMe.txt. Unlike the generic edk2, the StdLib has to support a complete version of the standard as it is implementing the standard headers and libraries defined in C95 spec. I think it is more accurate to state the edk2 follows the MSVC subset of the C99 language definition, and the StdLib follows ISO/IEC ISO/IEC 9899:199409 (C95). Thanks, Andrew Fish ------------------------------------------------------------------------------ Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
