https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104247

            Bug ID: 104247
           Summary: Compiler warnings on 32-bit system
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

I noticed these and similar warnings when building the current master on
i686-linux-gnu:

../../gcc/analyzer/constraint-manager.cc: In member function ‘void
ana::bounded_ranges_manager::log_stats(ana::logger*, bool) const’:
../../gcc/analyzer/constraint-manager.cc:1027:27: warning: format ‘%li’ expects
argument of type ‘long int’, but argument 4 has type ‘size_t’ {aka ‘unsigned
int’} [-Wformat=]
 1027 |   logger->log ("  # %s: %li", "ranges", m_map.elements ());
      |                         ~~^             ~~~~~~~~~~~~~~~~~
      |                           |                            |
      |                           long int                     size_t {aka
unsigned int}
      |                         %i
g++  -fno-PIE -c   -g -O2     -DIN_GCC -fPIC    -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common 
-DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include
-I../../gcc/../libcpp/include -I../../gcc/../libcody 
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber
-I../../gcc/../libbacktrace   -o x86-tune-sched-atom.o -MT
x86-tune-sched-atom.o -MMD -MP -MF ./.deps/x86-tune-sched-atom.TPo
../../gcc/config/i386/x86-tune-sched-atom.cc
g++  -fno-PIE -c   -g -O2     -DIN_GCC -fPIC    -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common 
-DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include
-I../../gcc/../libcpp/include -I../../gcc/../libcody 
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber
-I../../gcc/../libbacktrace   -o x86-tune-sched-core.o -MT
x86-tune-sched-core.o -MMD -MP -MF ./.deps/x86-tune-sched-core.TPo
../../gcc/config/i386/x86-tune-sched-core.cc
g++  -fno-PIE -c   -g -O2     -DIN_GCC -fPIC    -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common 
-DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include
-I../../gcc/../libcpp/include -I../../gcc/../libcody 
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber
-I../../gcc/../libbacktrace   -o i386-options.o -MT i386-options.o -MMD -MP -MF
./.deps/i386-options.TPo ../../gcc/config/i386/i386-options.cc
g++  -fno-PIE -c   -g -O2     -DIN_GCC -fPIC    -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common 
-DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include
-I../../gcc/../libcpp/include -I../../gcc/../libcody 
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber
-I../../gcc/../libbacktrace   -o i386-builtins.o -MT i386-builtins.o -MMD -MP
-MF ./.deps/i386-builtins.TPo ../../gcc/config/i386/i386-builtins.cc
../../gcc/analyzer/region-model-manager.cc: In instantiation of ‘void
ana::log_uniq_map(ana::logger*, bool, const char*, const hash_map<K, T*>&)
[with K = tree_node*; T = ana::constant_svalue]’:
../../gcc/analyzer/region-model-manager.cc:1626:16:   required from here
../../gcc/analyzer/region-model-manager.cc:1576:27: warning: format ‘%li’
expects argument of type ‘long int’, but argument 4 has type ‘size_t’ {aka
‘unsigned int’} [-Wformat=]
 1576 |   logger->log ("  # %s: %li", title, uniq_map.elements ());
      |                         ~~^          ~~~~~~~~~~~~~~~~~~~~
      |                           |                            |
      |                           long int                     size_t {aka
unsigned int}
      |                         %i
../../gcc/analyzer/region-model-manager.cc: In instantiation of ‘void
ana::log_uniq_map(ana::logger*, bool, const char*, const hash_map<K, T*>&)
[with K = tree_node*; T = ana::unknown_svalue]’:
../../gcc/analyzer/region-model-manager.cc:1627:16:   required from here
../../gcc/analyzer/region-model-manager.cc:1576:27: warning: format ‘%li’
expects argument of type ‘long int’, but argument 4 has type ‘size_t’ {aka
‘unsigned int’} [-Wformat=]
 1576 |   logger->log ("  # %s: %li", title, uniq_map.elements ());
      |                         ~~^          ~~~~~~~~~~~~~~~~~~~~
      |                           |                            |
      |                           long int                     size_t {aka
unsigned int}
      |                         %i
...

Reply via email to