IBM / data-broker

The Data Broker (DBR) is a distributed, in-memory container of key-value stores enabling applications in a workflow to exchange data through one or more shared namespaces. Thanks to a small set of primitives, applications in a workflow deployed in a (possibly) shared nothing distributed cluster, can easily share and exchange data and messages with a minimum effort. In- spired by the Linda coordination and communication model, the Data Broker provides a unified shared namespace to applications, which is independent from applications’ programming and communication model.
Apache License 2.0
19 stars 23 forks source link

build fails in Release mode #127

Open bhatiaharsh opened 4 years ago

bhatiaharsh commented 4 years ago

Hi,

I am able to successfully build the databroker, but that is possible only in the Debug mode. In the Release mode, I hit the following format conversion error. This error was introduced in gcc@7.1, so for newer compilers, the code will fail (I am using gcc@7.3.1.

Scanning dependencies of target backend_common_sge_test
[ 32%] Building C object backend/common/test/CMakeFiles/backend_common_sge_test.dir/backend_common_sge_test.c.o
In file included from /g/g92/bhatia4/repo/github/data-broker/backend/common/dbbe_api.h:30:0,
                 from /g/g92/bhatia4/repo/github/data-broker/test/test_utils.h:18,
                 from /g/g92/bhatia4/repo/github/data-broker/backend/common/test/backend_common_sge_test.c:18:
/g/g92/bhatia4/repo/github/data-broker/backend/common/test/backend_common_sge_test.c: In function 'test_serialize':
/g/g92/bhatia4/repo/github/data-broker/backend/common/sge.h:86:37: error: '
   ' directive output truncated writing 1 byte into a region of size 0 [-Werror=format-truncation=]
   int plen = snprintf( data, space, "%"PRId64"\n%d\n", dbBE_SGE_get_len( sge, sge_count ), sge_count );
                                     ^~~
/g/g92/bhatia4/repo/github/data-broker/backend/common/sge.h:86:47: note: format string is defined here
   int plen = snprintf( data, space, "%"PRId64"\n%d\n", dbBE_SGE_get_len( sge, sge_count ), sge_count );
                                               ^~
/g/g92/bhatia4/repo/github/data-broker/backend/common/sge.h:86:7: note: 'snprintf' output 6 bytes into a destination of size 2
   int plen = snprintf( data, space, "%"PRId64"\n%d\n", dbBE_SGE_get_len( sge, sge_count ), sge_count );
       ^~~~
/g/g92/bhatia4/repo/github/data-broker/backend/common/sge.h:107:36: error: '%ld' directive output truncated writing 2 bytes into a region of size 1 [-Werror=format-truncation=]
     plen = snprintf( data, space, "%ld\n", itemlen );
                                    ^~~
/g/g92/bhatia4/repo/github/data-broker/backend/common/sge.h:107:10: note: 'snprintf' output 4 bytes into a destination of size 1
     plen = snprintf( data, space, "%ld\n", itemlen );
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /g/g92/bhatia4/repo/github/data-broker/backend/common/test/backend_common_sge_test.c:18:0:
/g/g92/bhatia4/repo/github/data-broker/backend/common/test/backend_common_sge_test.c: In function 'test_header_extract':
/g/g92/bhatia4/repo/github/data-broker/test/test_utils.h:43:108: error: 'parsed' may be used uninitialized in this function [-Werror=maybe-uninitialized]
 #define TEST( function, expect ) ( (function)==(expect)? dbrTest_util_print( #function, #expect, "==", 0 ) : dbrTest_util_print( #function, #expect, "==", 1 ) )
                                                                                                            ^
/g/g92/bhatia4/repo/github/data-broker/backend/common/test/backend_common_sge_test.c:63:10: note: 'parsed' was declared here
   size_t parsed;
          ^~~~~~
cc1: all warnings being treated as errors
make[2]: *** [backend/common/test/CMakeFiles/backend_common_sge_test.dir/build.make:63: backend/common/test/CMakeFiles/backend_common_sge_test.dir/backend_common_sge_test.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:410: backend/common/test/CMakeFiles/backend_common_sge_test.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
lasch commented 4 years ago

Might have been fixed in commit 6a1db5d Will double check and report back.