After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 753698 - Conflicting return types (enum vs. int) of function gkm_secret_binary_read
Conflicting return types (enum vs. int) of function gkm_secret_binary_read
Status: RESOLVED FIXED
Product: gnome-keyring
Classification: Core
Component: pkcs11
git master
Other All
: Normal minor
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-08-17 00:14 UTC by mt
Modified: 2015-12-28 19:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description mt 2015-08-17 00:14:07 UTC
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 -shared  -fPIC -DPIC  .libs/gkm-secret-standalone.o  -Wl,--whole-archive ./.libs/libgkm-secret-store.a ./.libs/libgkm.a -Wl,--no-whole-archive  -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lgcrypt  -O2 -Wl,-z -Wl,relro -Wl,-O1 -Wl,-z -Wl,defs -Wl,--as-needed -pthread   -pthread -Wl,-soname -Wl,gkm-secret-store-standalone.so -Wl,-version-script -Wl,.libs/gkm-secret-store-standalone.ver -o .libs/gkm-secret-store-standalone.so

error: conflicting function declarations "gkm_secret_binary_read"
old definition in module gkm-secret-binary file pkcs11/secret-store/gkm-secret-binary.c line 850
signed int (struct _GkmSecretCollection *collection, struct _GkmSecretData *sdata, const void *data, unsigned long int n_data)
new definition in module gkm-secret-collection file pkcs11/secret-store/gkm-secret-binary.h line 29
GkmDataResult (struct _GkmSecretCollection *, struct _GkmSecretData *, const void *, unsigned long int)

Even though the compiler may actually implement the enum via a signed integer,
there is no such guarantee in the C standard. Even more problematic, however, is
the fact that function calling gkm_secret_binary_read will rely on the return
value being one of the enum values - but no such guarantee is provided by the
implementation.

Yet skimming the code it seems the implementation does use GkmDataResult
throughout, so likely just its declaration in gkm-secret-binary.c is wrong.

Best,
Michael
Comment 1 Cosimo Cecchi 2015-12-28 19:46:40 UTC
Thanks for the report, pushed a trivial fix.