Package: jcal
Version: 0.4.1-2
Usertags: goto-cc

During a rebuild of all 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.

[...]
/bin/bash ../libtool  --tag=CC   --mode=link x86_64-linux-gnu-gcc -Wall -g -O2 
-fno-inline -D_REENTRANT -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-Wall -g -O2  -Wl,-z,defs -o jdate jdate.o ../libjalali/libjalali.la 
libtool: link: x86_64-linux-gnu-gcc -Wall -g -O2 -fno-inline -D_REENTRANT -Wall 
-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wall -g -O2 -Wl,-z -Wl,defs -o 
.libs/jdate jdate.o  ../libjalali/.libs/libjalali.so

error: conflicting function declarations "gmtime_r"
old definition in module jdate file /usr/include/time.h line 249
struct tm * (const signed long int *, struct tm *)
new definition in module jtime file /usr/include/time.h line 249
struct tm * (const signed long int *, struct tm *)
Makefile:380: recipe for target 'jdate' failed

reason for conflict in types listed below (struct/struct):
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;
}
make[2]: *** [jdate] Error 64
make[2]: Leaving directory 
'/srv/jenkins-slave/workspace/sid-goto-cc-jcal/jcal-0.4.1/src'
Makefile:365: recipe for target 'all-recursive' failed

As the C standard states that compound types are only equal if the names of
fields match, the above permits undefined behaviour. This is all caused by
src/jdate.c having #define _XOPEN_SOURCE, while jtime.c does not have this. Such
a macro should be set on the compiler command line to ensure consistency
across all source files (in absence of a common header file).

Best,
Michael

Attachment: pgpONbOXXbo1F.pgp
Description: PGP signature

Reply via email to