[Python-Dev] Can we use "designated initializer" widely in coremodules?

Brett Cannon brett at python.org
Wed Jan 18 15:20:20 EST 2017


On Tue, 17 Jan 2017 at 18:36 Nathaniel Smith <njs at pobox.com> wrote:

> On Tue, Jan 17, 2017 at 4:48 PM, INADA Naoki <songofacandy at gmail.com>
> wrote:
> > On Wed, Jan 18, 2017 at 8:48 AM, Larry Hastings <larry at hastings.org>
> wrote:
> >>
> >> On 01/17/2017 12:02 PM, Steve Dower wrote:
> >>
> >> Avoiding header files would be my only request. As Brett says, the C99
> >> requirement should not be enforced on all embedders or extenders, so we
> >> should try and keep the headers they'll use as compatible as possible.
> >>
> >>
> >
> > C99 style comment is used in header file already.
> > see http://bugs.python.org/issue29215
> >
> >>
> >> While that's a reasonable policy, unless we have a way to automatically
> >> detect that I suspect C99 stuff will creep into the header files and
> break
> >> the non-C99 customers.  Maybe we could get some sort of buildbot that
> >> exercises this scenario?
> >>
> >
> > How about `gcc -ansi` ?
>
> I think the main concern isn't C90 compatibility, but C++
> compatibility, right?


Correct. This is not about supporting old versions of C but making sure we
continue to support C++ extensions.


> The reason CPython is switching to allowing
> (most of) C99 internally is that it seems like that it's now supported
> as a matter of course on all the platforms we care about, so while
> it's theoretically possible that someone uses C99 compiler to build
> Python but then switches to a C90 compiler to build extensions, it
> seems pretty unlikely. (Especially since the last hold-out on C99
> support was MSVC, and on Windows we already force people to build
> extensions using the same version of MSVC as was used to build
> CPython.)
>
> OTOH it is definitely important that the Python header files remain
> polyglot C99-and-C++ compatible.
>
> Even a simple check like:
>
> echo '#include <Python.h>' > test.cc && g++ -c test.cc -o /dev/null
>
> would probably catch most issues here.
>

 I've gone ahead and added that to the Travis test matrix for when we move
to GitHub:
https://github.com/brettcannon/cpython-ci-test/blob/master/.travis.yml#L55
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170118/a28f6897/attachment.html>


More information about the Python-Dev mailing list