This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author CuriousLearner
Recipients CuriousLearner, vstinner
Date 2017-12-02.17:58:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512237533.89.0.213398074469.issue32197@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-12-02 17:58:53CuriousLearnersetrecipients: + CuriousLearner, vstinner
2017-12-02 17:58:53CuriousLearnersetmessageid: <1512237533.89.0.213398074469.issue32197@psf.upfronthosting.co.za>
2017-12-02 17:58:53CuriousLearnerlinkissue32197 messages
2017-12-02 17:58:53CuriousLearnercreate