GNOME Bugzilla – Bug 779089
Gexiv 0.10.4 fails to build on Debian 8 stable
Last modified: 2017-05-10 14:50:27 UTC
As the summary says, the latest pull of gexiv2 fails to build on my Debian Jessie stable setup. I'm building against exiv2-0.25 and am using a custom prefix, in case that helps. All make output is included below. Thanks in advance for your help resolving this! Making all in . make[1]: Entering directory '/home/ricky/bin/gexiv2' CXX gexiv2/libgexiv2_la-gexiv2-stream-io.lo gexiv2/gexiv2-stream-io.cpp: In member function 'virtual long int StreamIo::write(const byte*, long int)': gexiv2/gexiv2-stream-io.cpp:74:13: error: declaration of 'write' shadows a member of 'this' [-Werror=shadow] int write = MIN (write_count - written_bytes, G_MAXINT32); ^ gexiv2/gexiv2-stream-io.cpp: In member function 'virtual long int StreamIo::read(Exiv2::byte*, long int)': gexiv2/gexiv2-stream-io.cpp:182:13: error: declaration of 'read' shadows a member of 'this' [-Werror=shadow] int read = cb->Read (cb->handle, (char*)buf + read_bytes, 0, MIN (read_count - read_bytes, G_MAXINT32)); ^ cc1plus: all warnings being treated as errors Makefile:771: recipe for target 'gexiv2/libgexiv2_la-gexiv2-stream-io.lo' failed make[1]: *** [gexiv2/libgexiv2_la-gexiv2-stream-io.lo] Error 1 make[1]: Leaving directory '/home/ricky/bin/gexiv2' Makefile:969: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1
This is slightly weird because I also compile with -Wshadow and should see at least a warning
Can you make V=1 and paste the whole compiler line here?
Here's the info you asked for, Jens. Let me know if you need anything else. Making all in . make[1]: Entering directory '/home/ricky/bin/gexiv2' /bin/bash ./libtool --tag=CXX --mode=compile g++ -DPACKAGE_NAME=\"gexiv2\" -DPACKAGE_TARNAME=\"gexiv2\" -DPACKAGE_VERSION=\"0.10.4\" -DPACKAGE_STRING=\"gexiv2\ 0.10.4\" -DPACKAGE_BUGREPORT=\"https://bugzilla.gnome.org/enter_bug.cgi\?product=gexiv2\" -DPACKAGE_URL=\"https://wiki.gnome.org/Projects/gexiv2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSIZEOF_INT_P=8 -DARCH_X86=1 -DARCH_X86_64=1 -I. -I/home/ricky/bin/gimp-clean/install/include -I/home/ricky/bin/gimp-clean/install/include/glib-2.0 -I/home/ricky/bin/gimp-clean/install/lib/glib-2.0/include -I./gexiv2 -fno-strict-aliasing -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wno-overloaded-virtual -Wswitch-enum -Wswitch-default -Werror -Wno-suggest-attribute=format -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Wno-error=overloaded-virtual -O2 -g -pipe -nostdlib -shared -MT gexiv2/libgexiv2_la-gexiv2-stream-io.lo -MD -MP -MF gexiv2/.deps/libgexiv2_la-gexiv2-stream-io.Tpo -c -o gexiv2/libgexiv2_la-gexiv2-stream-io.lo `test -f 'gexiv2/gexiv2-stream-io.cpp' || echo './'`gexiv2/gexiv2-stream-io.cpp libtool: compile: g++ -DPACKAGE_NAME=\"gexiv2\" -DPACKAGE_TARNAME=\"gexiv2\" -DPACKAGE_VERSION=\"0.10.4\" "-DPACKAGE_STRING=\"gexiv2 0.10.4\"" "-DPACKAGE_BUGREPORT=\"https://bugzilla.gnome.org/enter_bug.cgi?product=gexiv2\"" -DPACKAGE_URL=\"https://wiki.gnome.org/Projects/gexiv2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSIZEOF_INT_P=8 -DARCH_X86=1 -DARCH_X86_64=1 -I. -I/home/ricky/bin/gimp-clean/install/include -I/home/ricky/bin/gimp-clean/install/include/glib-2.0 -I/home/ricky/bin/gimp-clean/install/lib/glib-2.0/include -I./gexiv2 -fno-strict-aliasing -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wno-overloaded-virtual -Wswitch-enum -Wswitch-default -Werror -Wno-suggest-attribute=format -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Wno-error=overloaded-virtual -O2 -g -pipe -nostdlib -MT gexiv2/libgexiv2_la-gexiv2-stream-io.lo -MD -MP -MF gexiv2/.deps/libgexiv2_la-gexiv2-stream-io.Tpo -c gexiv2/gexiv2-stream-io.cpp -fPIC -DPIC -o gexiv2/.libs/libgexiv2_la-gexiv2-stream-io.o gexiv2/gexiv2-stream-io.cpp: In member function 'virtual long int StreamIo::write(const byte*, long int)': gexiv2/gexiv2-stream-io.cpp:74:13: error: declaration of 'write' shadows a member of 'this' [-Werror=shadow] int write = MIN (write_count - written_bytes, G_MAXINT32); ^ gexiv2/gexiv2-stream-io.cpp: In member function 'virtual long int StreamIo::read(Exiv2::byte*, long int)': gexiv2/gexiv2-stream-io.cpp:182:13: error: declaration of 'read' shadows a member of 'this' [-Werror=shadow] int read = cb->Read (cb->handle, (char*)buf + read_bytes, 0, MIN (read_count - read_bytes, G_MAXINT32)); ^ cc1plus: all warnings being treated as errors Makefile:771: recipe for target 'gexiv2/libgexiv2_la-gexiv2-stream-io.lo' failed make[1]: *** [gexiv2/libgexiv2_la-gexiv2-stream-io.lo] Error 1 make[1]: Leaving directory '/home/ricky/bin/gexiv2' Makefile:969: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1
Apparently the gcc 4.9 on debian is more strict than 6.x on Ubuntu. Seen on Jessie as well, but fail to see it on Ubuntu
Created attachment 346668 [details] [review] Remove shadowing in StreamIO class Signed-off-by: Jens Georg <mail@jensge.org>
Attachment 346668 [details] pushed as 05a463b - Remove shadowing in StreamIO class
Thanks Jens! I noticed these during a Coverity scan of the RHEL package. This removes one item from my TODO list.