[Python-Dev] C99 (original) (raw)
Benjamin Peterson benjamin at python.org
Sat Jun 4 14:47:43 EDT 2016
- Previous message (by thread): [Python-Dev] C99
- Next message (by thread): [Python-Dev] C99
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Jun 4, 2016, at 11:32, Dino Viehland wrote:
Martin wrote: > On 4 June 2016 at 06:11, Benjamin Peterson <benjamin at python.org> wrote: > > PEP 7 requires CPython to use C code conforming to the venerable C89 > > standard. Traditionally, we've been stuck with C89 due to poor C > > support in MSVC. However, MSVC 2013 and 2015 implement the key > features of C99. > > C99 does not offer anything earth-shattering; here are the features I > > think we'd find most interesting: > > - Variable declarations can be on any line: removes possibly the most > > annoying limitation of C89. > > - Inline functions: We can make PyDECREF and PyINCREF inline > > functions rather than unpleasant macros. > > - C++-style line comments: Not an killer feature but commonly used. > > - Booleans > > My most-missed C99 feature would be designated initializers. Does MSVC > support them? It might allow you to do away with those giant pasted slot > tables, and just write the slots you need: > > PyTypeObject PyUnicodeIterType = { > PyVarObjectHEADINIT(&PyTypeType, 0) > .tpname = "striterator", > .tpbasicsize = sizeof(unicodeiterobject), > .tpdealloc = unicodeiterdealloc, > .tpgetattro = PyObjectGenericGetAttr, > .tpflags = PyTPFLAGSDEFAULT | PyTPFLAGSHAVEGC, > .tptraverse = unicodeitertraverse, > .tpiter = PyObjectSelfIter, > .tpiternext = unicodeiternext, > .tpmethods = unicodeitermethods, > }; I checked and VC++ does actually support this, and it looks like they support // comments as well. I don't think it fully supports all of the C99 features - it appears They just cherry picked some stuff. The C99 standard library does appear to be fully supported with the exception of tgmath.h.
Are the C99 features VS++ supports documented anywhere? I couldn't find any list.
- Previous message (by thread): [Python-Dev] C99
- Next message (by thread): [Python-Dev] C99
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]