Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building for Python 3.x in MacOS fails #5

Closed
jj-globant opened this issue May 24, 2017 · 1 comment
Closed

Building for Python 3.x in MacOS fails #5

jj-globant opened this issue May 24, 2017 · 1 comment

Comments

@jj-globant
Copy link

Using Conda for the environment, Xcode is installed and everything is updated, but i get this errors when executing the 'pip install'

Collecting python-cjson
  Using cached python-cjson-1.2.1.tar.gz
Building wheels for collected packages: python-cjson
  Running setup.py bdist_wheel for python-cjson ... error
  Complete output from command /Users/juanjose.lopez/anaconda/envs/ChevereBot/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/kn/6ynmt1p91jvdkbv869lkz6vm4c1z19/T/pip-build-guitqjom/python-cjson/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /var/folders/kn/6ynmt1p91jvdkbv869lkz6vm4c1z19/T/tmpn3y8rvi_pip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_ext
  building 'cjson' extension
  creating build
  creating build/temp.macosx-10.7-x86_64-3.6
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/juanjose.lopez/anaconda/envs/ChevereBot/include -arch x86_64 -I/Users/juanjose.lopez/anaconda/envs/ChevereBot/include -arch x86_64 -DMODULE_VERSION=1.2.1 -I/Users/juanjose.lopez/anaconda/envs/ChevereBot/include/python3.6m -c cjson.c -o build/temp.macosx-10.7-x86_64-3.6/cjson.o
  cjson.c:167:18: warning: implicit declaration of function 'PyString_DecodeEscape' is invalid in C99 [-Wimplicit-function-declaration]
          object = PyString_DecodeEscape(jsondata->ptr+1, len, NULL, 0, NULL);
                   ^
  cjson.c:167:16: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
          object = PyString_DecodeEscape(jsondata->ptr+1, len, NULL, 0, NULL);
                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:169:18: warning: implicit declaration of function 'PyString_FromStringAndSize' is invalid in C99 [-Wimplicit-function-declaration]
          object = PyString_FromStringAndSize(jsondata->ptr+1, len);
                   ^
  cjson.c:169:16: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
          object = PyString_FromStringAndSize(jsondata->ptr+1, len);
                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:185:39: warning: implicit declaration of function 'PyString_AsString' is invalid in C99 [-Wimplicit-function-declaration]
                               reason ? PyString_AsString(reason) : "bad format");
                                        ^
  cjson.c:185:37: warning: pointer/integer type mismatch in conditional expression ('int' and 'char *') [-Wconditional-type-mismatch]
                               reason ? PyString_AsString(reason) : "bad format");
                                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~
  cjson.c:295:9: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      str = PyString_FromStringAndSize(jsondata->ptr, ptr - jsondata->ptr);
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:300:42: error: too many arguments to function call, expected 1, have 2
          object = PyFloat_FromString(str, NULL);
                   ~~~~~~~~~~~~~~~~~~      ^~~~
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/include/stddef.h:105:16: note: expanded from macro 'NULL'
  #  define NULL ((void*)0)
                 ^~~~~~~~~~
  /Users/juanjose.lopez/anaconda/envs/ChevereBot/include/python3.6m/floatobject.h:42:12: note: 'PyFloat_FromString' declared here
  PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*);
             ^
  cjson.c:302:18: warning: implicit declaration of function 'PyInt_FromString' is invalid in C99 [-Wimplicit-function-declaration]
          object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10);
                   ^
  cjson.c:302:35: warning: implicit declaration of function 'PyString_AS_STRING' is invalid in C99 [-Wimplicit-function-declaration]
          object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10);
                                    ^
  cjson.c:302:16: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
          object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10);
                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:593:14: error: unknown type name 'PyStringObject'
      register PyStringObject* op = (PyStringObject*) string;
               ^
  cjson.c:593:51: error: expected expression
      register PyStringObject* op = (PyStringObject*) string;
                                                    ^
  cjson.c:593:36: error: use of undeclared identifier 'PyStringObject'
      register PyStringObject* op = (PyStringObject*) string;
                                     ^
  cjson.c:602:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      v = PyString_FromStringAndSize((char *)NULL, newsize);
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:614:11: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
          p = PyString_AS_STRING(v);
            ^ ~~~~~~~~~~~~~~~~~~~~~
  cjson.c:646:9: warning: implicit declaration of function '_PyString_Resize' is invalid in C99 [-Wimplicit-function-declaration]
          _PyString_Resize(&v, (int) (p - PyString_AS_STRING(v)));
          ^
  cjson.c:697:10: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      repr = PyString_FromStringAndSize(NULL, 2 + expandsize*size + 1);
           ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:701:7: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
      p = PyString_AS_STRING(repr);
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:709:57: error: subscripted value is not an array, pointer, or vector
          if ((ch == (Py_UNICODE) PyString_AS_STRING(repr)[0] || ch == '\\')) {
                                  ~~~~~~~~~~~~~~~~~~~~~~~~^~
  cjson.c:804:36: error: subscripted value is not an array, pointer, or vector
      *p++ = PyString_AS_STRING(repr)[0];
             ~~~~~~~~~~~~~~~~~~~~~~~~^~
  cjson.c:828:12: error: no member named 'ob_size' in 'PyTupleObject'
      n = v->ob_size;
          ~  ^
  cjson.c:830:16: warning: implicit declaration of function 'PyString_FromString' is invalid in C99 [-Wimplicit-function-declaration]
          return PyString_FromString("[]");
                 ^
  cjson.c:830:16: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
          return PyString_FromString("[]");
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:846:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      s = PyString_FromString("[");
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:850:5: warning: implicit declaration of function 'PyString_ConcatAndDel' is invalid in C99 [-Wimplicit-function-declaration]
      PyString_ConcatAndDel(&s, temp);
      ^
  cjson.c:855:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      s = PyString_FromString("]");
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:865:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      s = PyString_FromString(", ");
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:868:14: warning: implicit declaration of function '_PyString_Join' is invalid in C99 [-Wimplicit-function-declaration]
      result = _PyString_Join(s, pieces);
               ^
  cjson.c:868:12: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      result = _PyString_Join(s, pieces);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:902:12: error: no member named 'ob_size' in 'PyListObject'
      if (v->ob_size == 0) {
          ~  ^
  cjson.c:903:16: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
          result = PyString_FromString("[]");
                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:913:24: error: no member named 'ob_size' in 'PyListObject'
      for (i = 0; i < v->ob_size; ++i) {
                      ~  ^
  cjson.c:926:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      s = PyString_FromString("[");
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:935:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      s = PyString_FromString("]");
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:945:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      s = PyString_FromString(", ");
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:948:12: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      result = _PyString_Join(s, pieces);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:987:16: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
          result = PyString_FromString("{}");
                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:995:11: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      colon = PyString_FromString(": ");
            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1005:14: warning: implicit declaration of function 'PyString_Check' is invalid in C99 [-Wimplicit-function-declaration]
          if (!PyString_Check(key) && !PyUnicode_Check(key)) {
               ^
  cjson.c:1014:9: warning: implicit declaration of function 'PyString_Concat' is invalid in C99 [-Wimplicit-function-declaration]
          PyString_Concat(&s, colon);
          ^
  cjson.c:1027:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      s = PyString_FromString("{");
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1036:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      s = PyString_FromString("}");
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1046:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      s = PyString_FromString(", ");
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1049:12: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      result = _PyString_Join(s, pieces);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1064:16: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
          return PyString_FromString("true");
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1066:16: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
          return PyString_FromString("false");
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1068:16: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
          return PyString_FromString("null");
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1076:20: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
              return PyString_FromString("NaN");
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1079:24: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
                  return PyString_FromString("Infinity");
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1081:24: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
                  return PyString_FromString("-Infinity");
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1086:16: warning: implicit declaration of function 'PyInt_Check' is invalid in C99 [-Wimplicit-function-declaration]
      } else if (PyInt_Check(object) || PyLong_Check(object)) {
                 ^
  cjson.c:1149:9: warning: implicit declaration of function 'PyString_AsStringAndSize' is invalid in C99 [-Wimplicit-function-declaration]
      if (PyString_AsStringAndSize(str, &(jsondata.str), NULL) == -1) {
          ^
  cjson.c:1155:35: warning: implicit declaration of function 'PyString_GET_SIZE' is invalid in C99 [-Wimplicit-function-declaration]
      jsondata.end = jsondata.str + PyString_GET_SIZE(str);
                                    ^
  cjson.c:1206:9: warning: implicit declaration of function 'Py_InitModule3' is invalid in C99 [-Wimplicit-function-declaration]
      m = Py_InitModule3("cjson", cjson_methods, module_doc);
          ^
  cjson.c:1206:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
      m = Py_InitModule3("cjson", cjson_methods, module_doc);
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cjson.c:1209:9: error: non-void function 'initcjson' should return a value [-Wreturn-type]
          return;
          ^
  cjson.c:1213:9: error: non-void function 'initcjson' should return a value [-Wreturn-type]
          return;
          ^
  cjson.c:1219:9: error: non-void function 'initcjson' should return a value [-Wreturn-type]
          return;
          ^
  cjson.c:1225:9: error: non-void function 'initcjson' should return a value [-Wreturn-type]
          return;
          ^
  47 warnings and 13 errors generated.
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for python-cjson
  Running setup.py clean for python-cjson
Failed to build python-cjson
Installing collected packages: python-cjson
  Running setup.py install for python-cjson ... error
    Complete output from command /Users/juanjose.lopez/anaconda/envs/ChevereBot/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/kn/6ynmt1p91jvdkbv869lkz6vm4c1z19/T/pip-build-guitqjom/python-cjson/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/kn/6ynmt1p91jvdkbv869lkz6vm4c1z19/T/pip-8u5ci1qg-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'cjson' extension
    creating build
    creating build/temp.macosx-10.7-x86_64-3.6
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/juanjose.lopez/anaconda/envs/ChevereBot/include -arch x86_64 -I/Users/juanjose.lopez/anaconda/envs/ChevereBot/include -arch x86_64 -DMODULE_VERSION=1.2.1 -I/Users/juanjose.lopez/anaconda/envs/ChevereBot/include/python3.6m -c cjson.c -o build/temp.macosx-10.7-x86_64-3.6/cjson.o
    cjson.c:167:18: warning: implicit declaration of function 'PyString_DecodeEscape' is invalid in C99 [-Wimplicit-function-declaration]
            object = PyString_DecodeEscape(jsondata->ptr+1, len, NULL, 0, NULL);
                     ^
    cjson.c:167:16: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
            object = PyString_DecodeEscape(jsondata->ptr+1, len, NULL, 0, NULL);
                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:169:18: warning: implicit declaration of function 'PyString_FromStringAndSize' is invalid in C99 [-Wimplicit-function-declaration]
            object = PyString_FromStringAndSize(jsondata->ptr+1, len);
                     ^
    cjson.c:169:16: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
            object = PyString_FromStringAndSize(jsondata->ptr+1, len);
                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:185:39: warning: implicit declaration of function 'PyString_AsString' is invalid in C99 [-Wimplicit-function-declaration]
                                 reason ? PyString_AsString(reason) : "bad format");
                                          ^
    cjson.c:185:37: warning: pointer/integer type mismatch in conditional expression ('int' and 'char *') [-Wconditional-type-mismatch]
                                 reason ? PyString_AsString(reason) : "bad format");
                                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~
    cjson.c:295:9: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        str = PyString_FromStringAndSize(jsondata->ptr, ptr - jsondata->ptr);
            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:300:42: error: too many arguments to function call, expected 1, have 2
            object = PyFloat_FromString(str, NULL);
                     ~~~~~~~~~~~~~~~~~~      ^~~~
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/include/stddef.h:105:16: note: expanded from macro 'NULL'
    #  define NULL ((void*)0)
                   ^~~~~~~~~~
    /Users/juanjose.lopez/anaconda/envs/ChevereBot/include/python3.6m/floatobject.h:42:12: note: 'PyFloat_FromString' declared here
    PyAPI_FUNC(PyObject *) PyFloat_FromString(PyObject*);
               ^
    cjson.c:302:18: warning: implicit declaration of function 'PyInt_FromString' is invalid in C99 [-Wimplicit-function-declaration]
            object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10);
                     ^
    cjson.c:302:35: warning: implicit declaration of function 'PyString_AS_STRING' is invalid in C99 [-Wimplicit-function-declaration]
            object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10);
                                      ^
    cjson.c:302:16: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
            object = PyInt_FromString(PyString_AS_STRING(str), NULL, 10);
                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:593:14: error: unknown type name 'PyStringObject'
        register PyStringObject* op = (PyStringObject*) string;
                 ^
    cjson.c:593:51: error: expected expression
        register PyStringObject* op = (PyStringObject*) string;
                                                      ^
    cjson.c:593:36: error: use of undeclared identifier 'PyStringObject'
        register PyStringObject* op = (PyStringObject*) string;
                                       ^
    cjson.c:602:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        v = PyString_FromStringAndSize((char *)NULL, newsize);
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:614:11: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
            p = PyString_AS_STRING(v);
              ^ ~~~~~~~~~~~~~~~~~~~~~
    cjson.c:646:9: warning: implicit declaration of function '_PyString_Resize' is invalid in C99 [-Wimplicit-function-declaration]
            _PyString_Resize(&v, (int) (p - PyString_AS_STRING(v)));
            ^
    cjson.c:697:10: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        repr = PyString_FromStringAndSize(NULL, 2 + expandsize*size + 1);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:701:7: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
        p = PyString_AS_STRING(repr);
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:709:57: error: subscripted value is not an array, pointer, or vector
            if ((ch == (Py_UNICODE) PyString_AS_STRING(repr)[0] || ch == '\\')) {
                                    ~~~~~~~~~~~~~~~~~~~~~~~~^~
    cjson.c:804:36: error: subscripted value is not an array, pointer, or vector
        *p++ = PyString_AS_STRING(repr)[0];
               ~~~~~~~~~~~~~~~~~~~~~~~~^~
    cjson.c:828:12: error: no member named 'ob_size' in 'PyTupleObject'
        n = v->ob_size;
            ~  ^
    cjson.c:830:16: warning: implicit declaration of function 'PyString_FromString' is invalid in C99 [-Wimplicit-function-declaration]
            return PyString_FromString("[]");
                   ^
    cjson.c:830:16: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
            return PyString_FromString("[]");
                   ^~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:846:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        s = PyString_FromString("[");
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:850:5: warning: implicit declaration of function 'PyString_ConcatAndDel' is invalid in C99 [-Wimplicit-function-declaration]
        PyString_ConcatAndDel(&s, temp);
        ^
    cjson.c:855:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        s = PyString_FromString("]");
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:865:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        s = PyString_FromString(", ");
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:868:14: warning: implicit declaration of function '_PyString_Join' is invalid in C99 [-Wimplicit-function-declaration]
        result = _PyString_Join(s, pieces);
                 ^
    cjson.c:868:12: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        result = _PyString_Join(s, pieces);
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:902:12: error: no member named 'ob_size' in 'PyListObject'
        if (v->ob_size == 0) {
            ~  ^
    cjson.c:903:16: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
            result = PyString_FromString("[]");
                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:913:24: error: no member named 'ob_size' in 'PyListObject'
        for (i = 0; i < v->ob_size; ++i) {
                        ~  ^
    cjson.c:926:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        s = PyString_FromString("[");
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:935:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        s = PyString_FromString("]");
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:945:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        s = PyString_FromString(", ");
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:948:12: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        result = _PyString_Join(s, pieces);
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:987:16: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
            result = PyString_FromString("{}");
                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:995:11: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        colon = PyString_FromString(": ");
              ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1005:14: warning: implicit declaration of function 'PyString_Check' is invalid in C99 [-Wimplicit-function-declaration]
            if (!PyString_Check(key) && !PyUnicode_Check(key)) {
                 ^
    cjson.c:1014:9: warning: implicit declaration of function 'PyString_Concat' is invalid in C99 [-Wimplicit-function-declaration]
            PyString_Concat(&s, colon);
            ^
    cjson.c:1027:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        s = PyString_FromString("{");
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1036:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        s = PyString_FromString("}");
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1046:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        s = PyString_FromString(", ");
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1049:12: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        result = _PyString_Join(s, pieces);
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1064:16: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
            return PyString_FromString("true");
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1066:16: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
            return PyString_FromString("false");
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1068:16: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
            return PyString_FromString("null");
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1076:20: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
                return PyString_FromString("NaN");
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1079:24: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
                    return PyString_FromString("Infinity");
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1081:24: warning: incompatible integer to pointer conversion returning 'int' from a function with result type 'PyObject *' (aka 'struct _object *') [-Wint-conversion]
                    return PyString_FromString("-Infinity");
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1086:16: warning: implicit declaration of function 'PyInt_Check' is invalid in C99 [-Wimplicit-function-declaration]
        } else if (PyInt_Check(object) || PyLong_Check(object)) {
                   ^
    cjson.c:1149:9: warning: implicit declaration of function 'PyString_AsStringAndSize' is invalid in C99 [-Wimplicit-function-declaration]
        if (PyString_AsStringAndSize(str, &(jsondata.str), NULL) == -1) {
            ^
    cjson.c:1155:35: warning: implicit declaration of function 'PyString_GET_SIZE' is invalid in C99 [-Wimplicit-function-declaration]
        jsondata.end = jsondata.str + PyString_GET_SIZE(str);
                                      ^
    cjson.c:1206:9: warning: implicit declaration of function 'Py_InitModule3' is invalid in C99 [-Wimplicit-function-declaration]
        m = Py_InitModule3("cjson", cjson_methods, module_doc);
            ^
    cjson.c:1206:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
        m = Py_InitModule3("cjson", cjson_methods, module_doc);
          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cjson.c:1209:9: error: non-void function 'initcjson' should return a value [-Wreturn-type]
            return;
            ^
    cjson.c:1213:9: error: non-void function 'initcjson' should return a value [-Wreturn-type]
            return;
            ^
    cjson.c:1219:9: error: non-void function 'initcjson' should return a value [-Wreturn-type]
            return;
            ^
    cjson.c:1225:9: error: non-void function 'initcjson' should return a value [-Wreturn-type]
            return;
            ^
    47 warnings and 13 errors generated.
    error: command 'gcc' failed with exit status 1
@danpascu
Copy link
Contributor

Python 3 is not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants