Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcfu :: compilation error #58

Open
EricDeveaud opened this issue Jun 19, 2020 · 2 comments
Open

libcfu :: compilation error #58

EricDeveaud opened this issue Jun 19, 2020 · 2 comments

Comments

@EricDeveaud
Copy link

I'm trying to install Bamm from release tag 1.7.3 (https://github.com/Ecogenomics/BamM/archive/1.7.3.tar.gz)
on a centos-8.2 system, using gcc/9.2.0 and pythton/2.7.17

I have a compilation error while building libcfu

in order to have a smaller error log and for you to be abble to reproduce the problem
I've done the following

tar xf 1.7.3.tar.gz
cd BamM-1.7.3/c/libcfu
autoreconf -fiv
./configure
make

here is the errror I have

Making all in src
make[1]: Entering directory '/opt/gensoft/src/BamM/BamM-1.7.3/c/libcfu-0.03/src'
/opt/gensoft/exe/gcc/9.2.0/bin/gcc -DPACKAGE_NAME=\"libcfu\" -DPACKAGE_TARNAME=\"libcfu\" -DPACKAGE_VERSION=\"0.03\" -DPACKAGE_STRING=\"libcfu\ 0.03\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libcfu\" -DVERSION=\"0.03\" -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/\" -DSTDC_HEADERS=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -Dsize_t=unsigned\ int -DTIME_WITH_SYS_TIME=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=0 -Dmalloc=rpl_malloc -DHAVE_GETTIMEOFDAY=1 -DHAVE_MEMSET=1 -DHAVE_STRCASECMP=1 -DHAVE_STRNCASECMP=1 -I.  -I../include -I/opt/gensoft/exe/gcc/9.2.0/include -I/opt/gensoft/exe/libtool/2.4.6/include -I../include -std=gnu99 -W -pthread -g -fPIC -pthread -O2 -Wall -Wno-unused-but-set-variable -Wno-unused-function -pthread -g -O2 -MT cfuhash.o -MD -MP -MF .deps/cfuhash.Tpo -c -o cfuhash.o cfuhash.c
<command-line>: error: duplicate ‘unsigned’
<command-line>: error: two or more data types in declaration specifiers
cfuhash.c: In function ‘cfuhash_bencode_strings’:
cfuhash.c:879:28: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 4 has type ‘unsigned int’ [-Wformat=]
  879 |   snprintf(len_str, 32, "%zd:", (keys[i] ? strlen(keys[i]) : 0));
      |                          ~~^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            |                               |
      |                            long int                        unsigned int
      |                          %d
cfuhash.c:884:28: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 4 has type ‘unsigned int’ [-Wformat=]
  884 |   snprintf(len_str, 32, "%zd:", (val ? strlen(val) : 0));
      |                          ~~^    ~~~~~~~~~~~~~~~~~~~~~~~
      |                            |                       |
      |                            long int                unsigned int
      |                          %d
make[1]: *** [Makefile:431: cfuhash.o] Error 1

loog int vs unsigned int is not a prpble to fix using a cast, but I'm not abble to track down the duplicate unsigned error

can you help. ?

regards

Eric

@EricDeveaud
Copy link
Author

FIY libcfu-0.0.3 from sourceforge: https://sourceforge.net/projects/libcfu/files/libcfu/libcfu-0.03/libcfu-0.03.tar.gz

compiles fine on the same system unsing the same tools, libcfu.a is generated
examples compilation fails on hash_usage.c

hash_usage.c:39:33: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=]
   39 |   sprintf(list[i][0], "test_var%d", i);
      |                                ~^   ~
      |                                 |   |
      |                                 int size_t {aka long unsigned int}
      |                                %ld
hash_usage.c:40:30: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=]
   40 |   sprintf(list[i][1], "value%d", i);
      |                             ~^   ~
      |                              |   |
      |                              int size_t {aka long unsigned int}
      |                             %ld

etc etc....

eric

@wwood
Copy link
Contributor

wwood commented Jun 24, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants