Skip to content

Problem with compiling ifxpy.c #86

Description

@hzokovic

When I run
python setup.py build
I got theses errors:
multiple times this one

ifxpyc.c: In function ‘_python_IfxPy_free_conn_struct’:
ifxpyc.c:214:34: error: assignment to ‘storeSessionID *’ from incompatible pointer type ‘struct storeSessionID *’ [-Wincompatible-pointer-types]
  214 |                         tempNode = tempNode->next;
      |                                  ^

and these two errors as well

ifxpyc.c: In function ‘_python_IfxPy_bind_fetch_helper’:
ifxpyc.c:9373:69: error: passing argument 1 of ‘PyBytes_FromStringAndSize’ from incompatible pointer type [-Wincompatible-pointer-types]
 9373 |                                   value = PyBytes_FromStringAndSize(wout_ptr, out_length);
      |                                                                     ^~~~~~~~
      |                                                                     |
      |                                                                     SQLWCHAR * {aka int *}
In file included from /usr/local/include/python3.7m/Python.h:98:
/usr/local/include/python3.7m/bytesobject.h:51:50: note: expected ‘const char *’ but argument is of type ‘SQLWCHAR *’ {aka ‘int *’}
   51 | PyAPI_FUNC(PyObject *) PyBytes_FromStringAndSize(const char *, Py_ssize_t);
      |                                                  ^~~~~~~~~~~~

#################

ifxpyc.c: In function ‘IfxPy_execute_many’:
ifxpyc.c:11431:52: error: passing argument 4 of ‘SQLDescribeParam’ from incompatible pointer type [-Wincompatible-pointer-types]
11431 |                     (SQLSMALLINT*)(data_type + i), &precision, (SQLSMALLINT*)&scale,
      |                                                    ^~~~~~~~~~
      |                                                    |
      |                                                    SQLUINTEGER * {aka unsigned int *}
In file included from /home/informix/icsdk.4.5.12.12/incl/cli/infxsql.h:1123,
                 from /home/informix/icsdk.4.5.12.12/incl/cli/infxcli.h:33,
                 from ifxpyc.h:41,
                 from ifxpyc.c:43:
/home/informix/icsdk.4.5.12.12/incl/cli/sqlext.h:1832:28: note: expected ‘SQLULEN *’ {aka ‘long long unsigned int *’} but argument is of type ‘SQLUINTEGER *’ {aka ‘unsigned int *’}
 1832 |     SQLULEN               *pcbParamDef,
      |     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~

So this is diff file ifxpy-orig.c and my ifxpy.c which compiles succesfully

78c78
< typedef struct storeSessionID {
---
> typedef struct {
9373c9373
<                                   value = PyBytes_FromStringAndSize((const char *)wout_ptr, out_length);
---
>                                   value = PyBytes_FromStringAndSize(wout_ptr, out_length);
11382c11382
<     SQLULEN precision;
---
>     SQLUINTEGER precision;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions