[Pkg-ime-devel] Bug#750375: hime: Conflicting struct declarations of HIME_client_handle_S

Michael Tautschnig mt at debian.org
Mon Jun 2 23:40:35 UTC 2014


Package: hime
Version: 0.9.10-4
Usertags: goto-cc

During a rebuild of all Debian packages in a clean sid chroot (using cowbuilder
and 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.

[...]
gcc -Wl,-z,relro -shared -Wl,--as-needed -Wl,-soname,libhime-im-client.so.1 hime-im-client.o hime-send.o im-addr.o hime-conf.o util.o hime-crypt-fpic.o -lX11 -lglib-2.0 -o libhime-im-client.so.1.2.4 -L/usr/X11R6/lib

error: conflicting function declarations "hime_im_client_open"
old definition in module hime-im-client file hime-im-client.c line 285
struct HIME_client_handle_S * (struct _XDisplay *disp)
new definition in module hime-send file hime-im-client.h line 49
struct HIME_client_handle_S * (struct _XDisplay *)

reason for conflict in types listed below (struct/struct):
composite type component counts differ (10/11)
struct HIME_client_handle_S {
  signed int fd;
  unsigned int client_win;
  unsigned int input_style;
  XPoint spot_location;
  unsigned int flag;
  unsigned int <padding>;
  struct _XDisplay * disp;
  struct HIME_PASSWD * passwd;
  unsigned int seq;
  unsigned int <padding>;
}
struct HIME_client_handle_S {
  signed int fd;
  unsigned int <padding>;
  unsigned long int client_win;
  unsigned int input_style;
  XPoint spot_location;
  unsigned int flag;
  unsigned int <padding>;
  struct _XDisplay * disp;
  struct HIME_PASSWD * passwd;
  unsigned int seq;
  unsigned int <padding>;
}
Makefile:27: recipe for target 'libhime-im-client.so.1.2.4' failed
make[3]: *** [libhime-im-client.so.1.2.4] Error 64
make[3]: Leaving directory '/srv/jenkins-slave/workspace/sid-goto-cc-hime/hime-0.9.10/src/im-client'
Makefile:170: recipe for target 'im-client/libhime-im-client.so' failed
make[2]: *** [im-client/libhime-im-client.so] Error 2
make[2]: Leaving directory '/srv/jenkins-slave/workspace/sid-goto-cc-hime/hime-0.9.10/src'
Makefile:20: recipe for target 'all' failed
make[1]: *** [all] Error 1

Observe that additional padding is inserted in the second case as the client_win
field is of type unsigned long rather than of type unsigned int. Originally the
type of that field is "Window" that is a typedef name of the X11 headers. This
difference appears to be the result of having _XSERVER64 defined (for all
platforms!) in hime-im-client.c *only*:

http://sources.debian.net/src/hime/0.9.10-4/src/im-client/hime-im-client.c?hl=29#L28

It may, however, be the case that the code works correctly at this time as it
seems all operations on the struct are contained within hime-im-client.c. If
that is intentional, then the declaration of the struct should be removed from
the header file and be moved to hime-im-client.c only. Otherwise there may be
code that actually tries to access one of the struct's fields, which will fail
for all members other than the first one, fd, as the offsets will be different.

Best,
Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 859 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-ime-devel/attachments/20140603/b389783f/attachment.sig>


More information about the Pkg-ime-devel mailing list