Skip to content

src/maxminddb.c:370:27: error: comparison of integer expressions of different signedness #486

Description

@robert-scheck

Building libmaxminddb 1.14.0 on Fedora Rawhide (becoming Fedora 46), building on 32 bit Intel/AMD ("i686") fails like this:

not ok 1 - -DMAXIMUM_DATA_STRUCTURE_DEPTH=1000 compiles without warnings
#   Failed test '-DMAXIMUM_DATA_STRUCTURE_DEPTH=1000 compiles without warnings'
#   at ./decoder_limits_t.pl line 70.
#          got: '1'
#     expected: '0'
# /builddir/build/BUILD/libmaxminddb-1.14.0-build/libmaxminddb-1.14.0/src/maxminddb.c: In function ‘MMDB_open’:
# /builddir/build/BUILD/libmaxminddb-1.14.0-build/libmaxminddb-1.14.0/src/maxminddb.c:370:27: error: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘int’} and ‘unsigned int’ [-Werror=sign-compare]
#   370 |     if (data_section_size > UINT32_MAX || data_section_size <= 0) {
#       |                           ^
# cc1: all warnings being treated as errors
not ok 2 - -DMAXIMUM_DATA_STRUCTURE_VALUES=1000000 compiles without warnings
#   Failed test '-DMAXIMUM_DATA_STRUCTURE_VALUES=1000000 compiles without warnings'
#   at ./decoder_limits_t.pl line 70.
#          got: '1'
#     expected: '0'
# /builddir/build/BUILD/libmaxminddb-1.14.0-build/libmaxminddb-1.14.0/src/maxminddb.c: In function ‘MMDB_open’:
# /builddir/build/BUILD/libmaxminddb-1.14.0-build/libmaxminddb-1.14.0/src/maxminddb.c:370:27: error: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘int’} and ‘unsigned int’ [-Werror=sign-compare]
#   370 |     if (data_section_size > UINT32_MAX || data_section_size <= 0) {
#       |                           ^
# cc1: all warnings being treated as errors

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions