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 tzickel
Recipients tzickel
Date 2018-07-31.19:25:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533065115.7.0.56676864532.issue34300@psf.upfronthosting.co.za>
In-reply-to
Content
When compiling on ubuntu 18.04 the 2.7 branch, I get this warning:

gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -DPYTHONPATH='":plat-linux2:lib-tk:lib-old"' \
        -DPREFIX='"/usr/local"' \
        -DEXEC_PREFIX='"/usr/local"' \
        -DVERSION='"2.7"' \
        -DVPATH='""' \
        -o Modules/getpath.o ./Modules/getpath.c
In file included from /usr/include/string.h:494:0,
                 from Include/Python.h:38,
                 from ./Modules/getpath.c:3:
In function 'strncpy',
    inlined from 'joinpath' at ./Modules/getpath.c:202:5,
    inlined from 'search_for_prefix' at ./Modules/getpath.c:265:9,
    inlined from 'calculate_path' at ./Modules/getpath.c:505:8:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: '__builtin_strncpy': specified size between 9223372036854779906 and 18446744073709551615 exceeds maximum object size
9223372036854775807 [-Wstringop-overflow=]
   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
          ^~----

I think it's because the compiler can't reason that Py_FatalError aborts the program, and thus not overflow strncpy.

Since there are about 3-4 warnings while building, maybe we should add a manual return after Py_FatalError in joinpath ?
History
Date User Action Args
2018-07-31 19:25:15tzickelsetrecipients: + tzickel
2018-07-31 19:25:15tzickelsetmessageid: <1533065115.7.0.56676864532.issue34300@psf.upfronthosting.co.za>
2018-07-31 19:25:15tzickellinkissue34300 messages
2018-07-31 19:25:15tzickelcreate