tpm2-software/tpm2-tss

Make failure: json_object_object_add

matIRL opened this issue · 2 comments

matIRL commented

Any insight here:

Thank you!

src/tss2-fapi/ifapi_ima_eventlog.c:83:13: error: void value not ignored as it ought to be
if (json_object_object_add(jso, CONTENT, *jso_sub)) {
^~~~~~~~~~~~~~~~~~~~~~
src/tss2-fapi/ifapi_ima_eventlog.c: In function ‘add_uint8_ary_to_json’:
src/tss2-fapi/ifapi_ima_eventlog.c:110:9: error: void value not ignored as it ought to be
if (json_object_object_add(jso, jso_tag, jso_byte_string)) {
^~~~~~~~~~~~~~~~~~~~~~
src/tss2-fapi/ifapi_ima_eventlog.c: In function ‘add_string_to_json’:
src/tss2-fapi/ifapi_ima_eventlog.c:127:9: error: void value not ignored as it ought to be
if (json_object_object_add(jso, jso_tag, jso_string)) {
^~~~~~~~~~~~~~~~~~~~~~
src/tss2-fapi/ifapi_ima_eventlog.c: In function ‘add_number_to_json’:
src/tss2-fapi/ifapi_ima_eventlog.c:143:9: error: void value not ignored as it ought to be
if (json_object_object_add(jso, jso_tag, jso_number)) {
^~~~~~~~~~~~~~~~~~~~~~
src/tss2-fapi/ifapi_ima_eventlog.c: In function ‘set_ff_digest’:
src/tss2-fapi/ifapi_ima_eventlog.c:189:9: error: void value not ignored as it ought to be
if (json_object_object_add(jso_digest, "hashAlg", jso_digest_type)) {
^~~~~~~~~~~~~~~~~~~~~~
src/tss2-fapi/ifapi_ima_eventlog.c:200:9: error: void value not ignored as it ought to be
if (json_object_object_add(jso, "digests", jso_ary)) {
^~~~~~~~~~~~~~~~~~~~~~
src/tss2-fapi/ifapi_ima_eventlog.c: In function ‘event_header_json_cb’:
src/tss2-fapi/ifapi_ima_eventlog.c:414:9: error: void value not ignored as it ought to be
if (json_object_object_add(jso_digest, "hashAlg", jso_digest_type)) {
^~~~~~~~~~~~~~~~~~~~~~
src/tss2-fapi/ifapi_ima_eventlog.c:424:9: error: void value not ignored as it ought to be
if (json_object_object_add(*jso, "digests", jso_ary)) {
^~~~~~~~~~~~~~~~~~~~~~
CC src/tss2-fapi/src_tss2_policy_libtss2_policy_la-ifapi_helpers.lo
Makefile:18748: recipe for target 'src/tss2-fapi/src_tss2_policy_libtss2_policy_la-ifapi_ima_eventlog.lo' failed
make[1]: *** [src/tss2-fapi/src_tss2_policy_libtss2_policy_la-ifapi_ima_eventlog.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
src/tss2-fapi/ifapi_helpers.c: In function ‘ifapi_calculate_pcrs’:
src/tss2-fapi/ifapi_helpers.c:2237:29: error: implicit declaration of function ‘json_object_array_del_idx’; did you mean ‘json_object_array_get_idx’? [-Werror=implicit-function-declaration]
if (json_object_array_del_idx(jso_event_list, i_evt + 1,
^~~~~~~~~~~~~~~~~~~~~~~~~
json_object_array_get_idx
cc1: all warnings being treated as errors
Makefile:18762: recipe for target 'src/tss2-fapi/src_tss2_policy_libtss2_policy_la-ifapi_helpers.lo' failed
make[1]: *** [src/tss2-fapi/src_tss2_policy_libtss2_policy_la-ifapi_helpers.lo] Error 1
make[1]: Leaving directory '/home/mat/tpm2/tpm2-tss'
Makefile:10840: recipe for target 'all' failed
make: *** [all] Error 2

In json-c version 0.13 (from 2017) the function json_object_array_del_idx was added and the return type of json_object_object_add was changed.

Fixed by #2771 by checking for recent enough version of json-c