This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cygwin gcc "initializer element is not constant" problem


The attached code snippet, j2.c, demonstrates a Cygwin specific
compilation problem that affects many Python shared extension modules:

    $ gcc -c j2.c
    j2.c:17: initializer element is not constant
    j2.c:17: (near initialization for `f.get')

It appears that Cygwin gcc considers function pointers marked
"__declspec(dllimport)" unacceptable to use as initializer constants.

My standard workaround is to submit a patch that is the equivalent of
compiling this snippet with -DWORKAROUND:

    $ gcc -DWORKAROUND -c j2.c

Unfortunately, this style of patch is no longer acceptable:

    http://mail.python.org/pipermail/python-dev/2002-December/031534.html

Can anyone suggest a better (hopefully less intrusive) workaround?

Thanks,
Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Attachment: j2.c
Description: Text document

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]