• Benjamin Peterson's avatar
    fix up signedness in PyImport_ExtendInittab (#4831) · 0c644fcd
    Benjamin Peterson yazdı
    As a result of 92a3c6f4, the compiler complains:
    
    Python/import.c:2311:21: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
        if ((i + n + 1) <= PY_SSIZE_T_MAX / sizeof(struct _inittab)) {
             ~~~~~~~~~  ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    This overflow is extremely unlikely to happen, but let's avoid undefined
    behavior anyway.
    0c644fcd
import.c 63.9 KB