Package: gphoto2
Version: 2.5.4-1
Usertags: goto-cc
Tags: upstream
Forwarded: https://sourceforge.net/p/gphoto/bugs/979/

During a rebuild of all Debian packages in a clean sid chroot (and
cowbuilder+pbuilder) the build failed with the following error. Please note that
we use our research compiler tool-chain (using tools from the cbmc package),
which permits extended reporting on type inconsistencies at link time.

[...]
libtool: link: gcc -I.. -I../gphoto2 -I/usr/include/gphoto2 
-I/usr/include/libexif -DLOCALEDIR=\"/usr/share/locale\" 
-D_GPHOTO2_INTERNAL_CODE -D_FORTIFY_SOURCE=2 -I/usr/local/include 
-I/usr/include -I/usr/include/libexif -I/usr/include -g -O2 -fstack-protector 
--param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall 
-Wmissing-declarations -Wmissing-prototypes -g -Wl,-z -Wl,relro -Wl,-z -Wl,defs 
-Wl,--as-needed -g -o gphoto2 gphoto2-gphoto2-cmd-capture.o 
gphoto2-gphoto2-cmd-config.o gphoto2-actions.o gphoto2-foreach.o 
gphoto2-gp-params.o gphoto2-spawnve.o gphoto2-main.o gphoto2-version.o 
gphoto2-range.o gphoto2-shell.o  -lgphoto2 -lgphoto2_port -L/usr/local/lib 
-lcdk -lncurses -L/usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libaa.so 
-ljpeg -lpthread -lexif -lreadline -L/usr/ /usr/lib/x86_64-linux-gnu/libpopt.so 
-lm

error: conflicting function declarations "mktime"
old definition in module gphoto2-cmd-config file /usr/include/time.h line 199
signed long int (struct tm *)
new definition in module actions file /usr/include/time.h line 199
signed long int (struct tm *)
Makefile:708: recipe for target 'gphoto2' failed
make[3]: *** [gphoto2] Error 64
make[3]: Leaving directory 
'/srv/jenkins-slave/workspace/sid-goto-cc-gphoto2/gphoto2-2.5.4/gphoto2'
Makefile:453: recipe for target 'all-recursive' failed

While these two declarations appear to be the same, the component names actually
differ (which makes them different types according to the C standard):

names of component 10 differ (__tm_gmtoff/tm_gmtoff)
struct tm {
  signed int tm_sec;
  signed int tm_min;
  signed int tm_hour;
  signed int tm_mday;
  signed int tm_mon;
  signed int tm_year;
  signed int tm_wday;
  signed int tm_yday;
  signed int tm_isdst;
  unsigned int $pad0;
  signed long int __tm_gmtoff;
  const char * __tm_zone;
}
struct tm {
  signed int tm_sec;
  signed int tm_min;
  signed int tm_hour;
  signed int tm_mday;
  signed int tm_mon;
  signed int tm_year;
  signed int tm_wday;
  signed int tm_yday;
  signed int tm_isdst;
  unsigned int $pad0;
  signed long int tm_gmtoff;
  const char * tm_zone;
}

This is caused by _XOPEN_SOURCE and _GNU_SOURCE being defined in a single file
only rather than on the compiler command line or in the common config.h file:

http://sources.debian.net/src/gphoto2/2.5.4-1/gphoto2/actions.c?hl=21,22,23

Best,
Michael

Attachment: pgpCKC6j9IBe0.pgp
Description: PGP signature

Reply via email to