[Python-Dev] PEP 7: Adding anonymous union (original) (raw)
Victor Stinner vstinner at redhat.com
Wed Apr 17 07:27:39 EDT 2019
- Previous message (by thread): [Python-Dev] PEP 7: Adding anonymous union / struct
- Next message (by thread): [Python-Dev] PEP 7: Adding anonymous union / struct
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
AIX is somehow supported and uses xlc compiler: does xlc support this C11 feature?
Do you want to use it in Python 3.8 and newer only?
Victor
Le mer. 17 avr. 2019 à 13:14, Inada Naoki <songofacandy at gmail.com> a écrit :
Hi, all. PEP 7 includes some C99 features. I propose to add include anonymous union and struct to the list. https://www.geeksforgeeks.org/g-fact-38-anonymous-union-and-structure/ Anonymous union and struct are C11 feature, not C99. But gcc and MSVC supported it as language extension from before C11. Anonymous union is useful when all union members have different names. Especially, when we need to add dummy member only for padding / alignment, union name looks too verbose: ... # in some struct union { struct { int member1; int member2; } s; long double dummy; // for largest alignment. } u; ... x.u.s.member1 = 42; vs ... union { struct { int member1; int member2; }; long double dummy; // for largest alignment. }; ... x.member1 = 42;
Does anyone know compiler which can be use to compile Python but doesn't support anonymous union / struct? Regards, -- Inada Naoki <songofacandy at gmail.com>
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/vstinner%40redhat.com
-- Night gathers, and now my watch begins. It shall not end until my death.
- Previous message (by thread): [Python-Dev] PEP 7: Adding anonymous union / struct
- Next message (by thread): [Python-Dev] PEP 7: Adding anonymous union / struct
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]