delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/02/15/20:20:39

Delivered-To: listarch-cygwin AT sourceware DOT cygnus DOT com
Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Date: Mon, 15 Feb 1999 18:22:21 +0200
From: Paul Sokolovsky <paul-ml AT is DOT lg DOT ua>
X-Mailer: The Bat! (v1.00 Christmas Preview) UNREG
Reply-To: Paul Sokoilovsky <paul-ml AT is DOT lg DOT ua>
Message-ID: <8765.990215@is.lg.ua>
To: Mumit Khan <khan AT xraylith DOT wisc DOT edu>, cygwin AT sourceware DOT cygnus DOT com
Subject: __attribute__((dllimport)) problems with egcs
Mime-Version: 1.0

Hello Mumit,

      Egcs 1.1.1 has problems with dllimport attribute, inherent from
1.1. Here's sample code to show them:

--------
typedef struct _object {
   int ob_refcnt; struct _typeobject *ob_type;
} PyObject;

extern    __attribute__((dllimport))  PyObject   _Py_NoneStruct ;  

static PyObject *
parse_and_bind(PyObject *self,PyObject *args)
{
  return &_Py_NoneStruct;
}  
---------

  Both C and C++ frontends have problems, C++ fatal ones.

  When that code compiled in C mode, following warning is issued:
---
a.c: In function `parse_and_bind':
a.c:10: warning: return from incompatible pointer type  
--
  Of course, it's not there without __attribute__((dllimport)).


  When compiled in C++ mode, it just crashes. Further
investigation by feeding code directly to cc1plus shows that crash
occurs not on declaring _Py_NoneStruct, but on referencing it
(compiler have time to print "struct PyObject * parse_and_bind(struct
PyObject *, struct PyObject *)"). Then, it seems that referencing
method plays role too: for example, returning structure itself doesn't
cause problems. Crash itself due to null pointer dereference at 0x00438b5f.

Best regards,
 Paul                          mailto:paul-ml AT is DOT lg DOT ua


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019