Message307444
Even a simple use of ternary operator instead of using if-else inside do-while to handle the macro like:
#define SET_DECODE_ERROR(NAME, LEN) \
pymain->err = ((LEN) == (size_t)-2) \
? _Py_INIT_USER_ERR("cannot decode " #NAME) \
: _Py_INIT_NO_MEMORY()
, throws the error `undeclared identifier pymain`:
gcc -c -Wno-unused-result -Wsign-compare -g -O0 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Modules/main.o Modules/main.c
Modules/main.c:899:20: error: use of undeclared identifier 'pymain'
return SET_DECODE_ERROR("PYTHONEXECUTABLE environment "
^
Modules/main.c:46:5: note: expanded from macro 'SET_DECODE_ERROR'
pymain->err = ((LEN) == (size_t)-2) \
^
1 error generated.
make: *** [Modules/main.o] Error 1
I'm still trying to figure out a solution for this. |
|
Date |
User |
Action |
Args |
2017-12-02 17:58:53 | CuriousLearner | set | recipients:
+ CuriousLearner, vstinner |
2017-12-02 17:58:53 | CuriousLearner | set | messageid: <1512237533.89.0.213398074469.issue32197@psf.upfronthosting.co.za> |
2017-12-02 17:58:53 | CuriousLearner | link | issue32197 messages |
2017-12-02 17:58:53 | CuriousLearner | create | |
|