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

errors when trying to make #2

Open
warmth1905 opened this issue Jul 28, 2022 · 2 comments
Open

errors when trying to make #2

warmth1905 opened this issue Jul 28, 2022 · 2 comments

Comments

@warmth1905
Copy link

Hello,
I follow the README but errors occur when make.

../pyapi/type_conversion.c: In function ‘pyobject_to_str’:
../pyapi/type_conversion.c:178:15: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
char *str = PyUnicode_AsUTF8(obj);
^
../pyapi/type_conversion.c: In function ‘pyobject_to_bte’:
../pyapi/type_conversion.c:291:24: error: passing argument 1 of ‘str_to_bte’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
return str_to
##type(PyUnicode_AsUTF8(ptr), 0, value);
^
../pyapi/type_conversion.c:313:2: note: in expansion of macro ‘PY_TO_’
PY_TO_(tpe, inttpe);
^
../pyapi/type_conversion.c:315:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(bte, bte)
^
../pyapi/type_conversion.c:209:6: note: expected ‘char *’ but argument is of type ‘const char *’
str str_to_##tpe(char *ptr, size_t maxsize, tpe *value)
^
../pyapi/type_conversion.c:302:2: note: in expansion of macro ‘STRING_TO_NUMBER_FACTORY’
STRING_TO_NUMBER_FACTORY(tpe)
^
../pyapi/type_conversion.c:315:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(bte, bte)
^
../pyapi/type_conversion.c: In function ‘pyobject_to_oid’:
../pyapi/type_conversion.c:291:24: error: passing argument 1 of ‘str_to_oid’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
return str_to_##type(PyUnicode_AsUTF8(ptr), 0, value);
^
../pyapi/type_conversion.c:313:2: note: in expansion of macro ‘PY_TO_’
PY_TO_(tpe, inttpe);
^
../pyapi/type_conversion.c:316:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(oid, oid)
^
../pyapi/type_conversion.c:209:6: note: expected ‘char *’ but argument is of type ‘const char *’
str str_to_##tpe(char *ptr, size_t maxsize, tpe *value)
^
../pyapi/type_conversion.c:302:2: note: in expansion of macro ‘STRING_TO_NUMBER_FACTORY’
STRING_TO_NUMBER_FACTORY(tpe)
^
../pyapi/type_conversion.c:316:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(oid, oid)
^
../pyapi/type_conversion.c: In function ‘pyobject_to_bit’:
../pyapi/type_conversion.c:291:24: error: passing argument 1 of ‘str_to_bit’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
return str_to_##type(PyUnicode_AsUTF8(ptr), 0, value);
^
../pyapi/type_conversion.c:313:2: note: in expansion of macro ‘PY_TO_’
PY_TO_(tpe, inttpe);
^
../pyapi/type_conversion.c:317:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(bit, bit)
^
../pyapi/type_conversion.c:209:6: note: expected ‘char *’ but argument is of type ‘const char *’
str str_to_##tpe(char *ptr, size_t maxsize, tpe *value)
^
../pyapi/type_conversion.c:302:2: note: in expansion of macro ‘STRING_TO_NUMBER_FACTORY’
STRING_TO_NUMBER_FACTORY(tpe)
^
../pyapi/type_conversion.c:317:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(bit, bit)
^
../pyapi/type_conversion.c: In function ‘pyobject_to_sht’:
../pyapi/type_conversion.c:291:24: error: passing argument 1 of ‘str_to_sht’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
return str_to_##type(PyUnicode_AsUTF8(ptr), 0, value);
^
../pyapi/type_conversion.c:313:2: note: in expansion of macro ‘PY_TO_’
PY_TO_(tpe, inttpe);
^
../pyapi/type_conversion.c:318:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(sht, sht)
^
../pyapi/type_conversion.c:209:6: note: expected ‘char *’ but argument is of type ‘const char *’
str str_to_##tpe(char *ptr, size_t maxsize, tpe *value)
^
../pyapi/type_conversion.c:302:2: note: in expansion of macro ‘STRING_TO_NUMBER_FACTORY’
STRING_TO_NUMBER_FACTORY(tpe)
^
../pyapi/type_conversion.c:318:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(sht, sht)
^
../pyapi/type_conversion.c: In function ‘pyobject_to_int’:
../pyapi/type_conversion.c:291:24: error: passing argument 1 of ‘str_to_int’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
return str_to_##type(PyUnicode_AsUTF8(ptr), 0, value);
^
../pyapi/type_conversion.c:313:2: note: in expansion of macro ‘PY_TO_’
PY_TO_(tpe, inttpe);
^
../pyapi/type_conversion.c:319:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(int, int)
^
../pyapi/type_conversion.c:209:6: note: expected ‘char *’ but argument is of type ‘const char *’
str str_to_##tpe(char *ptr, size_t maxsize, tpe *value)
^
../pyapi/type_conversion.c:302:2: note: in expansion of macro ‘STRING_TO_NUMBER_FACTORY’
STRING_TO_NUMBER_FACTORY(tpe)
^
../pyapi/type_conversion.c:319:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(int, int)
^
../pyapi/type_conversion.c: In function ‘pyobject_to_lng’:
../pyapi/type_conversion.c:291:24: error: passing argument 1 of ‘str_to_lng’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
return str_to_##type(PyUnicode_AsUTF8(ptr), 0, value);
^
../pyapi/type_conversion.c:313:2: note: in expansion of macro ‘PY_TO_’
PY_TO_(tpe, inttpe);
^
../pyapi/type_conversion.c:320:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(lng, lng)
^
../pyapi/type_conversion.c:209:6: note: expected ‘char *’ but argument is of type ‘const char *’
str str_to_##tpe(char *ptr, size_t maxsize, tpe *value)
^
../pyapi/type_conversion.c:302:2: note: in expansion of macro ‘STRING_TO_NUMBER_FACTORY’
STRING_TO_NUMBER_FACTORY(tpe)
^
../pyapi/type_conversion.c:320:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(lng, lng)
^
../pyapi/type_conversion.c: In function ‘pyobject_to_flt’:
../pyapi/type_conversion.c:291:24: error: passing argument 1 of ‘str_to_flt’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
return str_to_##type(PyUnicode_AsUTF8(ptr), 0, value);
^
../pyapi/type_conversion.c:313:2: note: in expansion of macro ‘PY_TO_’
PY_TO_(tpe, inttpe);
^
../pyapi/type_conversion.c:321:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(flt, lng)
^
../pyapi/type_conversion.c:209:6: note: expected ‘char *’ but argument is of type ‘const char *’
str str_to_##tpe(char *ptr, size_t maxsize, tpe *value)
^
../pyapi/type_conversion.c:302:2: note: in expansion of macro ‘STRING_TO_NUMBER_FACTORY’
STRING_TO_NUMBER_FACTORY(tpe)
^
../pyapi/type_conversion.c:321:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(flt, lng)
^
../pyapi/type_conversion.c: In function ‘pyobject_to_hge’:
../pyapi/type_conversion.c:291:24: error: passing argument 1 of ‘str_to_hge’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
return str_to_##type(PyUnicode_AsUTF8(ptr), 0, value);
^
../pyapi/type_conversion.c:313:2: note: in expansion of macro ‘PY_TO_’
PY_TO_(tpe, inttpe);
^
../pyapi/type_conversion.c:324:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(hge, hge)
^
../pyapi/type_conversion.c:209:6: note: expected ‘char *’ but argument is of type ‘const char *’
str str_to_##tpe(char *ptr, size_t maxsize, tpe *value)
^
../pyapi/type_conversion.c:302:2: note: in expansion of macro ‘STRING_TO_NUMBER_FACTORY’
STRING_TO_NUMBER_FACTORY(tpe)
^
../pyapi/type_conversion.c:324:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(hge, hge)
^
../pyapi/type_conversion.c: In function ‘pyobject_to_dbl’:
../pyapi/type_conversion.c:291:24: error: passing argument 1 of ‘str_to_dbl’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
return str_to_##type(PyUnicode_AsUTF8(ptr), 0, value);
^
../pyapi/type_conversion.c:313:2: note: in expansion of macro ‘PY_TO_’
PY_TO_(tpe, inttpe);
^
../pyapi/type_conversion.c:325:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(dbl, hge)
^
../pyapi/type_conversion.c:209:6: note: expected ‘char *’ but argument is of type ‘const char *’
str str_to_##tpe(char *ptr, size_t maxsize, tpe *value)
^
../pyapi/type_conversion.c:302:2: note: in expansion of macro ‘STRING_TO_NUMBER_FACTORY’
STRING_TO_NUMBER_FACTORY(tpe)
^
../pyapi/type_conversion.c:325:1: note: in expansion of macro ‘CONVERSION_FUNCTION_FACTORY’
CONVERSION_FUNCTION_FACTORY(dbl, hge)
^
type_conversion3.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-cast-function-type’ [-Werror]
cc1: error: unrecognized command line option ‘-Wno-format-truncation’ [-Werror]
cc1: all warnings being treated as errors_

@warmth1905
Copy link
Author

OS is ubuntu16.04; gcc version is 5.4.0. Thanks in advance.

@oksdolm
Copy link
Owner

oksdolm commented Aug 5, 2022

Hi,

Debian 4.9.210 is a prerequisite.

Best

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