-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Warnings on the current main branch #108562
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
Comments
On macos it produces a different result: » ./configure -q && make -s
Python/optimizer.c:388:9: warning: variable 'reserved' set but not used [-Wunused-but-set-variable]
int reserved = 0;
^
1 warning generated.
Note: Deepfreeze may have added some global objects,
so run 'make regen-global-objects' if necessary.
./Modules/readline.c:1257:21: warning: incompatible function pointer types assigning to 'Function *' (aka 'int (*)(const char *, int)') from 'int (void)' [-Wincompatible-function-pointer-types]
rl_startup_hook = on_startup_hook;
^ ~~~~~~~~~~~~~~~
./Modules/readline.c:1259:23: warning: incompatible function pointer types assigning to 'Function *' (aka 'int (*)(const char *, int)') from 'int (void)' [-Wincompatible-function-pointer-types]
rl_pre_input_hook = on_pre_input_hook;
^ ~~~~~~~~~~~~~~~~~
2 warnings generated.
Undefined symbols for architecture arm64:
"__Py_DECREF_DecRefTotal", referenced from:
_test_open_code_hook in _testembed.o
_test_unicode_id_init in _testembed.o
_Py_DECREF in _testembed.o
"__Py_NegativeRefcount", referenced from:
_test_open_code_hook in _testembed.o
_test_unicode_id_init in _testembed.o
_Py_DECREF in _testembed.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Programs/_testembed] Error 1 |
@sobolevn, in my case the build was successful. I did update of the bugreport in case it wasn't clear. |
The libmpdec warning is a false positive due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113664 libmpdec very much supports strict overflow, so adding |
@skrah, maybe I miss something, but with $ ./configure -q --with-strict-overflow && make -s
In function ‘word_to_string’,
inlined from ‘coeff_to_string’ at ./Modules/_decimal/libmpdec/io.c:410:13,
inlined from ‘_mpd_to_string’ at ./Modules/_decimal/libmpdec/io.c:611:18:
./Modules/_decimal/libmpdec/io.c:348:40: warning: array subscript 0 is outside array bounds of ‘char[0]’ [-Warray-bounds]
348 | if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:355:14: note: in expansion of macro ‘EXTRACT_DIGIT’
355 | case 19: EXTRACT_DIGIT(s, x, 1000000000000000000ULL, dot);
| ^~~~~~~~~~~~~
In function ‘word_to_string’,
inlined from ‘coeff_to_string’ at ./Modules/_decimal/libmpdec/io.c:410:13,
inlined from ‘_mpd_to_string’ at ./Modules/_decimal/libmpdec/io.c:607:18:
./Modules/_decimal/libmpdec/io.c:348:40: warning: array subscript 0 is outside array bounds of ‘char[0]’ [-Warray-bounds]
348 | if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:355:14: note: in expansion of macro ‘EXTRACT_DIGIT’
355 | case 19: EXTRACT_DIGIT(s, x, 1000000000000000000ULL, dot);
| ^~~~~~~~~~~~~
In function ‘word_to_string’,
inlined from ‘coeff_to_string’ at ./Modules/_decimal/libmpdec/io.c:410:13,
inlined from ‘_mpd_to_string’ at ./Modules/_decimal/libmpdec/io.c:501:22:
./Modules/_decimal/libmpdec/io.c:348:40: warning: array subscript 0 is outside array bounds of ‘char[0]’ [-Warray-bounds]
348 | if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:355:14: note: in expansion of macro ‘EXTRACT_DIGIT’
355 | case 19: EXTRACT_DIGIT(s, x, 1000000000000000000ULL, dot);
| ^~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:348:40: warning: array subscript 0 is outside array bounds of ‘char[0]’ [-Warray-bounds]
348 | if (s == dot) *s++ = '.'; *s++ = '0' + (char)(x / d); x %= d
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
./Modules/_decimal/libmpdec/io.c:356:14: note: in expansion of macro ‘EXTRACT_DIGIT’
356 | case 18: EXTRACT_DIGIT(s, x, 100000000000000000ULL, dot);
| ^~~~~~~~~~~~~
Checked 110 modules (33 built-in, 76 shared, 1 n/a on linux-x86_64, 0 disabled, 0 missing, 0 failed on import) PS: $ gcc --version
gcc (Debian 12.2.0-14) 12.2.0 |
Indeed, that is another false positive ( As explained in the linked gcc issue, the exact warning emitted depends on what path the optimizer takes. If you compile
|
This patch enable (if awailable) -fstrict-overflow for libmpdec and also shut off false positive warnings (-Warray-bounds). The later part was backported from mpdecimal-4.0.0.
This patch enable (if awailable) -fstrict-overflow for libmpdec and also shut off false positive warnings (-Warray-bounds). The later part was backported from mpdecimal-4.0.0.
Thanks, that part was backported. See full patch: #114751 |
If awailable, enable -fstrict-overflow for libmpdec. Also shut off false positive warnings (-Warray-bounds). The later was backported from mpdecimal-4.0.0.
When this PR was merged, LTO buildbots started failing. See for example: https://buildbot.python.org/all/#/builders/29/builds/5844 |
Yes, unless I find a quick fix. |
Reverts -fstrict-overflow for libmpdec
#116302 - a partial revert Maybe in this case we could just ignore -Wstringop-overflow on EXTRACT_DIGIT (not in the whole file!)? From discussion in the gcc issue this looks safe. |
deadsnakes 3.13 nightly builds are also failing presumably due to this change as well: https://github.com/deadsnakes/python3.13-nightly/actions/runs/8129022227/job/22215614577
|
If awailable, enable -fstrict-overflow for libmpdec. Also shut off false positive warnings (-Warray-bounds). The later was backported from mpdecimal-4.0.0.
…onGH-116302) pythongh-108562: partial reversion of pr114751 Reverts -fstrict-overflow for libmpdec
Alternative fix: #116346
I think so: https://github.com/deadsnakes/python3.13-nightly/actions/runs/8153413773 |
Thanks for the heads-up, Sergey! Closing as resolved. |
@erlend-aasland, warnings in the main are present. I think this issue isn't solved. |
If awailable, enable -fstrict-overflow for libmpdec. Also shut off false positive warnings (-Warray-bounds). The later was backported from mpdecimal-4.0.0.
…onGH-116302) pythongh-108562: partial reversion of pr114751 Reverts -fstrict-overflow for libmpdec
If awailable, enable -fstrict-overflow for libmpdec. Also shut off false positive warnings (-Warray-bounds). The later was backported from mpdecimal-4.0.0.
…onGH-116302) pythongh-108562: partial reversion of pr114751 Reverts -fstrict-overflow for libmpdec
@erlend-aasland, this should be fixed if we update bundled mpdecimal to v4. Does it make sense for you? |
Aren't we trying to unbundle mpdecimal? :) |
Yes, but Debian people removed mpdecimal. UPD: ah, no. v4.0.0 doesn't include #116346 |
Right, What's New in Python 3.13 says:
|
Bug report
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.13.0a0 (main, Aug 28 2023, 13:54:29) [GCC 12.2.0]
A clear and concise description of the bug:
With
Build is successful, but I see a bunch of warnings:
N.B. second type of warnings (expansions of EXTRACT_DIGIT) seems to be related to the gcc-12. The first I've seen on the Debian Buster (with gcc-10 per default).
Linked PRs
The text was updated successfully, but these errors were encountered: