TeaEngineering / libchronicle

Shared-memory interprocess communication from C using OpenHFT's chronicle-queue protocol
Apache License 2.0
14 stars 10 forks source link

Running make does not compile #8

Closed wsargent closed 3 years ago

wsargent commented 3 years ago

It looks like the k.h definition has changed in KxSystems/kdb and the code base no longer compiles:

❱ make 
wget https://raw.githubusercontent.com/KxSystems/kdb/master/c/c/k.h
--2020-09-12 14:57:10--  https://raw.githubusercontent.com/KxSystems/kdb/master/c/c/k.h
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.40.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.40.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4126 (4.0K) [text/plain]
Saving to: ‘k.h’

k.h                                      100%[===============================================================================>]   4.03K  --.-KB/s    in 0s      

2020-09-12 14:57:10 (91.9 MB/s) - ‘k.h’ saved [4126/4126]

gcc -o obj/hpet.so hpet.c -DKXVER=3 -fPIC -I. -Wall -std=gnu99 -shared
gcc -o obj/shmipc.so shmipc.c -DKXVER=3 -fPIC -I. -Wall -std=gnu99 -shared
gcc -o obj/shmmain shmmain.c -DKXVER=3 -fPIC -I. -Wall -std=gnu99 -g -O0
In file included from shmmain.c:18:0:
mock_k.h:62:3: error: conflicting types for ‘dl’
 K dl(void* fnptr, int n) {
   ^~
In file included from ./shmipc.c:32:0,
                 from shmmain.c:15:
./k.h:74:118: note: previous declaration of ‘dl’ was here
 extern K ee(K),ktj(I,J),ka(I),kb(I),kg(I),kh(I),ki(I),kj(J),ke(F),kf(F),kc(I),ks(S),kd(I),kz(F),kt(I),sd1(I,K(*)(I)),dl(V*f,J),
                                                                                                                      ^~
shmmain.c: In function ‘main’:
shmmain.c:199:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
    fprintf(tmp, "%lld %lld %lld\n", clock, bytes, r->j);
                  ~~~^
                  %ld
shmmain.c:214:24: warning: format ‘%lld’ expects argument of type ‘long long int *’, but argument 3 has type ‘uint64_t * {aka long unsigned int *}’ [-Wformat=]
    r = fscanf(tmp, "%lld %lld %lld\n", &clock, &bytes, &index);
                     ~~~^               ~~~~~~
                     %ld
shmmain.c:214:34: warning: format ‘%lld’ expects argument of type ‘long long int *’, but argument 5 has type ‘uint64_t * {aka long unsigned int *}’ [-Wformat=]
    r = fscanf(tmp, "%lld %lld %lld\n", &clock, &bytes, &index);
                               ~~~^                     ~~~~~~
                               %ld
shmmain.c:217:21: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
     printf(" did %lld %lld %lld\n", clock, bytes, index);
                  ~~~^
                  %ld
shmmain.c:217:31: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat=]
     printf(" did %lld %lld %lld\n", clock, bytes, index);
                            ~~~^
                            %ld
Makefile:31: recipe for target 'obj/shmmain' failed
make: *** [obj/shmmain] Error 1
shuckc commented 3 years ago

Yes you are right, Kx patched it https://github.com/KxSystems/kdb/commit/3ec0e38dc9cfa34168be8a3829bf910cc9832917 Thanks.