[pypy-svn] r47413 - pypy/dist/pypy/translator/c
arigo at codespeak.net
arigo at codespeak.net
Fri Oct 12 20:07:06 CEST 2007
Author: arigo
Date: Fri Oct 12 20:07:04 2007
New Revision: 47413
Modified:
pypy/dist/pypy/translator/c/node.py
Log:
Update comment.
Modified: pypy/dist/pypy/translator/c/node.py
==============================================================================
--- pypy/dist/pypy/translator/c/node.py (original)
+++ pypy/dist/pypy/translator/c/node.py Fri Oct 12 20:07:04 2007
@@ -536,8 +536,11 @@
for name in self.T._names:
data.append((name, getattr(self.obj, name)))
- # You can only initialise the first field of a union in c
- # XXX what if later fields have some initialisation?
+ # Reasonably, you should only initialise one of the fields of a union
+ # in C. This is possible with the syntax '.fieldname value' or
+ # '.fieldname = value'. But here we don't know which of the
+ # fields need initialization, so XXX we pick the first one
+ # arbitrarily.
if hasattr(self.T, "_hints") and self.T._hints.get('union'):
data = data[0:1]
More information about the Pypy-commit
mailing list