diff --git a/cmake/Modules/CUnit/src/main.c.in b/cmake/Modules/CUnit/src/main.c.in index 37bd1363e9..641e76ebf2 100644 --- a/cmake/Modules/CUnit/src/main.c.in +++ b/cmake/Modules/CUnit/src/main.c.in @@ -79,28 +79,28 @@ static int patmatch(const char *pat, const char *str) static void usage(const char *name) { - fprintf(stderr, "Usage: %s OPTIONS\n", name); - fprintf(stderr, "Try '%s -h' for more information\n", name); + (void) fprintf(stderr, "Usage: %s OPTIONS\n", name); + (void) fprintf(stderr, "Try '%s -h' for more information\n", name); } static void help(const char *name) { - printf("Usage: %s [OPTIONS]\n", name); - printf("\n"); - printf("Possible options:\n"); - printf(" -a run in automated mode\n"); - printf(" -f fail fast\n"); - printf(" -h display this help and exit\n"); - printf(" -j junit format results \n"); - printf(" -r FILENAME results file for automated run\n"); - printf(" -s PATTERN run only tests in suites matching pattern\n"); - printf(" -t PATTERN run only test matching pattern\n"); - printf("\n"); - printf("Exit codes:\n"); - printf(" %-2d Successful termination\n", EXIT_SUCCESS); - printf(" %-2d One or more failing test cases\n", EXIT_FAILURE); - printf(" %-2d Command line usage error\n", EX_USAGE); - printf(" %-2d Internal software error\n", EX_SOFTWARE); + (void) printf("Usage: %s [OPTIONS]\n", name); + (void) printf("\n"); + (void) printf("Possible options:\n"); + (void) printf(" -a run in automated mode\n"); + (void) printf(" -f fail fast\n"); + (void) printf(" -h display this help and exit\n"); + (void) printf(" -j junit format results \n"); + (void) printf(" -r FILENAME results file for automated run\n"); + (void) printf(" -s PATTERN run only tests in suites matching pattern\n"); + (void) printf(" -t PATTERN run only test matching pattern\n"); + (void) printf("\n"); + (void) printf("Exit codes:\n"); + (void) printf(" %-2d Successful termination\n", EXIT_SUCCESS); + (void) printf(" %-2d One or more failing test cases\n", EXIT_FAILURE); + (void) printf(" %-2d Command line usage error\n", EX_USAGE); + (void) printf(" %-2d Internal software error\n", EX_SOFTWARE); } static int parse_options(int argc, char *argv[]) @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) help(argv[0]); return ret; } else if (CU_initialize_registry() != CUE_SUCCESS) { - fprintf(stderr, "CU_initialize_registry: %s\n", CU_get_error_msg()); + (void) fprintf(stderr, "CU_initialize_registry: %s\n", CU_get_error_msg()); return EX_SOFTWARE; } diff --git a/compat/getopt.c b/compat/getopt.c index e1953174ec..0df7e73704 100644 --- a/compat/getopt.c +++ b/compat/getopt.c @@ -27,7 +27,7 @@ static const char Id[] = "$Id: os_stdlib_getopt.c,v 1.2 2008-11-17 09:53:45 hans * However, I am not about to post a copy of anything licensed by AT&T. */ -#define ERR(szz,czz) if(opterr){fprintf(stderr,"%s%s%c\n",argv[0],szz,czz);} +#define ERR(szz,czz) if(opterr){(void) fprintf(stderr,"%s%s%c\n",argv[0],szz,czz);} int opterr = 1; int optind = 1; diff --git a/docs/manual/config/config_file_reference.rst b/docs/manual/config/config_file_reference.rst index f541676525..234ebe6444 100644 --- a/docs/manual/config/config_file_reference.rst +++ b/docs/manual/config/config_file_reference.rst @@ -2677,9 +2677,9 @@ The default value is: "none". generated from ddsi_cfgelems.h[11913cd398f1cd1b52e06d924718df62a5981beb] generated from ddsi_config.c[ed9898f72f9dbcfa20ce7706835da091efcea0ca] generated from _confgen.h[f2d235d5551cbf920a8a2962831dddeabd2856ac] - generated from _confgen.c[1193219ddb4769b90566cf197e73d22fb6f75835] - generated from generate_rnc.c[a2ec6e48d33ac14a320c8ec3f320028a737920e0] - generated from generate_md.c[a61b6a9649d18afeca4c73b5784f36989d7994e0] - generated from generate_rst.c[34dcb6b5e2ac2cd15e78497107ce0b6eed6e6e94] - generated from generate_xsd.c[45064e8869b3c00573057d7c8f02d20f04b40e16] - generated from generate_defconfig.c[eec9ab7b2d053e68500799b693d089e84153a37b] + generated from _confgen.c[c23ec2e896226a424a21f1a4b343cb780056f52e] + generated from generate_rnc.c[79379fcd8615d777c20c0c0324547bfdcc180c60] + generated from generate_md.c[f3669b494645cfff74758b587b4a552910901378] + generated from generate_rst.c[1e95348d13f06a441bc0cef8731e4ffeb99cad1a] + generated from generate_xsd.c[22ae895de728df202f681642178300f14102af65] + generated from generate_defconfig.c[e2f6526ef516323caa0b0f497c493f69d02a40ff] diff --git a/docs/manual/getting_started/c_tutorial/anatomy_hello_world.part.rst b/docs/manual/getting_started/c_tutorial/anatomy_hello_world.part.rst index f2aae7ad91..acf84902b9 100644 --- a/docs/manual/getting_started/c_tutorial/anatomy_hello_world.part.rst +++ b/docs/manual/getting_started/c_tutorial/anatomy_hello_world.part.rst @@ -262,7 +262,7 @@ The subscriber application implements the steps defined in :ref:`the Key Steps < DDS_ERR_CHECK (reader, DDS_CHECK_REPORT | DDS_CHECK_EXIT); dds_delete_qos(qos); - printf ("\n=== [Subscriber] Waiting for a sample ...\n"); + (void) printf ("\n=== [Subscriber] Waiting for a sample ...\n"); /* Initialize the sample buffer, by pointing the void pointer within * the buffer array to a valid sample memory location. */ @@ -281,8 +281,8 @@ The subscriber application implements the steps defined in :ref:`the Key Steps < { /* Print Message. */ msg = (HelloWorldData_Msg*) samples[0]; - printf ("=== [Subscriber] Received : "); - printf ("Message (%d, %s)\n", msg->userID, msg->message); + (void) printf ("=== [Subscriber] Received : "); + (void) printf ("Message (%d, %s)\n", msg->userID, msg->message); break; } else @@ -412,8 +412,8 @@ data type and display the contents. .. code-block:: C msg = (HelloWorldData_Msg*) samples[0]; - printf ("=== [Subscriber] Received : "); - printf ("Message (%d, %s)\n", msg->userID, msg->message); + (void) printf ("=== [Subscriber] Received : "); + (void) printf ("Message (%d, %s)\n", msg->userID, msg->message); break; When data is received and the polling loop is stopped, we release the @@ -422,7 +422,7 @@ allocated memory and delete the domain participant. .. code-block:: C HelloWorldData_Msg_free (samples[0], DDS_FREE_ALL); - dds_delete (participant); + (void) dds_delete (participant); All the entities that are created under the participant, such as the data reader and topic, are recursively deleted. @@ -471,7 +471,7 @@ subscriber program in any order. /* Create a Writer. */ writer = dds_create_writer (participant, topic, NULL, NULL); - printf("=== [Publisher] Waiting for a reader to be discovered ...\n"); + (void) printf("=== [Publisher] Waiting for a reader to be discovered ...\n"); ret = dds_set_status_mask(writer, DDS_PUBLICATION_MATCHED_STATUS); DDS_ERR_CHECK (ret, DDS_CHECK_REPORT | DDS_CHECK_EXIT); @@ -493,8 +493,8 @@ subscriber program in any order. msg.userID = 1; msg.message = "Hello World"; - printf ("=== [Publisher] Writing : "); - printf ("Message (%d, %s)\n", msg.userID, msg.message); + (void) printf ("=== [Publisher] Writing : "); + (void) printf ("Message (%d, %s)\n", msg.userID, msg.message); ret = dds_write (writer, &msg); DDS_ERR_CHECK (ret, DDS_CHECK_REPORT | DDS_CHECK_EXIT); diff --git a/docs/manual/options.md b/docs/manual/options.md index 116499b3f6..63634137ee 100644 --- a/docs/manual/options.md +++ b/docs/manual/options.md @@ -1877,9 +1877,9 @@ The default value is: "none". - - - - - - + + + + + + diff --git a/etc/cyclonedds.rnc b/etc/cyclonedds.rnc index 4f0283ab5d..b88c84cb05 100644 --- a/etc/cyclonedds.rnc +++ b/etc/cyclonedds.rnc @@ -1304,9 +1304,9 @@ MIIEpAIBAAKCAQEA3HIh...AOBaaqSV37XBUJg==
# generated from ddsi_cfgelems.h[11913cd398f1cd1b52e06d924718df62a5981beb] # generated from ddsi_config.c[ed9898f72f9dbcfa20ce7706835da091efcea0ca] # generated from _confgen.h[f2d235d5551cbf920a8a2962831dddeabd2856ac] -# generated from _confgen.c[1193219ddb4769b90566cf197e73d22fb6f75835] -# generated from generate_rnc.c[a2ec6e48d33ac14a320c8ec3f320028a737920e0] -# generated from generate_md.c[a61b6a9649d18afeca4c73b5784f36989d7994e0] -# generated from generate_rst.c[34dcb6b5e2ac2cd15e78497107ce0b6eed6e6e94] -# generated from generate_xsd.c[45064e8869b3c00573057d7c8f02d20f04b40e16] -# generated from generate_defconfig.c[eec9ab7b2d053e68500799b693d089e84153a37b] +# generated from _confgen.c[c23ec2e896226a424a21f1a4b343cb780056f52e] +# generated from generate_rnc.c[79379fcd8615d777c20c0c0324547bfdcc180c60] +# generated from generate_md.c[f3669b494645cfff74758b587b4a552910901378] +# generated from generate_rst.c[1e95348d13f06a441bc0cef8731e4ffeb99cad1a] +# generated from generate_xsd.c[22ae895de728df202f681642178300f14102af65] +# generated from generate_defconfig.c[e2f6526ef516323caa0b0f497c493f69d02a40ff] diff --git a/etc/cyclonedds.xsd b/etc/cyclonedds.xsd index 3764d0991c..b0bb6c292c 100644 --- a/etc/cyclonedds.xsd +++ b/etc/cyclonedds.xsd @@ -1977,9 +1977,9 @@ MIIEpAIBAAKCAQEA3HIh...AOBaaqSV37XBUJg==<br> - - - - - - + + + + + + diff --git a/examples/dynsub/dynsub.c b/examples/dynsub/dynsub.c index 2f98ae55cd..56a9c9a7e6 100644 --- a/examples/dynsub/dynsub.c +++ b/examples/dynsub/dynsub.c @@ -131,12 +131,12 @@ static void build_typecache_ti (const DDS_XTypes_TypeIdentifier *typeid, size_t build_typecache_to (&xtypeobj->_u.complete, align, size); info = malloc (sizeof (*info)); *info = (struct typeinfo){ .key = { .key = (uintptr_t) typeid }, .typeobj = &xtypeobj->_u.complete, .release = xtypeobj, .align = *align, .size = *size }; - ddsrt_hh_add (typecache, info); + (void)ddsrt_hh_add (typecache, info); } break; } default: - printf ("type id discriminant %u encountered, sorry\n", (unsigned) typeid->_d); + (void) printf ("type id discriminant %u encountered, sorry\n", (unsigned) typeid->_d); abort (); } } @@ -177,12 +177,12 @@ static void build_typecache_to (const DDS_XTypes_CompleteTypeObject *typeobj, si *size += *align - (*size % *align); info = malloc (sizeof (*info)); *info = (struct typeinfo){ .key = { .key = (uintptr_t) typeobj }, .typeobj = typeobj, .release = NULL, .align = *align, .size = *size }; - ddsrt_hh_add (typecache, info); + (void)ddsrt_hh_add (typecache, info); } break; } default: { - printf ("type object discriminant %u encountered, sorry\n", (unsigned) typeobj->_d); + (void) printf ("type object discriminant %u encountered, sorry\n", (unsigned) typeobj->_d); abort (); } } @@ -232,21 +232,21 @@ static bool print_sample1_simple (const unsigned char *sample, const uint8_t dis { #define CASE(disc, type, fmt) DDS_XTypes_TK_##disc: { \ const type *p = (const type *) align (sample, c, _Alignof(type), sizeof(type)); \ - if (c->key || c->valid_data) { printf ("%s", sep); if (label) printf ("\"%s\":", label); fmt; } \ + if (c->key || c->valid_data) { (void) printf ("%s", sep); if (label) (void) printf ("\"%s\":", label); fmt; } \ return true; \ } - case CASE(BOOLEAN, uint8_t, printf ("%s", *p ? "true" : "false")); - case CASE(CHAR8, int8_t, printf ("\"%c\"", (char) *p)); - case CASE(INT16, int16_t, printf ("%"PRId16, *p)); - case CASE(INT32, int32_t, printf ("%"PRId32, *p)); - case CASE(INT64, int64_t, printf ("%"PRId64, *p)); - case CASE(BYTE, uint8_t, printf ("%"PRIu8, *p)); - case CASE(UINT16, uint16_t, printf ("%"PRIu16, *p)); - case CASE(UINT32, uint32_t, printf ("%"PRIu32, *p)); - case CASE(UINT64, uint64_t, printf ("%"PRIu64, *p)); - case CASE(FLOAT32, float, printf ("%f", *p)); - case CASE(FLOAT64, double, printf ("%f", *p)); - case CASE(STRING8, char *, printf ("\"%s\"", *p)); + case CASE(BOOLEAN, uint8_t, (void) printf ("%s", *p ? "true" : "false")); + case CASE(CHAR8, int8_t, (void) printf ("\"%c\"", (char) *p)); + case CASE(INT16, int16_t, (void) printf ("%"PRId16, *p)); + case CASE(INT32, int32_t, (void) printf ("%"PRId32, *p)); + case CASE(INT64, int64_t, (void) printf ("%"PRId64, *p)); + case CASE(BYTE, uint8_t, (void) printf ("%"PRIu8, *p)); + case CASE(UINT16, uint16_t, (void) printf ("%"PRIu16, *p)); + case CASE(UINT32, uint32_t, (void) printf ("%"PRIu32, *p)); + case CASE(UINT64, uint64_t, (void) printf ("%"PRIu64, *p)); + case CASE(FLOAT32, float, (void) printf ("%f", *p)); + case CASE(FLOAT64, double, (void) printf ("%f", *p)); + case CASE(STRING8, char *, (void) printf ("\"%s\"", *p)); #undef CASE } return false; @@ -263,9 +263,9 @@ static void print_sample1_ti (const unsigned char *sample, const DDS_XTypes_Type const char **p = (const char **) align (sample, c, _Alignof (char *), sizeof (char *)); if (c->key || c->valid_data) { - printf ("%s", sep); - if (label) printf ("\"%s\":", label); - printf ("\"%s\"", *p); + (void) printf ("%s", sep); + if (label) (void) printf ("\"%s\":", label); + (void) printf ("\"%s\"", *p); } break; } @@ -276,16 +276,16 @@ static void print_sample1_ti (const unsigned char *sample, const DDS_XTypes_Type if (c->key || c->valid_data) { struct context c1 = *c; c1.offset = 0; c1.maxalign = 1; - printf ("%s", sep); - if (label) printf ("\"%s\":", label); - printf ("["); + (void) printf ("%s", sep); + if (label) (void) printf ("\"%s\":", label); + (void) printf ("["); sep = ""; for (uint32_t i = 0; i < p->_length; i++) { print_sample1_ti (p->_buffer, et, &c1, sep, NULL); sep = ","; } - printf ("]"); + (void) printf ("]"); } break; } @@ -307,9 +307,9 @@ static void print_sample1_to (const unsigned char *sample, const DDS_XTypes_Comp const DDS_XTypes_TypeIdentifier *et = &typeobj->_u.sequence_type.element.common.type; const dds_sequence_t *p = align (sample, c, _Alignof (dds_sequence_t), sizeof (dds_sequence_t)); struct context c1 = *c; c1.offset = 0; c1.maxalign = 1; - printf ("%s", sep); - if (label) printf ("\"%s\":", label); - printf ("["); + (void) printf ("%s", sep); + if (label) (void) printf ("\"%s\":", label); + (void) printf ("["); sep = ""; for (uint32_t i = 0; i < p->_length; i++) { @@ -318,16 +318,16 @@ static void print_sample1_to (const unsigned char *sample, const DDS_XTypes_Comp if (c1.offset % c1.maxalign) c1.offset += c1.maxalign - (c1.offset % c1.maxalign); } - printf ("]"); + (void) printf ("]"); break; } case DDS_XTypes_TK_STRUCTURE: { struct typeinfo templ = { .key = { .key = (uintptr_t) typeobj } }, *info = ddsrt_hh_lookup (typecache, &templ); const DDS_XTypes_CompleteStructType *t = &typeobj->_u.struct_type; const unsigned char *p = align (sample, c, info->align, info->size);; - printf ("%s", sep); - if (label) printf ("\"%s\":", label); - printf ("{"); + (void) printf ("%s", sep); + if (label) (void) printf ("\"%s\":", label); + (void) printf ("{"); sep = ""; struct context c1 = *c; c1.offset = 0; c1.maxalign = 1; for (uint32_t i = 0; i < t->member_seq._length; i++) @@ -337,7 +337,7 @@ static void print_sample1_to (const unsigned char *sample, const DDS_XTypes_Comp print_sample1_ti (p, &m->common.member_type_id, &c1, sep, *m->detail.name ? m->detail.name : NULL); sep = ","; } - printf ("}"); + (void) printf ("}"); break; } } @@ -347,7 +347,7 @@ static void print_sample (bool valid_data, const void *sample, const DDS_XTypes_ { struct context c1 = { .valid_data = valid_data, .key = true, .offset = 0, .maxalign = 1 }; print_sample1_to (sample, typeobj, &c1, "", NULL); - printf ("\n"); + (void) printf ("\n"); } // Helper function to wait for a DCPSPublication to show up with the desired topic name, then calls @@ -386,17 +386,17 @@ static dds_return_t get_topic_and_typeobj (const char *topic_name, dds_duration_ // as an approximation of the topic QoS. if ((*topic = dds_find_topic (DDS_FIND_SCOPE_GLOBAL, participant, ep->topic_name, typeinfo, DDS_SECS (2))) < 0) { - fprintf (stderr, "dds_find_topic: %s ... continuing on the assumptions that topic discovery is disabled\n", dds_strretcode (*topic)); + (void) fprintf (stderr, "dds_find_topic: %s ... continuing on the assumptions that topic discovery is disabled\n", dds_strretcode (*topic)); dds_topic_descriptor_t *descriptor; if ((ret = dds_create_topic_descriptor(DDS_FIND_SCOPE_GLOBAL, participant, typeinfo, DDS_SECS (10), &descriptor)) < 0) { - fprintf (stderr, "dds_create_topic_descriptor: %s\n", dds_strretcode (ret)); + (void) fprintf (stderr, "dds_create_topic_descriptor: %s\n", dds_strretcode (ret)); dds_return_loan (dcpspublication_reader, &epraw, 1); goto error; } if ((*topic = dds_create_topic (participant, descriptor, ep->topic_name, ep->qos, NULL)) < 0) { - fprintf (stderr, "dds_create_topic_descriptor: %s (be sure to enable topic discovery in the configuration)\n", dds_strretcode (*topic)); + (void) fprintf (stderr, "dds_create_topic_descriptor: %s (be sure to enable topic discovery in the configuration)\n", dds_strretcode (*topic)); dds_delete_topic_descriptor (descriptor); dds_return_loan (dcpspublication_reader, &epraw, 1); goto error; @@ -408,7 +408,7 @@ static dds_return_t get_topic_and_typeobj (const char *topic_name, dds_duration_ DDS_XTypes_TypeInformation const * const xtypeinfo = (DDS_XTypes_TypeInformation *) typeinfo; if ((ret = dds_get_typeobj (participant, (const dds_typeid_t *) &xtypeinfo->complete.typeid_with_size.type_id, 0, &typeobj)) < 0) { - fprintf (stderr, "dds_get_typeobj: %s\n", dds_strretcode (ret)); + (void) fprintf (stderr, "dds_get_typeobj: %s\n", dds_strretcode (ret)); dds_return_loan (dcpspublication_reader, &epraw, 1); goto error; } @@ -432,12 +432,12 @@ static dds_return_t get_topic_and_typeobj (const char *topic_name, dds_duration_ // not sure whether this is at all possible info = malloc (sizeof (*info)); *info = (struct typeinfo){ .key = { .key = (uintptr_t) *xtypeobj }, .typeobj = &(*xtypeobj)->_u.complete, .release = *xtypeobj, .align = align, .size = size }; - ddsrt_hh_add (typecache, info); + (void)ddsrt_hh_add (typecache, info); } } error: - dds_delete (dcpspublication_reader); - dds_delete (waitset); + (void) dds_delete (dcpspublication_reader); + (void) dds_delete (waitset); return (*xtypeobj != NULL) ? DDS_RETCODE_OK : DDS_RETCODE_TIMEOUT; } @@ -445,17 +445,20 @@ int main (int argc, char **argv) { dds_return_t ret = 0; dds_entity_t topic = 0; + dds_entity_t reader = 0; + dds_entity_t waitset = 0; + dds_entity_t readcond = 0; if (argc != 2) { - fprintf (stderr, "usage: %s topicname\n", argv[0]); + (void) fprintf (stderr, "usage: %s topicname\n", argv[0]); return 2; } participant = dds_create_participant (DDS_DOMAIN_DEFAULT, NULL, NULL); if (participant < 0) { - fprintf (stderr, "dds_create_participant: %s\n", dds_strretcode (participant)); + (void) fprintf (stderr, "dds_create_participant: %s\n", dds_strretcode (participant)); return 1; } @@ -464,14 +467,14 @@ int main (int argc, char **argv) typecache = ddsrt_hh_new (1, typecache_hash, typecache_equal); if ((ret = get_topic_and_typeobj (argv[1], DDS_SECS (10), &topic, &xtypeobj)) < 0) { - fprintf (stderr, "get_topic_and_typeobj: %s\n", dds_strretcode (ret)); + (void) fprintf (stderr, "get_topic_and_typeobj: %s\n", dds_strretcode (ret)); goto error; } // ... given those, we can create a reader just like we do normally ... - const dds_entity_t reader = dds_create_reader (participant, topic, NULL, NULL); + reader = dds_create_reader (participant, topic, NULL, NULL); // ... and create a waitset that allows us to wait for any incoming data ... - const dds_entity_t waitset = dds_create_waitset (participant); - const dds_entity_t readcond = dds_create_readcondition (reader, DDS_ANY_STATE); + waitset = dds_create_waitset (participant); + readcond = dds_create_readcondition (reader, DDS_ANY_STATE); (void) dds_waitset_attach (waitset, readcond, 0); while (1) { @@ -492,6 +495,6 @@ int main (int argc, char **argv) error: ddsrt_hh_enum (typecache, free_typeinfo, NULL); ddsrt_hh_free (typecache); - dds_delete (participant); + (void) dds_delete (participant); return ret < 0; } diff --git a/examples/dynsub/variouspub.c b/examples/dynsub/variouspub.c index c75d80505b..c6eded2c87 100644 --- a/examples/dynsub/variouspub.c +++ b/examples/dynsub/variouspub.c @@ -98,14 +98,15 @@ static struct tpentry { static void usage (const char *argv0) { - fprintf (stderr, "usage: %s {", argv0); + (void) fprintf (stderr, "usage: %s {", argv0); const char *sep = ""; for (struct tpentry *tpentry = &tptab[0]; tpentry->name; tpentry++) { - fprintf (stderr, "%s%s", sep, tpentry->name); + if (0 > fprintf (stderr, "%s%s", sep, tpentry->name)) + break; sep = "|"; } - fprintf (stderr, "}\n"); + (void) fprintf (stderr, "}\n"); exit (2); } @@ -123,7 +124,7 @@ int main (int argc, char **argv) const dds_entity_t participant = dds_create_participant (DDS_DOMAIN_DEFAULT, NULL, NULL); if (participant < 0) { - fprintf (stderr, "dds_create_participant: %s\n", dds_strretcode (participant)); + (void) fprintf (stderr, "dds_create_participant: %s\n", dds_strretcode (participant)); return 1; } @@ -139,8 +140,8 @@ int main (int argc, char **argv) *countp = count++; if ((ret = dds_write (writer, sample)) < 0) { - fprintf (stderr, "dds_write: %s\n", dds_strretcode (ret)); - dds_delete (participant); + (void) fprintf (stderr, "dds_write: %s\n", dds_strretcode (ret)); + (void) dds_delete (participant); return 1; } if (tpentry->samples[++sample_idx] == NULL) @@ -150,6 +151,6 @@ int main (int argc, char **argv) dds_sleepfor (DDS_SECS (1)); } - dds_delete (participant); + (void) dds_delete (participant); return 0; } diff --git a/examples/helloworld/publisher.c b/examples/helloworld/publisher.c index b75c32d48e..00013bf3a4 100644 --- a/examples/helloworld/publisher.c +++ b/examples/helloworld/publisher.c @@ -30,7 +30,7 @@ int main (int argc, char ** argv) if (writer < 0) DDS_FATAL("dds_create_writer: %s\n", dds_strretcode(-writer)); - printf("=== [Publisher] Waiting for a reader to be discovered ...\n"); + (void) printf("=== [Publisher] Waiting for a reader to be discovered ...\n"); fflush (stdout); rc = dds_set_status_mask(writer, DDS_PUBLICATION_MATCHED_STATUS); @@ -51,8 +51,8 @@ int main (int argc, char ** argv) msg.userID = 1; msg.message = "Hello World"; - printf ("=== [Publisher] Writing : "); - printf ("Message (%"PRId32", %s)\n", msg.userID, msg.message); + (void) printf ("=== [Publisher] Writing : "); + (void) printf ("Message (%"PRId32", %s)\n", msg.userID, msg.message); fflush (stdout); rc = dds_write (writer, &msg); diff --git a/examples/helloworld/subscriber.c b/examples/helloworld/subscriber.c index aee6208c57..0000223be1 100644 --- a/examples/helloworld/subscriber.c +++ b/examples/helloworld/subscriber.c @@ -39,7 +39,7 @@ int main (int argc, char ** argv) DDS_FATAL("dds_create_reader: %s\n", dds_strretcode(-reader)); dds_delete_qos(qos); - printf ("\n=== [Subscriber] Waiting for a sample ...\n"); + (void) printf ("\n=== [Subscriber] Waiting for a sample ...\n"); fflush (stdout); /* Initialize sample buffer, by pointing the void pointer within @@ -60,8 +60,8 @@ int main (int argc, char ** argv) { /* Print Message. */ msg = (HelloWorldData_Msg*) samples[0]; - printf ("=== [Subscriber] Received : "); - printf ("Message (%"PRId32", %s)\n", msg->userID, msg->message); + (void) printf ("=== [Subscriber] Received : "); + (void) printf ("Message (%"PRId32", %s)\n", msg->userID, msg->message); fflush (stdout); break; } diff --git a/examples/listtopics/listtopics.c b/examples/listtopics/listtopics.c index 34d7b5ef7c..7a9a95be87 100644 --- a/examples/listtopics/listtopics.c +++ b/examples/listtopics/listtopics.c @@ -54,10 +54,10 @@ static bool process_topic (dds_entity_t readcond) { dds_builtintopic_topic_t const * const sample = samples[i]; struct keystr gs; - printf ("%s: %s", instance_state_str (infos[i].instance_state), keystr (&gs, &sample->key)); + (void) printf ("%s: %s", instance_state_str (infos[i].instance_state), keystr (&gs, &sample->key)); if (infos[i].valid_data) { - printf (" %s %s", sample->topic_name, sample->type_name); + (void) printf (" %s %s", sample->topic_name, sample->type_name); if (strncmp (sample->topic_name, "DCPS", 4) != 0) { /* Topic names starting with DCPS are guaranteed to be built-in topics, so we @@ -65,7 +65,7 @@ static bool process_topic (dds_entity_t readcond) topics_seen = true; } } - printf ("\n"); + (void) printf ("\n"); } /* Release memory allocated by dds_take */ (void) dds_return_loan (readcond, samples, n); @@ -102,7 +102,7 @@ int main (int argc, char **argv) const dds_entity_t participant = dds_create_participant (DDS_DOMAIN_DEFAULT, NULL, NULL); if (participant < 0) { - fprintf (stderr, "dds_create_participant: %s\n", dds_strretcode (participant)); + (void) fprintf (stderr, "dds_create_participant: %s\n", dds_strretcode (participant)); return 1; } @@ -117,10 +117,10 @@ int main (int argc, char **argv) if (reader < 0) { if (reader == DDS_RETCODE_UNSUPPORTED) - fprintf (stderr, "Topic discovery is not included in the build, rebuild with ENABLE_TOPIC_DISCOVERY=ON\n"); + (void) fprintf (stderr, "Topic discovery is not included in the build, rebuild with ENABLE_TOPIC_DISCOVERY=ON\n"); else - fprintf (stderr, "dds_create_reader(DCPSTopic): %s\n", dds_strretcode (reader)); - dds_delete (participant); + (void) fprintf (stderr, "dds_create_reader(DCPSTopic): %s\n", dds_strretcode (reader)); + (void) dds_delete (participant); return 1; } @@ -173,9 +173,9 @@ int main (int argc, char **argv) } if (!topics_seen && endpoints_exist) { - fprintf (stderr, "No topics discovered but remote readers/writers exist. Is topic discovery enabled in the configuration?\n"); + (void) fprintf (stderr, "No topics discovered but remote readers/writers exist. Is topic discovery enabled in the configuration?\n"); } - dds_delete (participant); + (void) dds_delete (participant); return 0; } diff --git a/examples/perfscript/perftest b/examples/perfscript/perftest index bd9d501ca3..a1bf97319f 100755 --- a/examples/perfscript/perftest +++ b/examples/perfscript/perftest @@ -452,8 +452,8 @@ EOF # col 1: appl receive bandwidth, 1s trailing average (Mb/s) # col 2: appl receive bandwidth, 10s trailing average (Mb/s) # (this assumes the network interface name is eth, en, or lo, optionally followed by a 0) - perl -ne 'if(/size \d+ total.* (\d+\.\d+) Mb\/s.* (\d+\.\d+) Mb\/s/){$r=$1;$r10=$2;}if(/(?:eth|en|lo)0?: xmit.*? recv (\d+\.\d+)/){$rnet=$1;}if(/discarded\s+(\d+)/){printf "%f %f %f %u\n", $rnet, $r, $r10, $1;}' $outdir/sub-$1.log > $resultdir/summary-$async_mode-$sub_mode.txt - perl -ne 'if(/(?:eth|en|lo)0?: xmit (\d+\.\d+) Mb\/s/){printf "%f\n", $1}' $outdir/pub.log > $resultdir/net-xmit-bytes.txt + perl -ne 'if(/size \d+ total.* (\d+\.\d+) Mb\/s.* (\d+\.\d+) Mb\/s/){$r=$1;$r10=$2;}if(/(?:eth|en|lo)0?: xmit.*? recv (\d+\.\d+)/){$rnet=$1;}if(/discarded\s+(\d+)/){(void) printf "%f %f %f %u\n", $rnet, $r, $r10, $1;}' $outdir/sub-$1.log > $resultdir/summary-$async_mode-$sub_mode.txt + perl -ne 'if(/(?:eth|en|lo)0?: xmit (\d+\.\d+) Mb\/s/){(void) printf "%f\n", $1}' $outdir/pub.log > $resultdir/net-xmit-bytes.txt perl -ne 'print "$1 $2 $3 $4 $5\n" if /^(\d+)\s+(\d+)(\s+\d+)$/ || /^\[\d+\]\s+(\d+\.\d+)\s+discarded\s+\d+\s+rexmit\s+(\d+)\s+[A-Za-z_ ]+(\d+)[A-Za-z_ ]+(\d+)[A-Za-z_ ]+(\d+)$/' $outdir/pub.log > $resultdir/rexmit-bytes.txt if $netstats ; then perl -ne 'print "$1\n" if /time=([0-9.]+)/' $outdir/icmpping.log > $resultdir/lat.log diff --git a/examples/roundtrip/ping.c b/examples/roundtrip/ping.c index 03d9b302b1..79586f7d25 100644 --- a/examples/roundtrip/ping.c +++ b/examples/roundtrip/ping.c @@ -182,7 +182,7 @@ static void data_available(dds_entity_t rd, void *arg) difference = (postTakeTime - startTime)/DDS_NSECS_IN_USEC; if (difference > US_IN_ONE_SEC) { - printf("%9" PRIi64 " %9lu %8.0f %8" PRIi64 " %8" PRIi64 " %8" PRIi64 " %10lu %8.0f %8" PRIi64 " %10lu %8.0f %8" PRIi64 "\n", + (void) printf("%9" PRIi64 " %9lu %8.0f %8" PRIi64 " %8" PRIi64 " %8" PRIi64 " %10lu %8.0f %8" PRIi64 " %10lu %8.0f %8" PRIi64 "\n", elapsed + 1, roundTrip.count, exampleGetMedianFromTimeStats (&roundTrip) / 2, @@ -214,7 +214,7 @@ static void data_available(dds_entity_t rd, void *arg) static void usage(void) { - printf ("Usage (parameters must be supplied in order):\n" + (void) printf ("Usage (parameters must be supplied in order):\n" "./ping [-l] [payloadSize (bytes, 0 - 100M)] [numSamples (0 = infinite)] [timeOut (seconds, 0 = infinite)]\n" "./ping quit - ping sends a quit signal to pong.\n" "Defaults:\n" @@ -289,7 +289,7 @@ int main (int argc, char *argv[]) if (argc - argidx == 1 && strcmp (argv[argidx], "quit") == 0) { - printf ("Sending termination request.\n"); + (void) printf ("Sending termination request.\n"); fflush (stdout); /* pong uses a waitset which is triggered by instance disposal, and quits when it fires. */ @@ -328,7 +328,7 @@ int main (int argc, char *argv[]) } if (invalidargs || (argc - argidx == 1 && (strcmp (argv[argidx], "-h") == 0 || strcmp (argv[argidx], "--help") == 0))) usage(); - printf ("# payloadSize: %" PRIu32 " | numSamples: %" PRIu64 " | timeOut: %" PRIi64 "\n\n", payloadSize, numSamples, timeOut); + (void) printf ("# payloadSize: %" PRIu32 " | numSamples: %" PRIu64 " | timeOut: %" PRIi64 "\n\n", payloadSize, numSamples, timeOut); fflush (stdout); pub_data.payload._length = payloadSize; @@ -341,7 +341,7 @@ int main (int argc, char *argv[]) } startTime = dds_time (); - printf ("# Waiting for startup jitter to stabilise\n"); + (void) printf ("# Waiting for startup jitter to stabilise\n"); fflush (stdout); /* Write a sample that pong can send back */ while (!dds_triggered (waitSet) && difference < DDS_SECS(5)) @@ -363,10 +363,10 @@ int main (int argc, char *argv[]) if (!dds_triggered (waitSet)) { warmUp = false; - printf("# Warm up complete.\n\n"); - printf("# Latency measurements (in us)\n"); - printf("# Latency [us] Write-access time [us] Read-access time [us]\n"); - printf("# Seconds Count median min 99%% max Count median min Count median min\n"); + (void) printf("# Warm up complete.\n\n"); + (void) printf("# Latency measurements (in us)\n"); + (void) printf("# Latency [us] Write-access time [us] Read-access time [us]\n"); + (void) printf("# Seconds Count median min 99%% max Count median min Count median min\n"); fflush (stdout); } @@ -392,7 +392,7 @@ int main (int argc, char *argv[]) if (!warmUp) { - printf + (void) printf ( "\n%9s %9lu %8.0f %8" PRIi64 " %8" PRIi64 " %8" PRIi64 " %10lu %8.0f %8" PRIi64 " %10lu %8.0f %8" PRIi64 "\n", "# Overall", diff --git a/examples/roundtrip/pong.c b/examples/roundtrip/pong.c index 721dff9ef4..d8b6faa904 100644 --- a/examples/roundtrip/pong.c +++ b/examples/roundtrip/pong.c @@ -52,7 +52,7 @@ static void data_available(dds_entity_t rd, void *arg) if (info[j].instance_state == DDS_IST_NOT_ALIVE_DISPOSED) { - printf ("Received termination request. Terminating.\n"); + (void) printf ("Received termination request. Terminating.\n"); dds_waitset_set_trigger (waitSet, true); break; } @@ -224,7 +224,7 @@ static dds_entity_t prepare_dds(dds_entity_t *wr, dds_entity_t *rd, dds_entity_t if (status < 0) DDS_FATAL("dds_waitset_attach: %s\n", dds_strretcode(-status)); - printf ("Waiting for samples from ping to send back...\n"); + (void) printf ("Waiting for samples from ping to send back...\n"); fflush (stdout); return participant; diff --git a/examples/shm_throughput/shmpublisher.c b/examples/shm_throughput/shmpublisher.c index e96a61d14c..2228f7b7ba 100644 --- a/examples/shm_throughput/shmpublisher.c +++ b/examples/shm_throughput/shmpublisher.c @@ -120,7 +120,7 @@ int main (int argc, char **argv) /* Wait until have a reader */ if (wait_for_reader(writer, participant) == 0) { - printf ("=== [Publisher] Did not discover a reader.\n"); + (void) printf ("=== [Publisher] Did not discover a reader.\n"); fflush (stdout); rc = dds_delete (participant); if (rc < 0) @@ -154,10 +154,10 @@ static int parse_args( */ if (argc == 2 && (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0)) { - printf ("Usage (parameters must be supplied in order):\n"); - printf ("./publisher [payloadSize (bytes)] [burstInterval (ms)] [burstSize (samples)] [timeOut (seconds)] [partitionName]\n"); - printf ("Defaults:\n"); - printf ("./publisher 8192 0 1 0 \"Throughput example\"\n"); + (void) printf ("Usage (parameters must be supplied in order):\n"); + (void) printf ("./publisher [payloadSize (bytes)] [burstInterval (ms)] [burstSize (samples)] [timeOut (seconds)] [partitionName]\n"); + (void) printf ("Defaults:\n"); + (void) printf ("./publisher 8192 0 1 0 \"Throughput example\"\n"); return EXIT_FAILURE; } if (argc > 1) @@ -181,7 +181,7 @@ static int parse_args( *partitionName = argv[5]; /* The name of the partition */ } - printf ("payloadSize: %"PRIu32" bytes burstInterval: %u ms burstSize: %"PRId32" timeOut: %u seconds partitionName: %s\n", + (void) printf ("payloadSize: %"PRIu32" bytes burstInterval: %u ms burstSize: %"PRId32" timeOut: %u seconds partitionName: %s\n", payloadSize, *burstInterval, *burstSize, *timeOut, *partitionName); fflush (stdout); @@ -292,7 +292,7 @@ static dds_entity_t prepare_dds(dds_entity_t *writer, const char *partitionName) static dds_return_t wait_for_reader(dds_entity_t writer, dds_entity_t participant) { - printf ("\n=== [Publisher] Waiting for a reader ...\n"); + (void) printf ("\n=== [Publisher] Waiting for a reader ...\n"); fflush (stdout); dds_return_t rc; @@ -335,7 +335,7 @@ static void start_writing( dds_time_t burstStart = pubStart; unsigned int burstCount = 0; - printf ("=== [Publisher] Writing samples...\n"); + (void) printf ("=== [Publisher] Writing samples...\n"); fflush (stdout); while (!done && !timedOut) @@ -395,7 +395,7 @@ static void start_writing( } dds_write_flush (writer); - printf ("=== [Publisher] %s, %llu samples written.\n", done ? "Terminated" : "Timed out", (unsigned long long) ((ThroughputModule_DataType_Base*)sample)->count); + (void) printf ("=== [Publisher] %s, %llu samples written.\n", done ? "Terminated" : "Timed out", (unsigned long long) ((ThroughputModule_DataType_Base*)sample)->count); fflush (stdout); } } diff --git a/examples/shm_throughput/shmsubscriber.c b/examples/shm_throughput/shmsubscriber.c index 5f98880d64..fde63776a1 100644 --- a/examples/shm_throughput/shmsubscriber.c +++ b/examples/shm_throughput/shmsubscriber.c @@ -80,12 +80,12 @@ int main (int argc, char **argv) return EXIT_FAILURE; } - printf ("Cycles: %llu | PollingDelay: %ld | Partition: %s\n", maxCycles, pollingDelay, partitionName); + (void) printf ("Cycles: %llu | PollingDelay: %ld | Partition: %s\n", maxCycles, pollingDelay, partitionName); fflush (stdout); participant = prepare_dds(&reader, partitionName); - printf ("=== [Subscriber] Waiting for samples...\n"); + (void) printf ("=== [Subscriber] Waiting for samples...\n"); fflush (stdout); /* Process samples until Ctrl-C is pressed or until maxCycles */ @@ -218,10 +218,10 @@ static int parse_args(int argc, char **argv, unsigned long long *maxCycles, char */ if (argc == 2 && (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0)) { - printf ("Usage (parameters must be supplied in order):\n"); - printf ("./subscriber [maxCycles (0 = infinite)] [pollingDelay (ms, 0 = waitset, -1 = listener)] [partitionName]\n"); - printf ("Defaults:\n"); - printf ("./subscriber 0 0 \"Throughput example\"\n"); + (void) printf ("Usage (parameters must be supplied in order):\n"); + (void) printf ("./subscriber [maxCycles (0 = infinite)] [pollingDelay (ms, 0 = waitset, -1 = listener)] [partitionName]\n"); + (void) printf ("Defaults:\n"); + (void) printf ("./subscriber 0 0 \"Throughput example\"\n"); return EXIT_FAILURE; } @@ -286,7 +286,7 @@ static void process_samples(dds_entity_t reader, unsigned long long maxCycles) { double cursamples = (deltaTime != 0.0) ? ((double)(total_samples - prev_samples) / deltaTime) : 0; double curspeed = (deltaTime != 0.0) ? (((double)(total_bytes - prev_bytes) / BYTES_PER_SEC_TO_MEGABITS_PER_SEC) / deltaTime) : 0; - printf ("=== [Subscriber] %5.3f Payload size: %d | Total received: %llu samples, %llu bytes | Out of order: %llu samples " + (void) printf ("=== [Subscriber] %5.3f Payload size: %d | Total received: %llu samples, %llu bytes | Out of order: %llu samples " "Transfer rate: %.2lf samples/s, %.2lf Mbit/s\n", deltaTime, payloadSize, total_samples, total_bytes, outOfOrder, cursamples, curspeed); @@ -311,12 +311,12 @@ static void process_samples(dds_entity_t reader, unsigned long long maxCycles) /* Output totals and averages */ deltaTv = time_now - startTime; deltaTime = (double) (deltaTv / DDS_NSECS_IN_SEC); - printf ("\nTotal received: %llu samples, %llu bytes\n", total_samples, total_bytes); - printf ("Out of order: %llu samples\n", outOfOrder); - printf ("Average transfer rate: %.2lf samples/s, ", (double)total_samples / deltaTime); - printf ("Maximum transfer rate: %.2lf samples/s, ", maxsamples); - printf ("Average throughput : %.2lf Mbit/s\n", ((double)total_bytes / BYTES_PER_SEC_TO_MEGABITS_PER_SEC) / deltaTime); - printf ("Maximum throughput : %.2lf Mbit/s\n", maxspeed); + (void) printf ("\nTotal received: %llu samples, %llu bytes\n", total_samples, total_bytes); + (void) printf ("Out of order: %llu samples\n", outOfOrder); + (void) printf ("Average transfer rate: %.2lf samples/s, ", (double)total_samples / deltaTime); + (void) printf ("Maximum transfer rate: %.2lf samples/s, ", maxsamples); + (void) printf ("Average throughput : %.2lf Mbit/s\n", ((double)total_bytes / BYTES_PER_SEC_TO_MEGABITS_PER_SEC) / deltaTime); + (void) printf ("Maximum throughput : %.2lf Mbit/s\n", maxspeed); fflush (stdout); } diff --git a/examples/throughput/publisher.c b/examples/throughput/publisher.c index 284870bade..10c640bc36 100644 --- a/examples/throughput/publisher.c +++ b/examples/throughput/publisher.c @@ -55,7 +55,7 @@ int main (int argc, char **argv) /* Wait until have a reader */ if (wait_for_reader(writer, participant) == 0) { - printf ("=== [Publisher] Did not discover a reader.\n"); + (void) printf ("=== [Publisher] Did not discover a reader.\n"); fflush (stdout); rc = dds_delete (participant); if (rc < 0) @@ -99,10 +99,10 @@ static int parse_args( */ if (argc == 2 && (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0)) { - printf ("Usage (parameters must be supplied in order):\n"); - printf ("./publisher [payloadSize (bytes)] [burstInterval (ms)] [burstSize (samples)] [timeOut (seconds)] [partitionName]\n"); - printf ("Defaults:\n"); - printf ("./publisher 8192 0 1 0 \"Throughput example\"\n"); + (void) printf ("Usage (parameters must be supplied in order):\n"); + (void) printf ("./publisher [payloadSize (bytes)] [burstInterval (ms)] [burstSize (samples)] [timeOut (seconds)] [partitionName]\n"); + (void) printf ("Defaults:\n"); + (void) printf ("./publisher 8192 0 1 0 \"Throughput example\"\n"); return EXIT_FAILURE; } if (argc > 1) @@ -126,7 +126,7 @@ static int parse_args( *partitionName = argv[5]; /* The name of the partition */ } - printf ("payloadSize: %"PRIu32" bytes burstInterval: %d ms burstSize: %"PRIu32" timeOut: %d seconds partitionName: %s\n", + (void) printf ("payloadSize: %"PRIu32" bytes burstInterval: %d ms burstSize: %"PRIu32" timeOut: %d seconds partitionName: %s\n", *payloadSize, *burstInterval, *burstSize, *timeOut, *partitionName); fflush (stdout); @@ -179,7 +179,7 @@ static dds_entity_t prepare_dds(dds_entity_t *writer, const char *partitionName) static dds_return_t wait_for_reader(dds_entity_t writer, dds_entity_t participant) { - printf ("\n=== [Publisher] Waiting for a reader ...\n"); + (void) printf ("\n=== [Publisher] Waiting for a reader ...\n"); fflush (stdout); dds_return_t rc; @@ -222,7 +222,7 @@ static void start_writing( dds_time_t burstStart = pubStart; unsigned int burstCount = 0; - printf ("=== [Publisher] Writing samples...\n"); + (void) printf ("=== [Publisher] Writing samples...\n"); fflush (stdout); while (!done && !timedOut) @@ -277,7 +277,7 @@ static void start_writing( } dds_write_flush (writer); - printf ("=== [Publisher] %s, %llu samples written.\n", done ? "Terminated" : "Timed out", (unsigned long long) sample->count); + (void) printf ("=== [Publisher] %s, %llu samples written.\n", done ? "Terminated" : "Timed out", (unsigned long long) sample->count); fflush (stdout); } } diff --git a/examples/throughput/subscriber.c b/examples/throughput/subscriber.c index 9161e6ec55..9d5f7818f7 100644 --- a/examples/throughput/subscriber.c +++ b/examples/throughput/subscriber.c @@ -81,12 +81,12 @@ int main (int argc, char **argv) return EXIT_FAILURE; } - printf ("Cycles: %llu | PollingDelay: %ld | Partition: %s\n", maxCycles, pollingDelay, partitionName); + (void) printf ("Cycles: %llu | PollingDelay: %ld | Partition: %s\n", maxCycles, pollingDelay, partitionName); fflush (stdout); participant = prepare_dds(&reader, partitionName); - printf ("=== [Subscriber] Waiting for samples...\n"); + (void) printf ("=== [Subscriber] Waiting for samples...\n"); fflush (stdout); /* Process samples until Ctrl-C is pressed or until maxCycles */ @@ -215,10 +215,10 @@ static int parse_args(int argc, char **argv, unsigned long long *maxCycles, char */ if (argc == 2 && (strcmp (argv[1], "-h") == 0 || strcmp (argv[1], "--help") == 0)) { - printf ("Usage (parameters must be supplied in order):\n"); - printf ("./subscriber [maxCycles (0 = infinite)] [pollingDelay (ms, 0 = waitset, -1 = listener)] [partitionName]\n"); - printf ("Defaults:\n"); - printf ("./subscriber 0 0 \"Throughput example\"\n"); + (void) printf ("Usage (parameters must be supplied in order):\n"); + (void) printf ("./subscriber [maxCycles (0 = infinite)] [pollingDelay (ms, 0 = waitset, -1 = listener)] [partitionName]\n"); + (void) printf ("Defaults:\n"); + (void) printf ("./subscriber 0 0 \"Throughput example\"\n"); return EXIT_FAILURE; } @@ -275,7 +275,7 @@ static void process_samples(dds_entity_t reader, unsigned long long maxCycles) if (deltaTime >= 1.0 && total_samples != prev_samples) { - printf ("=== [Subscriber] %5.3f Payload size: %lu | Total received: %llu samples, %llu bytes | Out of order: %llu samples " + (void) printf ("=== [Subscriber] %5.3f Payload size: %lu | Total received: %llu samples, %llu bytes | Out of order: %llu samples " "Transfer rate: %.2lf samples/s, %.2lf Mbit/s\n", deltaTime, payloadSize, total_samples, total_bytes, outOfOrder, (deltaTime != 0.0) ? ((double)(total_samples - prev_samples) / deltaTime) : 0, @@ -297,10 +297,10 @@ static void process_samples(dds_entity_t reader, unsigned long long maxCycles) /* Output totals and averages */ deltaTv = time_now - startTime; deltaTime = (double) (deltaTv / DDS_NSECS_IN_SEC); - printf ("\nTotal received: %llu samples, %llu bytes\n", total_samples, total_bytes); - printf ("Out of order: %llu samples\n", outOfOrder); - printf ("Average transfer rate: %.2lf samples/s, ", (double)total_samples / deltaTime); - printf ("%.2lf Mbit/s\n", (double)(total_bytes / BYTES_PER_SEC_TO_MEGABITS_PER_SEC) / deltaTime); + (void) printf ("\nTotal received: %llu samples, %llu bytes\n", total_samples, total_bytes); + (void) printf ("Out of order: %llu samples\n", outOfOrder); + (void) printf ("Average transfer rate: %.2lf samples/s, ", (double)total_samples / deltaTime); + (void) printf ("%.2lf Mbit/s\n", (double)(total_bytes / BYTES_PER_SEC_TO_MEGABITS_PER_SEC) / deltaTime); fflush (stdout); } diff --git a/ports/freertos-posix/src/loader.c b/ports/freertos-posix/src/loader.c index 7b207151ea..9380ff8bc5 100644 --- a/ports/freertos-posix/src/loader.c +++ b/ports/freertos-posix/src/loader.c @@ -46,7 +46,7 @@ void vAssertCalled(unsigned long ulLine, const char * const pcFileName) { taskENTER_CRITICAL(); { - fprintf(stderr, "[ASSERT] %s:%lu"LF, pcFileName, ulLine); + (void) fprintf(stderr, "[ASSERT] %s:%lu"LF, pcFileName, ulLine); } taskEXIT_CRITICAL(); abort(); @@ -67,7 +67,7 @@ static void usage(const char *name) "Usage: %s LAUNCHER_OPTIONS -- PROGRAM_OPTIONS"LF "Try '%s -h' for more information"LF; - fprintf(stderr, fmt, name, name); + (void) fprintf(stderr, fmt, name, name); } static void help(const char *name) @@ -78,7 +78,7 @@ static void help(const char *name) "Launcher options:"LF " -h Show this help message and exit"LF; - fprintf(stdout, fmt, name); + (void) fprintf(stdout, fmt, name); } typedef struct { @@ -130,13 +130,13 @@ main(int argc, char *argv[]) help(name); exit(EX_OK); case '?': - fprintf(stderr, "Unknown option '%c'"LF, opt); + (void) fprintf(stderr, "Unknown option '%c'"LF, opt); usage(name); exit(EX_USAGE); case ':': /* fall through */ default: - fprintf(stderr, "Option '%c' requires an argument"LF, opt); + (void) fprintf(stderr, "Option '%c' requires an argument"LF, opt); usage(name); exit(EX_USAGE); } diff --git a/src/core/ddsc/src/dds_entity.c b/src/core/ddsc/src/dds_entity.c index 3ee74a0a5c..9f4e15224b 100644 --- a/src/core/ddsc/src/dds_entity.c +++ b/src/core/ddsc/src/dds_entity.c @@ -371,7 +371,7 @@ static void print_delete (const dds_entity *e, enum delete_impl_state delstate , if (e) { unsigned cm = ddsrt_atomic_ld32 (&e->m_hdllink.cnt_flags); - printf ("delete(%p, delstate %s, iid %"PRIx64"): %s%s %d pin %u refc %u %s %s\n", + (void) printf ("delete(%p, delstate %s, iid %"PRIx64"): %s%s %d pin %u refc %u %s %s\n", (void *) e, (delstate == DIS_IMPLICIT) ? "implicit" : (delstate == DIS_EXPLICIT) ? "explicit" : "from_parent", iid, entity_kindstr (e->m_kind), (e->m_flags & DDS_ENTITY_IMPLICIT) ? " [implicit]" : "", e->m_hdllink.hdl, cm & 0xfff, (cm >> 12) & 0x7fff, (cm & 0x80000000) ? "closed" : "open", @@ -379,7 +379,7 @@ static void print_delete (const dds_entity *e, enum delete_impl_state delstate , } else { - printf ("delete(%p, delstate %s, handle %"PRId64"): pin failed\n", + (void) printf ("delete(%p, delstate %s, handle %"PRId64"): pin failed\n", (void *) e, (delstate == DIS_IMPLICIT) ? "implicit" : (delstate == DIS_EXPLICIT) ? "explicit" : "from_parent", iid); } } diff --git a/src/core/ddsc/src/dds_rhc_default.c b/src/core/ddsc/src/dds_rhc_default.c index 1dc01e9beb..0b36f342a3 100644 --- a/src/core/ddsc/src/dds_rhc_default.c +++ b/src/core/ddsc/src/dds_rhc_default.c @@ -231,7 +231,7 @@ void lwregs_dump (struct lwregs *rt) { struct ddsrt_ehh_iter it; for (struct lwreg *r = ddsrt_ehh_iter_first(rt->regs, &it); r; r = ddsrt_ehh_iter_next(&it)) - printf("iid=%"PRIu64" wr_iid=%"PRIu64"\n", r->iid, r->wr_iid); + (void) printf("iid=%"PRIu64" wr_iid=%"PRIu64"\n", r->iid, r->wr_iid); } #endif diff --git a/src/core/ddsc/tests/builtin_topics.c b/src/core/ddsc/tests/builtin_topics.c index c5ed6a7b42..d60cd710bc 100644 --- a/src/core/ddsc/tests/builtin_topics.c +++ b/src/core/ddsc/tests/builtin_topics.c @@ -52,7 +52,7 @@ static void setup (void) static void teardown (void) { - dds_delete (g_domain); + (void) dds_delete (g_domain); } enum cdqobe_kind { diff --git a/src/core/ddsc/tests/cdr.c b/src/core/ddsc/tests/cdr.c index b77827af56..55a3a738a2 100644 --- a/src/core/ddsc/tests/cdr.c +++ b/src/core/ddsc/tests/cdr.c @@ -238,7 +238,7 @@ static struct ddsi_serdata *sd_from_ser (const struct ddsi_sertype *tpcmn, enum const ddsi_keyhash_t *kh = ddsi_serdata_keyhash_from_fragchain (fragchain); CU_ASSERT_FATAL (kh != NULL); assert (kh != NULL); // for Clang's static analyzer - printf ("kh rcv %02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x\n", + (void) printf ("kh rcv %02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x\n", kh->value[0], kh->value[1], kh->value[2], kh->value[3], kh->value[4], kh->value[5], kh->value[6], kh->value[7], kh->value[8], kh->value[9], kh->value[10], kh->value[11], @@ -441,7 +441,7 @@ static void sd_get_keyhash (const struct ddsi_serdata *serdata_common, struct dd { struct sd const * const sd = (const struct sd *) serdata_common; sdx_get_keyhash (&sd->x, buf, force_md5); - printf ("kh gen %02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x\n", + (void) printf ("kh gen %02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x\n", buf->value[0], buf->value[1], buf->value[2], buf->value[3], buf->value[4], buf->value[5], buf->value[6], buf->value[7], buf->value[8], buf->value[9], buf->value[10], buf->value[11], @@ -914,7 +914,7 @@ static void cdr_timeout (struct ops const * const ops) } } - dds_delete (DDS_CYCLONEDDS_HANDLE); + (void) dds_delete (DDS_CYCLONEDDS_HANDLE); } /*---------------------------------------------------------------- diff --git a/src/core/ddsc/tests/cdrstream.c b/src/core/ddsc/tests/cdrstream.c index 16e9dc5e37..27bad378be 100644 --- a/src/core/ddsc/tests/cdrstream.c +++ b/src/core/ddsc/tests/cdrstream.c @@ -1597,8 +1597,8 @@ static void entity_init (const dds_topic_descriptor_t *desc, dds_data_representa static void cdrstream_fini (void) { - dds_delete (d1); - dds_delete (d2); + (void) dds_delete (d1); + (void) dds_delete (d2); } #define D(n) TestIdl_Msg ## n ## _desc @@ -1811,7 +1811,7 @@ CU_Theory ((const char *descr, const dds_topic_descriptor_t *desc1, const dds_to char buf[5000]; is.m_index = 0; dds_stream_print_sample (&is, &tp_rd, buf, 5000); - printf ("read sample: %s\n\n", buf); + (void) printf ("read sample: %s\n\n", buf); // cleanup t ? sample_free_fn2 (msg_wr, msg_rd) : sample_free_fn1 (msg_wr, msg_rd); @@ -1835,7 +1835,7 @@ CU_TheoryDataPoints (ddsc_cdrstream, min_xcdr_version) = { CU_Theory ((const dds_topic_descriptor_t *desc, uint16_t min_xcdrv), ddsc_cdrstream, min_xcdr_version, .init = cdrstream_init, .fini = cdrstream_fini) { - printf("running test for desc: %s\n", desc->m_typename); + (void) printf("running test for desc: %s\n", desc->m_typename); CU_ASSERT_EQUAL_FATAL (dds_stream_minimum_xcdr_version (desc->m_ops), min_xcdrv); entity_init (desc, DDS_DATA_REPRESENTATION_XCDR1, min_xcdrv != XCDR1); @@ -1889,11 +1889,11 @@ CU_Test (ddsc_cdrstream, check_optimize) for (uint32_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) { - printf("running test for desc %s: %s ", tests[i].desc->m_typename, tests[i].description); + (void) printf("running test for desc %s: %s ", tests[i].desc->m_typename, tests[i].description); struct ddsi_sertype_default_desc ddsi_desc = { .ops.nops = tests[i].desc->m_nops, .ops.ops = (uint32_t *) tests[i].desc->m_ops, .size = tests[i].desc->m_size }; size_t opt1 = dds_stream_check_optimize (&ddsi_desc, XCDR1); size_t opt2 = dds_stream_check_optimize (&ddsi_desc, XCDR2); - printf ("(opt cdr1: %zu, cdr2: %zu)\n", opt1, opt2); + (void) printf ("(opt cdr1: %zu, cdr2: %zu)\n", opt1, opt2); CU_ASSERT_EQUAL_FATAL (opt1, tests[i].opt_size_xcdr1); CU_ASSERT_EQUAL_FATAL (opt2, tests[i].opt_size_xcdr2); } diff --git a/src/core/ddsc/tests/config.c b/src/core/ddsc/tests/config.c index 9c259ad2a0..9403be321c 100644 --- a/src/core/ddsc/tests/config.c +++ b/src/core/ddsc/tests/config.c @@ -60,7 +60,7 @@ CU_Test (ddsc_config, simple_udp, .init = ddsrt_init, .fini = ddsrt_fini) config__check_env ("MAX_PARTICIPANTS", CONFIG_ENV_MAX_PARTICIPANTS); participant = dds_create_participant (DDS_DOMAIN_DEFAULT, NULL, NULL); CU_ASSERT_FATAL (participant> 0); - dds_delete (participant); + (void) dds_delete (participant); } CU_Test (ddsc_config, user_config, .init = ddsrt_init, .fini = ddsrt_fini) @@ -81,7 +81,7 @@ CU_Test (ddsc_config, user_config, .init = ddsrt_init, .fini = ddsrt_fini) dds_entity_t participant_3 = dds_create_participant (1, NULL, NULL); CU_ASSERT(participant_3 < 0); - dds_delete (domain); + (void) dds_delete (domain); } CU_Test (ddsc_config, ignoredpartition, .init = ddsrt_init, .fini = ddsrt_fini) @@ -253,7 +253,7 @@ CU_Test (ddsc_config, ignoredpartition, .init = ddsrt_init, .fini = ddsrt_fini) CU_ASSERT_FATAL (sample.long_3 == s_i.long_3); dds_delete_qos (qos); - dds_delete (DDS_CYCLONEDDS_HANDLE); + (void) dds_delete (DDS_CYCLONEDDS_HANDLE); #endif } @@ -453,7 +453,7 @@ CU_Test(ddsc_config, multiple_domains, .init = ddsrt_init, .fini = ddsrt_fini) found = 0; doms[0] = dds_create_domain (53, config); CU_ASSERT_FATAL (doms[0] > 0); - printf ("found = %d\n", found); + (void) printf ("found = %d\n", found); CU_ASSERT_FATAL (found == 7); dds_set_log_sink (&logger, (void *) exp[1]); @@ -461,7 +461,7 @@ CU_Test(ddsc_config, multiple_domains, .init = ddsrt_init, .fini = ddsrt_fini) found = 0; doms[1] = dds_create_domain (54, config); CU_ASSERT_FATAL (doms[1] > 0 && doms[1] != doms[0]); - printf ("found = %d\n", found); + (void) printf ("found = %d\n", found); CU_ASSERT_FATAL (found == 7); dds_set_log_sink (&logger, (void *) exp[2]); @@ -469,7 +469,7 @@ CU_Test(ddsc_config, multiple_domains, .init = ddsrt_init, .fini = ddsrt_fini) found = 0; doms[2] = dds_create_domain (57, config); CU_ASSERT_FATAL (doms[2] > 0 && doms[2] != doms[1] && doms[2] != doms[0]); - printf ("found = %d\n", found); + (void) printf ("found = %d\n", found); CU_ASSERT_FATAL (found == 7); for (int i = 0; i < 3; i++) diff --git a/src/core/ddsc/tests/data_avail_stress.c b/src/core/ddsc/tests/data_avail_stress.c index e07d4e8d28..44d0753402 100644 --- a/src/core/ddsc/tests/data_avail_stress.c +++ b/src/core/ddsc/tests/data_avail_stress.c @@ -37,7 +37,7 @@ static uint32_t writethread (void *varg) ret = dds_write (arg->wr, &data); } ddsrt_atomic_or32 (&arg->stop, (ret != 0) ? 2 : 0); - printf ("nwrites: %d\n", (int) data.long_3); + (void) printf ("nwrites: %d\n", (int) data.long_3); return 0; } @@ -71,7 +71,7 @@ static void data_avail (dds_entity_t rd, void *varg) ddsrt_atomic_inc32 (&arg->status->badparam); else { - printf ("data_avail: take failed rc %d\n", (int) rc); + (void) printf ("data_avail: take failed rc %d\n", (int) rc); ddsrt_atomic_inc32 (&arg->status->error); } } @@ -204,12 +204,12 @@ static void stress_data_avail_delete_reader (bool remote, int duration) ddsrt_atomic_or32 (&wrarg.stop, 1); ddsrt_thread_join (wrtid, NULL); - printf ("nreaders %"PRIu32"\n", nreaders); - printf ("triggered %"PRIx32"\n", ddsrt_atomic_ld32 (&lstatus.triggered)); - printf ("error %"PRIu32"\n", ddsrt_atomic_ld32 (&lstatus.error)); - printf ("taken %"PRIu32"\n", ddsrt_atomic_ld32 (&lstatus.taken)); - printf ("badparam %"PRIu32"\n", ddsrt_atomic_ld32 (&lstatus.badparam)); - printf ("stop %"PRIu32"\n", ddsrt_atomic_ld32 (&wrarg.stop)); + (void) printf ("nreaders %"PRIu32"\n", nreaders); + (void) printf ("triggered %"PRIx32"\n", ddsrt_atomic_ld32 (&lstatus.triggered)); + (void) printf ("error %"PRIu32"\n", ddsrt_atomic_ld32 (&lstatus.error)); + (void) printf ("taken %"PRIu32"\n", ddsrt_atomic_ld32 (&lstatus.taken)); + (void) printf ("badparam %"PRIu32"\n", ddsrt_atomic_ld32 (&lstatus.badparam)); + (void) printf ("stop %"PRIu32"\n", ddsrt_atomic_ld32 (&wrarg.stop)); CU_ASSERT_FATAL (nreaders > 10); // sanity check CU_ASSERT_FATAL (!ddsrt_atomic_ld32 (&lstatus.error)); diff --git a/src/core/ddsc/tests/data_representation.c b/src/core/ddsc/tests/data_representation.c index 46132c6b2f..acc2536551 100644 --- a/src/core/ddsc/tests/data_representation.c +++ b/src/core/ddsc/tests/data_representation.c @@ -54,8 +54,8 @@ static void data_representation_init (void) static void data_representation_fini (void) { - dds_delete (d1); - dds_delete (d2); + (void) dds_delete (d1); + (void) dds_delete (d2); } static void *sample_init_type1 (void) @@ -239,7 +239,7 @@ CU_Test(ddsc_data_representation, matching, .init = data_representation_init, .f for (uint32_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) { dds_return_t ret; - printf ("running test %u: %s %u/%u\n", i, tests[i].match ? "true" : "false", tests[i].n_ids_rd, tests[i].n_ids_wr); + (void) printf ("running test %u: %s %u/%u\n", i, tests[i].match ? "true" : "false", tests[i].n_ids_rd, tests[i].n_ids_wr); dds_qos_t *qos_rd = dds_create_qos (), *qos_wr = dds_create_qos (); dds_qset_history(qos_rd, DDS_HISTORY_KEEP_ALL, DDS_LENGTH_UNLIMITED); dds_qset_durability(qos_rd, DDS_DURABILITY_TRANSIENT_LOCAL); @@ -394,11 +394,11 @@ CU_Test(ddsc_data_representation, extensibility, .init = data_representation_ini for (uint32_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) { - printf ("running test %u for type %s: ", i, tests[i].desc->m_typename); + (void) printf ("running test %u for type %s: ", i, tests[i].desc->m_typename); create_unique_topic_name ("ddsc_data_representation", topicname, sizeof topicname); - printf ("tp "); + (void) printf ("tp "); dds_qos_t *qos_tp = get_qos (&tests[i].tp); dds_entity_t tp = dds_create_topic (dp1, tests[i].desc, topicname, qos_tp, NULL); CU_ASSERT_EQUAL_FATAL (tp > 0, tests[i].tp.valid); @@ -408,7 +408,7 @@ CU_Test(ddsc_data_representation, extensibility, .init = data_representation_ini if (tests[i].tp.valid) { - printf ("rd "); + (void) printf ("rd "); dds_qos_t *qos_rd = get_qos (&tests[i].rd); dds_entity_t rd = dds_create_reader (dp1, tp, qos_rd, NULL); CU_ASSERT_EQUAL_FATAL (rd > 0, tests[i].rd.valid); @@ -416,7 +416,7 @@ CU_Test(ddsc_data_representation, extensibility, .init = data_representation_ini exp_qos (rd, &tests[i].rd); dds_delete_qos (qos_rd); - printf ("wr "); + (void) printf ("wr "); dds_qos_t *qos_wr = get_qos (&tests[i].wr); dds_entity_t wr = dds_create_writer (dp1, tp, qos_wr, NULL); CU_ASSERT_EQUAL_FATAL (wr > 0, tests[i].wr.valid); @@ -424,7 +424,7 @@ CU_Test(ddsc_data_representation, extensibility, .init = data_representation_ini exp_qos (wr, &tests[i].wr); dds_delete_qos (qos_wr); } - printf ("\n"); + (void) printf ("\n"); } } @@ -442,9 +442,9 @@ CU_Test (ddsc_data_representation, update_qos, .init = data_representation_init, { dds_entity_t ent = 0; switch (tests[i]) { - case RD: printf("RD\n"); ent = dds_create_reader (dp1, tp1, NULL, NULL); break; - case WR: printf("WR\n"); ent = dds_create_writer (dp1, tp1, NULL, NULL); break; - case TP: printf("TP\n"); ent = tp1; break; + case RD: (void) printf("RD\n"); ent = dds_create_reader (dp1, tp1, NULL, NULL); break; + case WR: (void) printf("WR\n"); ent = dds_create_writer (dp1, tp1, NULL, NULL); break; + case TP: (void) printf("TP\n"); ent = tp1; break; } CU_ASSERT_FATAL (ent > 0); @@ -511,7 +511,7 @@ CU_Test(ddsc_data_representation, qos_annotation, .init = data_representation_in char topicname[100]; for (uint32_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) { - printf ("running tests for type %s \n", tests[i].desc->m_typename); + (void) printf ("running tests for type %s \n", tests[i].desc->m_typename); for (uint32_t t = 0; t < 4; t++) { dds_qos_t *qos_tp = get_qos (&tests[i].tp[t]); diff --git a/src/core/ddsc/tests/deadline.c b/src/core/ddsc/tests/deadline.c index c5f67e1002..9a0b5f0620 100644 --- a/src/core/ddsc/tests/deadline.c +++ b/src/core/ddsc/tests/deadline.c @@ -101,14 +101,14 @@ static void deadline_init(void) static void deadline_fini(void) { dds_delete_qos(g_qos); - dds_delete(g_subscriber); - dds_delete(g_remote_subscriber); - dds_delete(g_publisher); - dds_delete(g_topic); - dds_delete(g_participant); - dds_delete(g_remote_participant); - dds_delete(g_domain); - dds_delete(g_remote_domain); + (void) dds_delete(g_subscriber); + (void) dds_delete(g_remote_subscriber); + (void) dds_delete(g_publisher); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); + (void) dds_delete(g_remote_participant); + (void) dds_delete(g_domain); + (void) dds_delete(g_remote_domain); } static void sleepfor(dds_duration_t sleep_dur) @@ -216,8 +216,8 @@ CU_Test(ddsc_deadline, basic, .init=deadline_init, .fini=deadline_fini) } } - dds_delete(reader); - dds_delete(writer); + (void) dds_delete(reader); + (void) dds_delete(writer); if (!test_finished) { @@ -317,8 +317,8 @@ CU_Theory((dds_durability_kind_t dur_kind, dds_reliability_kind_t rel_kind, dds_ } dds_delete_qos(qos); - dds_delete(reader); - dds_delete(writer); + (void) dds_delete(reader); + (void) dds_delete(writer); if (!test_finished) { @@ -415,8 +415,8 @@ CU_Theory((int32_t n_inst, uint8_t unreg_nth, uint8_t dispose_nth), ddsc_deadlin } } - dds_delete(reader_dl); - dds_delete(writer); + (void) dds_delete(reader_dl); + (void) dds_delete(writer); if (!test_finished) { diff --git a/src/core/ddsc/tests/discstress.c b/src/core/ddsc/tests/discstress.c index df4a227187..307fd9f379 100644 --- a/src/core/ddsc/tests/discstress.c +++ b/src/core/ddsc/tests/discstress.c @@ -90,7 +90,7 @@ static uint32_t createwriter_publisher (void *varg) reliable transport like a local loopback). So other than waiting for some readers to show up at all, there's no need to look at matching events or to use anything other than volatile, provided the readers accept an initial short sequence in the first batch. */ - printf ("=== Publishing while waiting for some reader ...\n"); + (void) printf ("=== Publishing while waiting for some reader ...\n"); fflush (stdout); uint32_t seq = 0; int32_t round = -1; @@ -108,7 +108,7 @@ static uint32_t createwriter_publisher (void *varg) matched = (mc == N_READERS * N_WRITERS); if (matched) { - printf ("All readers found; continuing at [%"PRIu32",%"PRIu32"] for %d rounds\n", + (void) printf ("All readers found; continuing at [%"PRIu32",%"PRIu32"] for %d rounds\n", wrseq * N_WRITERS + 1, (wrseq + 1) * N_WRITERS, N_ROUNDS); fflush (stdout); } @@ -179,9 +179,9 @@ static void dumplog (char logbuf[LOGDEPTH][LOGLINE], int *logidx) { if (logbuf[*logidx][0]) for (int i = *logidx; i < LOGDEPTH; i++) - fputs (logbuf[i], stdout); + (void) fputs (logbuf[i], stdout); for (int i = 0; i < *logidx; i++) - fputs (logbuf[i], stdout); + (void) fputs (logbuf[i], stdout); for (int i = 0; i < LOGDEPTH; i++) logbuf[i][0] = 0; *logidx = 0; @@ -220,7 +220,7 @@ static uint32_t createwriter_subscriber (void *varg) CU_ASSERT_FATAL (readers[i] > 0); } - printf ("--- Waiting for some writer to match ...\n"); + (void) printf ("--- Waiting for some writer to match ...\n"); fflush (stdout); /* Wait until we have matching writers */ @@ -257,7 +257,7 @@ static uint32_t createwriter_subscriber (void *varg) } /* Loop while we have some matching writers */ - printf ("--- Checking data ...\n"); + (void) printf ("--- Checking data ...\n"); fflush (stdout); struct ddsrt_hh *wrinfo = ddsrt_hh_new (1, wrinfo_hash, wrinfo_eq); dds_entity_t xreader = 0; @@ -292,13 +292,13 @@ static uint32_t createwriter_subscriber (void *varg) CU_ASSERT_FATAL (nxs >= 0); if (nxs == 0 && matched) { - printf ("--- Unexpected timeout\n"); + (void) printf ("--- Unexpected timeout\n"); for (int i = 0; i < N_READERS; i++) { dds_subscription_matched_status_t st; rc = dds_get_subscription_matched_status (readers[i], &st); CU_ASSERT_FATAL (rc == 0); - printf ("--- reader %d current_count %"PRIu32"\n", i, st.current_count); + (void) printf ("--- reader %d current_count %"PRIu32"\n", i, st.current_count); } fflush (stdout); CU_ASSERT_FATAL (0); @@ -325,14 +325,14 @@ static uint32_t createwriter_subscriber (void *varg) CU_ASSERT_FATAL (s->wridx < N_WRITERS); #define XASSERT(cond, ...) do { if (!(cond)) { \ - printf ("%s: %s", #cond, __VA_ARGS__); \ + (void) printf ("%s: %s", #cond, __VA_ARGS__); \ fflush (stdout); \ dumplog (logbuf[xs[i]], &logidx[xs[i]]); \ error = true; \ CU_ASSERT (0); \ } } while (0) #define XASSERT_FATAL(cond, ...) do { if (!(cond)) { \ - printf ("%s: %s", #cond, __VA_ARGS__); \ + (void) printf ("%s: %s", #cond, __VA_ARGS__); \ fflush (stdout); \ dumplog (logbuf[xs[i]], &logidx[xs[i]]); \ CU_ASSERT_FATAL (0); \ @@ -346,7 +346,7 @@ static uint32_t createwriter_subscriber (void *varg) CU_ASSERT_FATAL (rc != 0); } - snprintf (logbuf[xs[i]][logidx[xs[i]]], sizeof (logbuf[xs[i]][logidx[xs[i]]]), + (void) snprintf (logbuf[xs[i]][logidx[xs[i]]], sizeof (logbuf[xs[i]][logidx[xs[i]]]), "%"PRIu32": %"PRId32".%"PRIu32" %"PRIu32".%"PRIu32" iid %"PRIx64" new %"PRIx64" st %c%c seq %"PRIu32" seen %"PRIu32"\n", (uint32_t) xs[i], s->round, s->wrseq, s->wridx, s->histidx, wri->wr_iid, si[j].publication_handle, (si[j].instance_state == DDS_IST_ALIVE) ? 'A' : (si[j].instance_state == DDS_IST_NOT_ALIVE_DISPOSED) ? 'D' : 'U', @@ -404,7 +404,7 @@ static uint32_t createwriter_subscriber (void *varg) nwri++; if (wri->seen != (1u << DEPTH) - 1) { - printf ("err: wri->seen = %x rdid %"PRIu32" wrid %"PRIu32" iid %"PRIx64" lna %d\n", + (void) printf ("err: wri->seen = %x rdid %"PRIu32" wrid %"PRIu32" iid %"PRIx64" lna %d\n", wri->seen, wri->rdid, wri->wrid, wri->wr_iid, wri->last_not_alive); err++; } @@ -414,7 +414,7 @@ static uint32_t createwriter_subscriber (void *varg) ddsrt_hh_free (wrinfo); CU_ASSERT_FATAL (err == 0); CU_ASSERT_FATAL (nwri >= (N_ROUNDS / 3) * N_READERS * N_WRITERS); - printf ("--- Done after %"PRIu32" sets\n", nwri / (N_READERS * N_WRITERS)); + (void) printf ("--- Done after %"PRIu32" sets\n", nwri / (N_READERS * N_WRITERS)); return 0; } diff --git a/src/core/ddsc/tests/dispose.c b/src/core/ddsc/tests/dispose.c index 71d390807e..bf982a3409 100644 --- a/src/core/ddsc/tests/dispose.c +++ b/src/core/ddsc/tests/dispose.c @@ -119,11 +119,11 @@ disposing_init(void) static void disposing_fini(void) { - dds_delete(g_reader); - dds_delete(g_writer); - dds_delete(g_waitset); - dds_delete(g_topic); - dds_delete(g_participant); + (void) dds_delete(g_reader); + (void) dds_delete(g_writer); + (void) dds_delete(g_waitset); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); } @@ -138,7 +138,7 @@ disposing_fini(void) CU_Test(ddsc_writedispose, deleted, .init=disposing_init, .fini=disposing_fini) { dds_return_t ret; - dds_delete(g_writer); + (void) dds_delete(g_writer); DDSRT_WARNING_MSVC_OFF(6387); /* Disable SAL warning on intentional misuse of the API */ ret = dds_writedispose(g_writer, NULL); DDSRT_WARNING_MSVC_ON(6387); @@ -294,7 +294,7 @@ CU_Test(ddsc_writedispose, timeout, .init=disposing_init, .fini=disposing_fini) CU_Test(ddsc_writedispose_ts, deleted, .init=disposing_init, .fini=disposing_fini) { dds_return_t ret; - dds_delete(g_writer); + (void) dds_delete(g_writer); DDSRT_WARNING_MSVC_OFF(6387); /* Disable SAL warning on intentional misuse of the API */ ret = dds_writedispose_ts(g_writer, NULL, g_present); DDSRT_WARNING_MSVC_ON(6387); @@ -493,7 +493,7 @@ CU_Test(ddsc_writedispose_ts, disposing_past_sample, .init=disposing_init, .fini CU_Test(ddsc_dispose, deleted, .init=disposing_init, .fini=disposing_fini) { dds_return_t ret; - dds_delete(g_writer); + (void) dds_delete(g_writer); DDSRT_WARNING_MSVC_OFF(6387); /* Disable SAL warning on intentional misuse of the API */ ret = dds_dispose(g_writer, NULL); DDSRT_WARNING_MSVC_ON(6387); @@ -648,7 +648,7 @@ CU_Test(ddsc_dispose, disposing_new_instance, .init=disposing_init, .fini=dispos CU_Test(ddsc_dispose_ts, deleted, .init=disposing_init, .fini=disposing_fini) { dds_return_t ret; - dds_delete(g_writer); + (void) dds_delete(g_writer); DDSRT_WARNING_MSVC_OFF(6387); /* Disable SAL warning on intentional misuse of the API */ ret = dds_dispose_ts(g_writer, NULL, g_present); DDSRT_WARNING_MSVC_ON(6387); /* Disable SAL warning on intentional misuse of the API */ @@ -846,7 +846,7 @@ CU_Test(ddsc_dispose_ts, disposing_past_sample, .init=disposing_init, .fini=disp CU_Test(ddsc_dispose_ih, deleted, .init=disposing_init, .fini=disposing_fini) { dds_return_t ret; - dds_delete(g_writer); + (void) dds_delete(g_writer); ret = dds_dispose_ih(g_writer, DDS_HANDLE_NIL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -943,7 +943,7 @@ CU_Test(ddsc_dispose_ih, disposing_old_instance, .init=disposing_init, .fini=dis CU_Test(ddsc_dispose_ih_ts, deleted, .init=disposing_init, .fini=disposing_fini) { dds_return_t ret; - dds_delete(g_writer); + (void) dds_delete(g_writer); ret = dds_dispose_ih_ts(g_writer, DDS_HANDLE_NIL, g_present); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } diff --git a/src/core/ddsc/tests/domain.c b/src/core/ddsc/tests/domain.c index e106de6ea8..40da72d7d6 100644 --- a/src/core/ddsc/tests/domain.c +++ b/src/core/ddsc/tests/domain.c @@ -228,7 +228,7 @@ CU_Test(ddsc_domain_create, after_domain) domain2 = dds_create_domain(4, "any"); CU_ASSERT_FATAL(domain2 == DDS_RETCODE_PRECONDITION_NOT_MET); - dds_delete(domain1); + (void) dds_delete(domain1); } CU_Test(ddsc_domain_create, after_participant) @@ -242,7 +242,7 @@ CU_Test(ddsc_domain_create, after_participant) domain = dds_create_domain(5, "any"); CU_ASSERT_FATAL(domain == DDS_RETCODE_PRECONDITION_NOT_MET); - dds_delete(participant); + (void) dds_delete(participant); } CU_Test(ddsc_domain_create, diff) @@ -351,7 +351,7 @@ CU_Test(ddsc_domain_create, raw_config) dds_set_trace_sink (logsink, &arg_xml); domain = dds_create_domain (1, "config"); CU_ASSERT_FATAL(domain > 0); - dds_delete (domain); + (void) dds_delete (domain); struct ddsi_config config; ddsi_config_init_default (&config); @@ -362,7 +362,7 @@ CU_Test(ddsc_domain_create, raw_config) dds_set_trace_sink (logsink, &arg_raw); domain = dds_create_domain_with_rawconfig (1, &config); CU_ASSERT_FATAL(domain > 0); - dds_delete (domain); + (void) dds_delete (domain); dds_set_trace_sink (0, NULL); @@ -382,9 +382,9 @@ CU_Test(ddsc_domain_create, raw_config) CU_ASSERT (i == arg_xml.size); CU_ASSERT (j == arg_raw.size); for (; i < arg_xml.size; i++) - printf ("XML: %s", arg_xml.buf[i]); + (void) printf ("XML: %s", arg_xml.buf[i]); for (; j < arg_raw.size; j++) - printf ("RAW: %s", arg_raw.buf[j]); + (void) printf ("RAW: %s", arg_raw.buf[j]); } for (size_t i = 0; i < arg_xml.size; i++) diff --git a/src/core/ddsc/tests/domain_torture.c b/src/core/ddsc/tests/domain_torture.c index af9abdaa1c..797afd3a46 100644 --- a/src/core/ddsc/tests/domain_torture.c +++ b/src/core/ddsc/tests/domain_torture.c @@ -36,7 +36,7 @@ static uint32_t create_participants_thread (void *varg) dds_entity_t par = dds_create_participant (DDS_DOMAIN_DEFAULT, NULL, NULL); if (par < 0) { - fprintf (stderr, "dds_create_participant failed: %s\n", dds_strretcode (par)); + (void) fprintf (stderr, "dds_create_participant failed: %s\n", dds_strretcode (par)); ddsrt_atomic_st32 (&terminate, 1); return 1; } @@ -44,7 +44,7 @@ static uint32_t create_participants_thread (void *varg) dds_return_t ret = dds_delete(par); if (ret != DDS_RETCODE_OK) { - fprintf (stderr, "dds_delete failed: %s\n", dds_strretcode (ret)); + (void) fprintf (stderr, "dds_delete failed: %s\n", dds_strretcode (ret)); ddsrt_atomic_st32 (&terminate, 1); return 1; } diff --git a/src/core/ddsc/tests/entity_api.c b/src/core/ddsc/tests/entity_api.c index 69f7897c6c..12964d3d95 100644 --- a/src/core/ddsc/tests/entity_api.c +++ b/src/core/ddsc/tests/entity_api.c @@ -114,7 +114,7 @@ CU_Test(ddsc_entity, qos, .init = create_entity, .fini = delete_entity) { dds_entity_t par = dds_create_participant (DDS_DOMAIN_DEFAULT, qos, NULL); entity_qos_get_set(par, "{with initial qos}"); - dds_delete(par); + (void) dds_delete(par); } /* Delete qos. */ diff --git a/src/core/ddsc/tests/entity_hierarchy.c b/src/core/ddsc/tests/entity_hierarchy.c index a7ab59f980..82ad2ea7ff 100644 --- a/src/core/ddsc/tests/entity_hierarchy.c +++ b/src/core/ddsc/tests/entity_hierarchy.c @@ -85,15 +85,15 @@ hierarchy_init(void) static void hierarchy_fini(void) { - dds_delete(g_querycond); - dds_delete(g_readcond); - dds_delete(g_reader); - dds_delete(g_writer); - dds_delete(g_subscriber); - dds_delete(g_publisher); - dds_delete(g_topic); - dds_delete(g_participant); - dds_delete(g_keep); + (void) dds_delete(g_querycond); + (void) dds_delete(g_readcond); + (void) dds_delete(g_reader); + (void) dds_delete(g_writer); + (void) dds_delete(g_subscriber); + (void) dds_delete(g_publisher); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); + (void) dds_delete(g_keep); } @@ -199,7 +199,7 @@ CU_Test(ddsc_entity_delete, recursive_with_deleted_topic) ret = dds_get_domainid(g_writer, &id); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); - dds_delete(g_keep); + (void) dds_delete(g_keep); } /*************************************************************************************************/ @@ -230,7 +230,7 @@ CU_TheoryDataPoints(ddsc_entity_get_participant, deleted_entities) = { CU_Theory((dds_entity_t *entity), ddsc_entity_get_participant, deleted_entities, .init=hierarchy_init, .fini=hierarchy_fini) { dds_entity_t participant; - dds_delete(*entity); + (void) dds_delete(*entity); participant = dds_get_participant(*entity); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_BAD_PARAMETER); } @@ -320,7 +320,7 @@ CU_TheoryDataPoints(ddsc_entity_get_parent, deleted_entities) = { CU_Theory((dds_entity_t *entity), ddsc_entity_get_parent, deleted_entities, .init=hierarchy_init, .fini=hierarchy_fini) { dds_entity_t parent; - dds_delete(*entity); + (void) dds_delete(*entity); parent = dds_get_parent(*entity); CU_ASSERT_EQUAL_FATAL(parent, DDS_RETCODE_BAD_PARAMETER); } @@ -472,7 +472,7 @@ CU_Theory((dds_entity_t *entity), ddsc_entity_get_children, deleted_entities, .i { dds_return_t ret; dds_entity_t children[4]; - dds_delete(*entity); + (void) dds_delete(*entity); ret = dds_get_children(*entity, children, 4); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -520,7 +520,7 @@ CU_TheoryDataPoints(ddsc_entity_get_topic, deleted_entities) = { CU_Theory((dds_entity_t *entity), ddsc_entity_get_topic, deleted_entities, .init=hierarchy_init, .fini=hierarchy_fini) { dds_entity_t topic; - dds_delete(*entity); + (void) dds_delete(*entity); topic = dds_get_topic(*entity); CU_ASSERT_EQUAL_FATAL(topic, DDS_RETCODE_BAD_PARAMETER); } @@ -573,7 +573,7 @@ CU_Test(ddsc_entity_get_publisher, writer, .init=hierarchy_init, .fini=hierarchy CU_Test(ddsc_entity_get_publisher, deleted_writer, .init=hierarchy_init, .fini=hierarchy_fini) { dds_entity_t publisher; - dds_delete(g_writer); + (void) dds_delete(g_writer); publisher = dds_get_publisher(g_writer); CU_ASSERT_EQUAL_FATAL(publisher, DDS_RETCODE_BAD_PARAMETER); } @@ -631,7 +631,7 @@ CU_TheoryDataPoints(ddsc_entity_get_subscriber, deleted_readers) = { CU_Theory((dds_entity_t *entity), ddsc_entity_get_subscriber, deleted_readers, .init=hierarchy_init, .fini=hierarchy_fini) { dds_entity_t subscriber; - dds_delete(*entity); + (void) dds_delete(*entity); subscriber = dds_get_subscriber(*entity); CU_ASSERT_EQUAL_FATAL(subscriber, DDS_RETCODE_BAD_PARAMETER); } @@ -691,7 +691,7 @@ CU_TheoryDataPoints(ddsc_entity_get_datareader, deleted_conds) = { CU_Theory((dds_entity_t *cond), ddsc_entity_get_datareader, deleted_conds, .init=hierarchy_init, .fini=hierarchy_fini) { dds_entity_t reader; - dds_delete(*cond); + (void) dds_delete(*cond); reader = dds_get_datareader(*cond); CU_ASSERT_EQUAL_FATAL(reader, DDS_RETCODE_BAD_PARAMETER); } @@ -744,13 +744,13 @@ CU_Test(ddsc_entity_implicit_publisher, deleted) ret = dds_get_children(participant, NULL, 0); CU_ASSERT_EQUAL_FATAL(ret, 2); - dds_delete(writer); + (void) dds_delete(writer); ret = dds_get_children(participant, NULL, 0); CU_ASSERT_EQUAL_FATAL(ret, 1); - dds_delete(topic); - dds_delete(participant); + (void) dds_delete(topic); + (void) dds_delete(participant); } /*************************************************************************************************/ @@ -770,8 +770,8 @@ CU_Test(ddsc_entity_implicit_publisher, invalid_topic) DDSRT_WARNING_MSVC_ON(28020); CU_ASSERT_FATAL(writer < 0); - dds_delete(writer); - dds_delete(participant); + (void) dds_delete(writer); + (void) dds_delete(participant); } /*************************************************************************************************/ @@ -796,13 +796,13 @@ CU_Test(ddsc_entity_implicit_subscriber, deleted) ret = dds_get_children(participant, NULL, 0); CU_ASSERT_EQUAL_FATAL(ret, 2); - dds_delete(reader); + (void) dds_delete(reader); ret = dds_get_children(participant, NULL, 0); CU_ASSERT_EQUAL_FATAL(ret, 1); - dds_delete(topic); - dds_delete(participant); + (void) dds_delete(topic); + (void) dds_delete(participant); } /*************************************************************************************************/ @@ -823,8 +823,8 @@ CU_Test(ddsc_entity_explicit_subscriber, invalid_topic) DDSRT_WARNING_MSVC_ON(28020); CU_ASSERT_FATAL(reader < 0); - dds_delete(reader); - dds_delete(participant); + (void) dds_delete(reader); + (void) dds_delete(participant); } /*************************************************************************************************/ @@ -861,14 +861,14 @@ CU_Test(ddsc_entity_get_children, implicit_publisher) CU_ASSERT_FATAL(publisher > 0); CU_ASSERT_NOT_EQUAL_FATAL(publisher, writer); - dds_delete(writer); + (void) dds_delete(writer); ret = dds_get_children(participant, child2, 2); CU_ASSERT_EQUAL_FATAL(ret, 1); CU_ASSERT_FATAL( (child2[0] == child[0]) || (child2[0] == child[1]) ); - dds_delete(topic); - dds_delete(participant); + (void) dds_delete(topic); + (void) dds_delete(participant); } /*************************************************************************************************/ @@ -905,14 +905,14 @@ CU_Test(ddsc_entity_get_children, implicit_subscriber) CU_ASSERT_FATAL(subscriber > 0); CU_ASSERT_NOT_EQUAL_FATAL(subscriber, reader); - dds_delete(reader); + (void) dds_delete(reader); ret = dds_get_children(participant, child2, 2); CU_ASSERT_EQUAL_FATAL(ret, 1); CU_ASSERT_FATAL( (child2[0] == child[0]) || (child2[0] == child[1]) ); - dds_delete(topic); - dds_delete(participant); + (void) dds_delete(topic); + (void) dds_delete(participant); } /*************************************************************************************************/ @@ -940,11 +940,11 @@ CU_Test(ddsc_entity_get_parent, implicit_publisher) CU_ASSERT_NOT_EQUAL_FATAL(parent, participant); CU_ASSERT_FATAL(parent > 0); - dds_delete(writer); + (void) dds_delete(writer); ret = dds_delete(parent); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); - dds_delete(participant); + (void) dds_delete(participant); } /*************************************************************************************************/ @@ -971,11 +971,11 @@ CU_Test(ddsc_entity_get_parent, implicit_subscriber) CU_ASSERT_NOT_EQUAL_FATAL(parent, participant); CU_ASSERT_FATAL(parent > 0); - dds_delete(reader); + (void) dds_delete(reader); ret = dds_delete(parent); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); - dds_delete(participant); + (void) dds_delete(participant); } /*************************************************************************************************/ @@ -1008,7 +1008,7 @@ CU_Test(ddsc_entity_implicit, delete_publisher) ret = dds_delete(writer); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); - dds_delete(participant); + (void) dds_delete(participant); } /*************************************************************************************************/ @@ -1040,7 +1040,7 @@ CU_Test(ddsc_entity_implicit, delete_subscriber) ret = dds_delete(reader); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); - dds_delete(participant); + (void) dds_delete(participant); } /*************************************************************************************************/ diff --git a/src/core/ddsc/tests/entity_status.c b/src/core/ddsc/tests/entity_status.c index 84386d40cf..40c5609b01 100644 --- a/src/core/ddsc/tests/entity_status.c +++ b/src/core/ddsc/tests/entity_status.c @@ -105,15 +105,15 @@ fini_entity_status(void) dds_waitset_detach(waitSetrd, rea); dds_waitset_detach(waitSetwr, wri); - dds_delete(waitSetrd); - dds_delete(waitSetwr); - dds_delete(wri); - dds_delete(publisher); - dds_delete(rea); + (void) dds_delete(waitSetrd); + (void) dds_delete(waitSetwr); + (void) dds_delete(wri); + (void) dds_delete(publisher); + (void) dds_delete(rea); dds_delete_qos(qos); - dds_delete(top); - dds_delete(subscriber); - dds_delete(participant); + (void) dds_delete(top); + (void) dds_delete(subscriber); + (void) dds_delete(participant); } /**************************************************************************** @@ -151,7 +151,7 @@ CU_Test(ddsc_entity_status, publication_matched, .init=init_entity_status, .fini CU_ASSERT_EQUAL_FATAL(ret, 0); /* Un-match the publication by deleting the reader. */ - dds_delete(rea); + (void) dds_delete(rea); /* Wait for publication matched status */ ret = dds_waitset_wait(waitSetwr, wsresults, wsresultsize, waitTimeout); @@ -206,7 +206,7 @@ CU_Test(ddsc_entity_status, subscription_matched, .init=init_entity_status, .fin CU_ASSERT_EQUAL_FATAL(ret, 0); /* Un-match the subscription by deleting the writer. */ - dds_delete(wri); + (void) dds_delete(wri); /* Wait for subscription matched status */ ret = dds_waitset_wait(waitSetrd, wsresults, wsresultsize, waitTimeout); @@ -299,7 +299,7 @@ CU_Test(ddsc_entity, incompatible_qos, .init=init_entity_status, .fini=fini_enti ret = dds_waitset_detach(waitSetrd, reader2); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK); - dds_delete(reader2); + (void) dds_delete(reader2); } CU_Test(ddsc_entity, liveliness_changed, .init=init_entity_status, .fini=fini_entity_status) @@ -343,7 +343,7 @@ CU_Test(ddsc_entity, liveliness_changed, .init=init_entity_status, .fini=fini_en /* Reset writer */ ret = dds_waitset_detach(waitSetwr, wri); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK); - dds_delete(wri); + (void) dds_delete(wri); /* wait for LIVELINESS_CHANGED when a writer is deleted */ ret = dds_waitset_wait(waitSetrd, wsresults, wsresultsize, waitTimeout); @@ -457,7 +457,7 @@ Test(ddsc_entity, inconsistent_topic) status = dds_waitset_wait(waitSetrd, wsresults, wsresultsize, shortTimeout); CU_ASSERT_EQUAL_FATAL(status, 0); - dds_delete(top); + (void) dds_delete(top); } #endif @@ -549,7 +549,7 @@ CU_Test(ddsc_entity, data_available, .init=init_entity_status, .fini=fini_entity ret = dds_waitset_detach(waitSetrd, rea); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK); - dds_delete(rea); + (void) dds_delete(rea); /* Wait for reader to be deleted */ ret = dds_waitset_wait(waitSetwr, wsresults, wsresultsize, waitTimeout); @@ -662,7 +662,7 @@ CU_Test(ddsc_entity, all_data_available, .init=init_entity_status, .fini=fini_en RoundTripModule_DataType_free (&s_sample, DDS_FREE_CONTENTS); - dds_delete(reader2); + (void) dds_delete(reader2); /* Wait for reader to be deleted */ ret = dds_waitset_wait(waitSetwr, wsresults, wsresultsize, waitTimeout); @@ -686,7 +686,7 @@ CU_Theory((dds_entity_t e), ddsc_get_enabled_status, bad_param, .init=init_entit CU_Test(ddsc_get_enabled_status, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { uint32_t mask; - dds_delete(rea); + (void) dds_delete(rea); ret = dds_get_status_mask(rea, &mask); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -721,7 +721,7 @@ CU_Theory((dds_entity_t e), ddsc_set_enabled_status, bad_param, .init=init_entit CU_Test(ddsc_set_enabled_status, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(rea); + (void) dds_delete(rea); ret = dds_set_status_mask(rea, 0 /*mask*/); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -757,7 +757,7 @@ CU_Theory((dds_entity_t e), ddsc_read_status, bad_param, .init=init_entity_statu CU_Test(ddsc_read_status, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { uint32_t status; - dds_delete(rea); + (void) dds_delete(rea); ret = dds_read_status(rea, &status, 0 /*mask*/); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -808,7 +808,7 @@ CU_Theory((dds_entity_t e), ddsc_take_status, bad_param, .init=init_entity_statu CU_Test(ddsc_take_status, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { uint32_t status; - dds_delete(rea); + (void) dds_delete(rea); ret = dds_take_status(rea, &status, 0 /*mask*/); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -846,7 +846,7 @@ CU_Theory((dds_entity_t e), ddsc_get_status_changes, bad_param, .init=init_entit CU_Test(ddsc_get_status_changes, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { uint32_t status; - dds_delete(rea); + (void) dds_delete(rea); ret = dds_get_status_changes(rea, &status); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -881,7 +881,7 @@ CU_Theory((dds_entity_t e), ddsc_triggered, bad_param, .init=init_entity_status, CU_Test(ddsc_triggered, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(rea); + (void) dds_delete(rea); ret = dds_triggered(rea); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -943,7 +943,7 @@ CU_Theory((dds_entity_t *topic), ddsc_get_inconsistent_topic_status, non_topics, /*************************************************************************************************/ CU_Test(ddsc_get_inconsistent_topic_status, deleted_topic, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(top); + (void) dds_delete(top); ret = dds_get_inconsistent_topic_status(top, NULL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK); } @@ -985,7 +985,7 @@ CU_Theory((dds_entity_t *writer), ddsc_get_publication_matched_status, non_write /*************************************************************************************************/ CU_Test(ddsc_get_publication_matched_status, deleted_writer, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(wri); + (void) dds_delete(wri); ret = dds_get_publication_matched_status(wri, NULL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1038,7 +1038,7 @@ CU_Theory((dds_entity_t *writer), ddsc_get_liveliness_lost_status, non_writers, /*************************************************************************************************/ CU_Test(ddsc_get_liveliness_lost_status, deleted_writer, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(wri); + (void) dds_delete(wri); ret = dds_get_liveliness_lost_status(wri, NULL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1092,7 +1092,7 @@ CU_Theory((dds_entity_t *writer), ddsc_get_offered_deadline_missed_status, non_w /*************************************************************************************************/ CU_Test(ddsc_get_offered_deadline_missed_status, deleted_writer, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(wri); + (void) dds_delete(wri); ret = dds_get_offered_deadline_missed_status(wri, NULL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1134,7 +1134,7 @@ CU_Theory((dds_entity_t *writer), ddsc_get_offered_incompatible_qos_status, non_ /*************************************************************************************************/ CU_Test(ddsc_get_offered_incompatible_qos_status, deleted_writer, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(wri); + (void) dds_delete(wri); ret = dds_get_offered_incompatible_qos_status(wri, NULL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1176,7 +1176,7 @@ CU_Theory((dds_entity_t *reader), ddsc_get_subscription_matched_status, non_read /*************************************************************************************************/ CU_Test(ddsc_get_subscription_matched_status, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(rea); + (void) dds_delete(rea); ret = dds_get_subscription_matched_status(rea, NULL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1218,7 +1218,7 @@ CU_Theory((dds_entity_t *reader), ddsc_get_liveliness_changed_status, non_reader /*************************************************************************************************/ CU_Test(ddsc_get_liveliness_changed_status, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(rea); + (void) dds_delete(rea); ret = dds_get_liveliness_changed_status(rea, NULL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1260,7 +1260,7 @@ CU_Theory((dds_entity_t *reader), ddsc_get_sample_rejected_status, non_readers, /*************************************************************************************************/ CU_Test(ddsc_get_sample_rejected_status, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(rea); + (void) dds_delete(rea); ret = dds_get_sample_rejected_status(rea, NULL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1302,7 +1302,7 @@ CU_Theory((dds_entity_t *reader), ddsc_get_sample_lost_status, non_readers, .ini /*************************************************************************************************/ CU_Test(ddsc_get_sample_lost_status, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(rea); + (void) dds_delete(rea); ret = dds_get_sample_lost_status(rea, NULL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1356,7 +1356,7 @@ CU_Theory((dds_entity_t *reader), ddsc_get_requested_deadline_missed_status, non /*************************************************************************************************/ CU_Test(ddsc_get_requested_deadline_missed_status, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(rea); + (void) dds_delete(rea); ret = dds_get_requested_deadline_missed_status(rea, NULL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1398,7 +1398,7 @@ CU_Theory((dds_entity_t *reader), ddsc_get_requested_incompatible_qos_status, no /*************************************************************************************************/ CU_Test(ddsc_get_requested_incompatible_qos_status, deleted_reader, .init=init_entity_status, .fini=fini_entity_status) { - dds_delete(rea); + (void) dds_delete(rea); ret = dds_get_requested_incompatible_qos_status(rea, NULL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } diff --git a/src/core/ddsc/tests/filter.c b/src/core/ddsc/tests/filter.c index 3caf02916a..4d5989cace 100644 --- a/src/core/ddsc/tests/filter.c +++ b/src/core/ddsc/tests/filter.c @@ -170,9 +170,9 @@ static void checkdata (dds_entity_t rd, const struct exp *exp, const char *heade case DDS_NOT_ALIVE_NO_WRITERS_INSTANCE_STATE: is = 'u'; break; case DDS_NOT_ALIVE_DISPOSED_INSTANCE_STATE: is = 'd'; break; } - printf (" %c{%d,%d,%d}", is, data[k].long_1, data[k].long_2, data[k].long_3); + (void) printf (" %c{%d,%d,%d}", is, data[k].long_1, data[k].long_2, data[k].long_3); } - printf ("\n"); + (void) printf ("\n"); fflush (stdout); CU_ASSERT_FATAL (ret == exp->n); // sort because there's no ordering between instances @@ -277,7 +277,7 @@ CU_Test (ddsc_filter, basic) for (int j = 0; j < 2; j++) checkdata (rd[i][j], &exp[i][j], "rd[%d][%d]:", i, j); for (int i = 0; i < 2; i++) - dds_delete (dp[i]); + (void) dds_delete (dp[i]); } CU_Test (ddsc_filter, ownership) @@ -354,7 +354,7 @@ CU_Test (ddsc_filter, ownership) } }; checkdata (rd, &exp, "rd"); - dds_delete (dp); + (void) dds_delete (dp); } static bool filter_long1_eq_1 (const void *vsample) @@ -462,7 +462,7 @@ CU_Test (ddsc_filter, getset_extended) ret = dds_get_topic_filter_and_arg (tp, &fn, &arg); CU_ASSERT_FATAL (ret == DDS_RETCODE_PRECONDITION_NOT_MET); - dds_delete (dp); + (void) dds_delete (dp); } CU_Test (ddsc_filter, sampleinfo) @@ -645,6 +645,6 @@ CU_Test (ddsc_filter, sampleinfo) }; checkdata (rd[0], &expX, "rd"); checkdata (rd[1], &expX, "rd"); - dds_delete (dp); + (void) dds_delete (dp); } diff --git a/src/core/ddsc/tests/iceoryx.c b/src/core/ddsc/tests/iceoryx.c index ddcdd36ad8..ea94b55fa0 100644 --- a/src/core/ddsc/tests/iceoryx.c +++ b/src/core/ddsc/tests/iceoryx.c @@ -227,7 +227,7 @@ static void print (struct tracebuf *tb, const char *fmt, ...) if (pos < 0) pos = 0; - fputs (tb->buf + tb->pos, stdout); fflush (stdout); + (void) fputs (tb->buf + tb->pos, stdout); fflush (stdout); tb->pos += (size_t) pos; } @@ -617,7 +617,7 @@ static void dotest (const dds_topic_descriptor_t *tpdesc, const void *sample) struct ddsi_domaingv *gv = gvs[i]; GVTRACE ("#### %s ####\n", tb.buf); } - fputs (fail_one ? "\n" : " $$\r", stdout); + (void) fputs (fail_one ? "\n" : " $$\r", stdout); fflush (stdout); CU_ASSERT_FATAL (!fatal); diff --git a/src/core/ddsc/tests/lifespan.c b/src/core/ddsc/tests/lifespan.c index 3462cfd55f..d709b2c38e 100644 --- a/src/core/ddsc/tests/lifespan.c +++ b/src/core/ddsc/tests/lifespan.c @@ -92,15 +92,15 @@ static void lifespan_init(void) static void lifespan_fini(void) { - dds_delete(g_rcond); - dds_delete(g_qcond); - dds_delete(g_reader); - dds_delete(g_writer); - dds_delete(g_subscriber); - dds_delete(g_publisher); - dds_delete(g_waitset); - dds_delete(g_topic); - dds_delete(g_participant); + (void) dds_delete(g_rcond); + (void) dds_delete(g_qcond); + (void) dds_delete(g_reader); + (void) dds_delete(g_writer); + (void) dds_delete(g_subscriber); + (void) dds_delete(g_publisher); + (void) dds_delete(g_waitset); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); } static void check_whc_state(dds_entity_t writer, seqno_t exp_min, seqno_t exp_max) diff --git a/src/core/ddsc/tests/liveliness.c b/src/core/ddsc/tests/liveliness.c index 1f5b31840f..1105a25793 100644 --- a/src/core/ddsc/tests/liveliness.c +++ b/src/core/ddsc/tests/liveliness.c @@ -73,8 +73,8 @@ static void liveliness_init(void) static void liveliness_fini(void) { - dds_delete(g_sub_domain); - dds_delete(g_pub_domain); + (void) dds_delete(g_sub_domain); + (void) dds_delete(g_pub_domain); } /** @@ -576,7 +576,7 @@ static void test_create_delete_writer_stress(bool remote_reader) CU_ASSERT_FATAL((writers[n] = dds_create_writer(g_pub_participant, pub_topic, wqos, NULL)) > 0); CU_ASSERT_EQUAL_FATAL(dds_write(writers[n], &sample), DDS_RETCODE_OK); if (n % 3 == 2) - dds_delete(writers[n]); + (void) dds_delete(writers[n]); else if (n % 2) alive_writers_auto++; else @@ -1165,7 +1165,7 @@ CU_Test(ddsc_liveliness, lease_duration_zero_or_one, .init = liveliness_init, .f dds_duration_t d = ldur[ldur_idx]; tprintf ("### lease_duration_zero_or_one: sleep = %"PRId64" lkind = %d ldur = %"PRId64" reader = %s\n", s, (int) k, d, rrd ? "remote" : "local"); lease_duration_zero_or_one_impl (s, k, d, rrd); - printf ("\n"); + (void) printf ("\n"); } } } diff --git a/src/core/ddsc/tests/multi_sertype.c b/src/core/ddsc/tests/multi_sertype.c index c4e6d12668..458f74f539 100644 --- a/src/core/ddsc/tests/multi_sertype.c +++ b/src/core/ddsc/tests/multi_sertype.c @@ -207,12 +207,12 @@ static void multi_sertype_init (void) static void multi_sertype_fini (void) { - dds_delete (g_sub_subscriber); - dds_delete (g_pub_publisher); - dds_delete (g_sub_participant); - dds_delete (g_pub_participant); - dds_delete (g_sub_domain); - dds_delete (g_pub_domain); + (void) dds_delete (g_sub_subscriber); + (void) dds_delete (g_pub_publisher); + (void) dds_delete (g_sub_participant); + (void) dds_delete (g_pub_participant); + (void) dds_delete (g_sub_domain); + (void) dds_delete (g_pub_domain); } static bool get_and_check_writer_status (size_t nwr, const dds_entity_t *wrs, size_t nrd) @@ -330,7 +330,7 @@ static const struct ddsi_sertype *get_sertype_from_reader (dds_entity_t reader) static void logsink (void *arg, const dds_log_data_t *msg) { ddsrt_atomic_uint32_t *deser_fail = arg; - fputs (msg->message - msg->hdrsize, stderr); + (void) fputs (msg->message - msg->hdrsize, stderr); if (strstr (msg->message, "deserialization") && strstr (msg->message, "failed")) ddsrt_atomic_inc32 (deser_fail); } @@ -393,7 +393,7 @@ static void ddsc_multi_sertype_impl (dds_entity_t pp_pub, dds_entity_t pp_sub, e dds_qos_t *qos; dds_return_t rc; - printf ("multi_sertype: %s %s\n", (pp_pub == pp_sub) ? "local" : "remote", multi_sertype_modestr (mode)); + (void) printf ("multi_sertype: %s %s\n", (pp_pub == pp_sub) ? "local" : "remote", multi_sertype_modestr (mode)); /* Transient-local mode is for checking the local historical data delivery path (for remote, there is nothing special about it), and knowing it is local means we don't have to wait for historical @@ -445,7 +445,7 @@ static void ddsc_multi_sertype_impl (dds_entity_t pp_pub, dds_entity_t pp_sub, e CU_ASSERT_FATAL (rc == DDS_RETCODE_OK); } - printf ("wait for discovery, fastpath_ok; delete & recreate readers\n"); + (void) printf ("wait for discovery, fastpath_ok; delete & recreate readers\n"); while (!(get_and_check_writer_status (sizeof (writers) / sizeof (writers[0]), writers, sizeof (readers) / sizeof (readers[0])) && get_and_check_reader_status (sizeof (readers) / sizeof (readers[0]), readers, sizeof (writers) / sizeof (writers[0])))) { @@ -459,7 +459,7 @@ static void ddsc_multi_sertype_impl (dds_entity_t pp_pub, dds_entity_t pp_sub, e waitfor_or_reset_fastpath (readers[i], true, sizeof (writers) / sizeof (writers[0])); if (mode == MSM_SLOWPATH) { - printf ("clear fastpath_ok\n"); + (void) printf ("clear fastpath_ok\n"); for (size_t i = 0; i < sizeof (readers) / sizeof (readers[0]); i++) waitfor_or_reset_fastpath (readers[i], false, sizeof (writers) / sizeof (writers[0])); } @@ -487,7 +487,7 @@ static void ddsc_multi_sertype_impl (dds_entity_t pp_pub, dds_entity_t pp_sub, e ._length = 1, ._maximum = 1, ._release = false, ._buffer = (struct two_uint32[]) { { { 4, 2 } } } } } }; - printf ("writing ...\n"); + (void) printf ("writing ...\n"); rc = dds_write_ts (writers[SEQ_IDX], &s, 1); CU_ASSERT_FATAL (rc == DDS_RETCODE_OK); rc = dds_write_ts (writers[ARY_IDX], &a, 2); @@ -513,7 +513,7 @@ static void ddsc_multi_sertype_impl (dds_entity_t pp_pub, dds_entity_t pp_sub, e /* All readers should have received three samples, and those that are of type seq should have received one extra (whereas the others should cause deserialization failure warnings) */ - printf ("reading\n"); + (void) printf ("reading\n"); const size_t nexp = ((sizeof (writers) / sizeof (writers[0])) * (sizeof (readers) / sizeof (readers[0])) + ((sizeof (readers) / sizeof (readers[0])) / (sizeof (sub_topics) / sizeof (sub_topics[0])))); @@ -540,7 +540,7 @@ static void ddsc_multi_sertype_impl (dds_entity_t pp_pub, dds_entity_t pp_sub, e { if (!si.valid_data) continue; - printf ("recv: seq %"PRId64"\n", si.source_timestamp); + (void) printf ("recv: seq %"PRId64"\n", si.source_timestamp); if (si.source_timestamp == 4) { CU_ASSERT_FATAL (s.x._length == 1); @@ -566,7 +566,7 @@ static void ddsc_multi_sertype_impl (dds_entity_t pp_pub, dds_entity_t pp_sub, e { if (!si.valid_data) continue; - printf ("recv: ary %"PRId64"\n", si.source_timestamp); + (void) printf ("recv: ary %"PRId64"\n", si.source_timestamp); CU_ASSERT_FATAL (si.source_timestamp >= 1 && si.source_timestamp <= 3); CU_ASSERT_FATAL (a.x[0] == 3); CU_ASSERT_FATAL (a.x[1] == 1); @@ -583,7 +583,7 @@ static void ddsc_multi_sertype_impl (dds_entity_t pp_pub, dds_entity_t pp_sub, e { if (!si.valid_data) continue; - printf ("recv: uni %"PRId64"\n", si.source_timestamp); + (void) printf ("recv: uni %"PRId64"\n", si.source_timestamp); CU_ASSERT_FATAL (si.source_timestamp >= 1 && si.source_timestamp <= 3); CU_ASSERT_FATAL (u._d == 3); CU_ASSERT_FATAL (u._u.a._length == 1); @@ -604,7 +604,7 @@ static void ddsc_multi_sertype_impl (dds_entity_t pp_pub, dds_entity_t pp_sub, e { if (!si.valid_data) continue; - printf ("recv: reader %zu %"PRId64"\n", i, si.source_timestamp); + (void) printf ("recv: reader %zu %"PRId64"\n", i, si.source_timestamp); CU_ASSERT_FATAL (sample->type == get_sertype_from_reader (readers[i])); ddsi_serdata_unref (sample); nseen++; diff --git a/src/core/ddsc/tests/nwpart.c b/src/core/ddsc/tests/nwpart.c index 4bd4109d1b..e8ac316164 100644 --- a/src/core/ddsc/tests/nwpart.c +++ b/src/core/ddsc/tests/nwpart.c @@ -39,7 +39,7 @@ static int errcount; static void null_log_sink (void *vcount, const dds_log_data_t *msg) { int *count = vcount; - printf ("%s", msg->message); + (void) printf ("%s", msg->message); (*count)++; } @@ -175,19 +175,19 @@ static bool check_address_list (const char *expected, struct ddsi_networkpartiti while ((tok = ddsrt_strsep (&cursor, ",")) != NULL) { if (as == NULL) { - printf ("check_address_list: too few addresses\n"); + (void) printf ("check_address_list: too few addresses\n"); goto err; } char buf[DDSI_LOCSTRLEN]; ddsi_locator_to_string (buf, sizeof (buf), &as->loc); if (strcmp (tok, buf) != 0) { - printf ("check_address_list: expected %s, got %s\n", tok, buf); + (void) printf ("check_address_list: expected %s, got %s\n", tok, buf); goto err; } as = as->next; } if (as != NULL) { - printf ("check_address_list: too many addresses\n"); + (void) printf ("check_address_list: too many addresses\n"); goto err; } ddsrt_free (copy); @@ -247,7 +247,7 @@ CU_Theory ((struct ddsi_config_networkpartition_listelem ps, bool allow_mc, cons // Low-level trickery so we can control the addresses/network interfaces without // having any system dependency assert ((uc == NULL) == (mc == NULL)); - printf ("test: %s\n", ps.name); + (void) printf ("test: %s\n", ps.name); struct ddsi_domaingv gv; struct ddsi_config config; ddsi_config_init_default (&config); @@ -362,7 +362,7 @@ CU_Test (ddsc_nwpart, mapping_multiple) // given that: CU_ASSERT_FATAL (m0->partition == p0); CU_ASSERT_FATAL (m1->partition == p2); - dds_delete (eh); + (void) dds_delete (eh); #endif } @@ -376,7 +376,7 @@ static void check_address_present (const ddsi_xlocator_t *loc, void *varg) struct check_address_present_arg *arg = varg; char buf[DDSI_LOCSTRLEN]; ddsi_xlocator_to_string (buf, sizeof (buf), loc); - printf (" %s", buf); + (void) printf (" %s", buf); int i = 0; while (arg->expected[i] && strcmp (arg->expected[i], buf) != 0) i++; @@ -493,8 +493,8 @@ CU_Theory ((bool same_machine, bool proxypp_has_defmc, int n_ep_uc, int n_ep_mc, // network partitions and in interpreting the lists of discovery addresses. // // So as long as this is the only test for this, it might as well be here. - printf ("---------------\n"); - printf ("same_machine %d proxypp_has_defmc %d n_ep_uc %d n_ep_mc %d\n", same_machine, proxypp_has_defmc, n_ep_uc, n_ep_mc); + (void) printf ("---------------\n"); + (void) printf ("same_machine %d proxypp_has_defmc %d n_ep_uc %d n_ep_mc %d\n", same_machine, proxypp_has_defmc, n_ep_uc, n_ep_mc); struct ddsi_domaingv gv; struct ddsi_config config; ddsi_config_init_default (&config); @@ -502,17 +502,17 @@ CU_Theory ((bool same_machine, bool proxypp_has_defmc, int n_ep_uc, int n_ep_mc, config.allowMulticast = DDSI_AMC_TRUE; errcount = 0; setup (&gv, &config, true, false); - printf ("interfaces =\n"); + (void) printf ("interfaces =\n"); for (int i = 0; i < gv.n_interfaces; i++) { char buf[DDSI_LOCSTRLEN]; - printf (" %s", ddsi_locator_to_string_no_port (buf, sizeof (buf), &gv.interfaces[i].loc)); - printf (" extern: %s", ddsi_locator_to_string_no_port (buf, sizeof (buf), &gv.interfaces[i].extloc)); - printf (" (%smc)\n", gv.interfaces[i].mc_capable ? "" : "no-"); + (void) printf (" %s", ddsi_locator_to_string_no_port (buf, sizeof (buf), &gv.interfaces[i].loc)); + (void) printf (" extern: %s", ddsi_locator_to_string_no_port (buf, sizeof (buf), &gv.interfaces[i].extloc)); + (void) printf (" (%smc)\n", gv.interfaces[i].mc_capable ? "" : "no-"); } // pretend the remote one is on another machine but on the same networks - printf ("as_default =\n"); + (void) printf ("as_default =\n"); struct addrset *as_default = new_addrset (); for (int i = (same_machine ? 0 : 1); i < gv.n_interfaces; i++) { @@ -524,7 +524,7 @@ CU_Theory ((bool same_machine, bool proxypp_has_defmc, int n_ep_uc, int n_ep_mc, if (!same_machine && i > 0) // i = 0 => loopback => no change xloc.c.address[15]++; char buf[DDSI_LOCSTRLEN]; - printf (" %s\n", ddsi_xlocator_to_string (buf, sizeof (buf), &xloc)); + (void) printf (" %s\n", ddsi_xlocator_to_string (buf, sizeof (buf), &xloc)); add_xlocator_to_addrset (&gv, as_default, &xloc); } @@ -541,7 +541,7 @@ CU_Theory ((bool same_machine, bool proxypp_has_defmc, int n_ep_uc, int n_ep_mc, { ddsi_xlocator_t xloc = { .conn = gv.xmit_conns[i], .c = defmcloc }; char buf[DDSI_LOCSTRLEN]; - printf (" %s\n", ddsi_xlocator_to_string (buf, sizeof (buf), &xloc)); + (void) printf (" %s\n", ddsi_xlocator_to_string (buf, sizeof (buf), &xloc)); add_xlocator_to_addrset (&gv, as_default, &xloc); } } @@ -593,7 +593,7 @@ CU_Theory ((bool same_machine, bool proxypp_has_defmc, int n_ep_uc, int n_ep_mc, { char buf[1024]; ddsi_plist_print (buf, sizeof (buf), &plist); - printf ("advertised plist: %s\n", buf); + (void) printf ("advertised plist: %s\n", buf); } struct addrset *as = ddsi_get_endpoint_addrset (&gv, &plist, as_default, NULL); @@ -605,16 +605,16 @@ CU_Theory ((bool same_machine, bool proxypp_has_defmc, int n_ep_uc, int n_ep_mc, .expected = expected, .ok = (addrset_count (as) == (size_t) n) }; - printf ("addrset ="); + (void) printf ("addrset ="); addrset_forall (as, check_address_present, &arg); if (arg.ok) - printf ("\nOK\n"); + (void) printf ("\nOK\n"); else { - printf ("\nexpected ="); + (void) printf ("\nexpected ="); for (int i = 0; expected[i]; i++) - printf (" %s", expected[i]); - printf ("\n(in any order)\n"); + (void) printf (" %s", expected[i]); + (void) printf ("\n(in any order)\n"); } CU_ASSERT (arg.ok); unref_addrset (as); diff --git a/src/core/ddsc/tests/oneliner.c b/src/core/ddsc/tests/oneliner.c index 2ba6bdf50d..d612c967d7 100644 --- a/src/core/ddsc/tests/oneliner.c +++ b/src/core/ddsc/tests/oneliner.c @@ -57,7 +57,7 @@ int main (int argc, char **argv) { if (test_indent < SIZE_MAX) (void) test_oneliner_fini (&ctx); - fprintf (stderr, "stdin:%u: line too long\n", lineno); + (void) fprintf (stderr, "stdin:%u: line too long\n", lineno); return 1; } @@ -86,12 +86,12 @@ int main (int argc, char **argv) { if (test_oneliner_fini (&ctx) <= 0) { - fprintf (stderr, "stdin:%u-%u: FAIL: %s\n", test_begin, test_end, test_oneliner_message (&ctx)); + (void) fprintf (stderr, "stdin:%u-%u: FAIL: %s\n", test_begin, test_end, test_oneliner_message (&ctx)); return 1; } - printf ("\n"); + (void) printf ("\n"); } - printf ("------ stdin:%u ------\n", lineno); + (void) printf ("------ stdin:%u ------\n", lineno); test_indent = indent; test_begin = lineno; test_oneliner_init (&ctx, NULL); @@ -102,10 +102,10 @@ int main (int argc, char **argv) } if (test_indent < SIZE_MAX && test_oneliner_fini (&ctx) <= 0) - fprintf (stderr, "stdin:%u-%u: FAIL: %s\n", test_begin, test_end, test_oneliner_message (&ctx)); + (void) fprintf (stderr, "stdin:%u-%u: FAIL: %s\n", test_begin, test_end, test_oneliner_message (&ctx)); if (ferror (stdin)) { - fprintf (stderr, "error reading stdin\n"); + (void) fprintf (stderr, "error reading stdin\n"); return 1; } } diff --git a/src/core/ddsc/tests/participant.c b/src/core/ddsc/tests/participant.c index b0d53e9956..9f8cb8afc7 100644 --- a/src/core/ddsc/tests/participant.c +++ b/src/core/ddsc/tests/participant.c @@ -28,13 +28,13 @@ CU_Test(ddsc_participant, create_and_delete) { participant2 = dds_create_participant (DDS_DOMAIN_DEFAULT, NULL, NULL); CU_ASSERT_FATAL(participant2 > 0); - dds_delete (participant); - dds_delete (participant2); + (void) dds_delete (participant); + (void) dds_delete (participant2); participant3 = dds_create_participant (DDS_DOMAIN_DEFAULT, NULL, NULL); CU_ASSERT_FATAL(participant3 > 0); - dds_delete (participant3); + (void) dds_delete (participant3); } @@ -64,8 +64,8 @@ CU_Test(ddsc_participant, create_with_no_conf_no_env) CU_ASSERT_EQUAL_FATAL(status, DDS_RETCODE_OK); CU_ASSERT_EQUAL_FATAL(domain_id, valid_domain); - dds_delete(participant2); - dds_delete(participant3); + (void) dds_delete(participant2); + (void) dds_delete(participant3); } @@ -94,8 +94,8 @@ CU_Test(ddsc_participant, create_multiple_domains) CU_ASSERT_EQUAL_FATAL(status, DDS_RETCODE_OK); CU_ASSERT_EQUAL_FATAL(domain_id, 2); - dds_delete(participant1); - dds_delete(participant2); + (void) dds_delete(participant1); + (void) dds_delete(participant2); } @@ -130,8 +130,8 @@ CU_Test(ddsc_participant, create_with_conf_no_env) { CU_ASSERT_EQUAL_FATAL(status, DDS_RETCODE_OK); CU_ASSERT_EQUAL_FATAL(domain_id, valid_domain); - dds_delete(participant2); - dds_delete(participant3); + (void) dds_delete(participant2); + (void) dds_delete(participant3); } CU_Test(ddsc_participant_lookup, one) { @@ -154,7 +154,7 @@ CU_Test(ddsc_participant_lookup, one) { CU_ASSERT_EQUAL_FATAL(num_of_found_pp, 1); CU_ASSERT_EQUAL_FATAL(participants[0], participant); - dds_delete (participant); + (void) dds_delete (participant); } CU_Test(ddsc_participant_lookup, multiple) { @@ -182,8 +182,8 @@ CU_Test(ddsc_participant_lookup, multiple) { CU_ASSERT_FATAL(participants[1] == participant || participants[1] == participant2); CU_ASSERT_NOT_EQUAL_FATAL(participants[0], participants[1]); - dds_delete (participant2); - dds_delete (participant); + (void) dds_delete (participant2); + (void) dds_delete (participant); } CU_Test(ddsc_participant_lookup, array_too_small) { @@ -214,9 +214,9 @@ CU_Test(ddsc_participant_lookup, array_too_small) { CU_ASSERT_FATAL(participants[1] == participant || participants[1] == participant2 || participants[1] == participant3); CU_ASSERT_NOT_EQUAL_FATAL(participants[0], participants[1]); - dds_delete (participant3); - dds_delete (participant2); - dds_delete (participant); + (void) dds_delete (participant3); + (void) dds_delete (participant2); + (void) dds_delete (participant); } CU_Test(ddsc_participant_lookup, null_zero){ @@ -237,7 +237,7 @@ CU_Test(ddsc_participant_lookup, null_zero){ num_of_found_pp = dds_lookup_participant( domain_id, NULL, size); CU_ASSERT_EQUAL_FATAL(num_of_found_pp, 1); - dds_delete (participant); + (void) dds_delete (participant); } CU_Test(ddsc_participant_lookup, null_nonzero){ @@ -258,7 +258,7 @@ CU_Test(ddsc_participant_lookup, null_nonzero){ num_of_found_pp = dds_lookup_participant( domain_id, NULL, size); CU_ASSERT_EQUAL_FATAL(num_of_found_pp, DDS_RETCODE_BAD_PARAMETER); - dds_delete (participant); + (void) dds_delete (participant); } CU_Test(ddsc_participant_lookup, unknown_id) { @@ -281,7 +281,7 @@ CU_Test(ddsc_participant_lookup, unknown_id) { num_of_found_pp = dds_lookup_participant( domain_id, participants, size); CU_ASSERT_EQUAL_FATAL(num_of_found_pp, 0); - dds_delete (participant); + (void) dds_delete (participant); } CU_Test(ddsc_participant_lookup, none) { @@ -310,7 +310,7 @@ CU_Test(ddsc_participant_lookup, no_more) { status = dds_get_domainid(participant, &domain_id); CU_ASSERT_EQUAL_FATAL(status, DDS_RETCODE_OK); - dds_delete (participant); + (void) dds_delete (participant); num_of_found_pp = dds_lookup_participant( domain_id, participants, size); CU_ASSERT_EQUAL_FATAL(num_of_found_pp, 0); @@ -335,11 +335,11 @@ CU_Test(ddsc_participant_lookup, deleted) { status = dds_get_domainid(participant, &domain_id); CU_ASSERT_EQUAL_FATAL(status, DDS_RETCODE_OK); - dds_delete (participant2); + (void) dds_delete (participant2); num_of_found_pp = dds_lookup_participant( domain_id, participants, size); CU_ASSERT_EQUAL_FATAL(num_of_found_pp, 1); CU_ASSERT_FATAL(participants[0] == participant); - dds_delete (participant); + (void) dds_delete (participant); } diff --git a/src/core/ddsc/tests/pp_lease_dur.c b/src/core/ddsc/tests/pp_lease_dur.c index 2255f5cb80..3329d59257 100644 --- a/src/core/ddsc/tests/pp_lease_dur.c +++ b/src/core/ddsc/tests/pp_lease_dur.c @@ -28,7 +28,7 @@ struct guidstr { char s[4*8+4]; }; static char *guidstr (struct guidstr *dst, const dds_guid_t *g) { const uint8_t *v = g->v; - snprintf (dst->s, sizeof (dst->s), "%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x", + (void) snprintf (dst->s, sizeof (dst->s), "%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x:%02x%02x%02x%02x", v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15]); return dst->s; } diff --git a/src/core/ddsc/tests/publisher.c b/src/core/ddsc/tests/publisher.c index 72b109e22e..754d96ae43 100644 --- a/src/core/ddsc/tests/publisher.c +++ b/src/core/ddsc/tests/publisher.c @@ -52,7 +52,7 @@ CU_Test(ddsc_publisher, create) /* Use entity that is not a participant */ publisher1 = dds_create_publisher(publisher, NULL, NULL); CU_ASSERT_EQUAL_FATAL(publisher1, DDS_RETCODE_ILLEGAL_OPERATION); - dds_delete(publisher); + (void) dds_delete(publisher); /* Create a non-null qos */ qos = dds_create_qos(); @@ -61,7 +61,7 @@ CU_Test(ddsc_publisher, create) /* Use qos without partition; in that case the default partition should be used */ publisher = dds_create_publisher(participant, qos, NULL); CU_ASSERT_FATAL(publisher > 0); - dds_delete(publisher); + (void) dds_delete(publisher); /* Somehow, the compiler thinks the char arrays might not be zero-terminated... */ #ifdef _MSC_VER @@ -73,19 +73,19 @@ CU_Test(ddsc_publisher, create) dds_qset_partition (qos, 1, singlePartitions); publisher = dds_create_publisher(participant, qos, NULL); CU_ASSERT_FATAL(publisher > 0); - dds_delete(publisher); + (void) dds_delete(publisher); /* Use qos with multiple partitions */ dds_qset_partition (qos, 2, multiplePartitions); publisher = dds_create_publisher(participant, qos, NULL); CU_ASSERT_FATAL(publisher > 0); - dds_delete(publisher); + (void) dds_delete(publisher); /* Use qos with multiple partitions */ dds_qset_partition (qos, 2, duplicatePartitions); publisher = dds_create_publisher(participant, qos, NULL); CU_ASSERT_FATAL(publisher > 0); - dds_delete(publisher); + (void) dds_delete(publisher); #ifdef _MSC_VER #pragma warning(pop) @@ -96,7 +96,7 @@ CU_Test(ddsc_publisher, create) CU_ASSERT_NOT_EQUAL_FATAL(listener, NULL); publisher = dds_create_publisher(participant, NULL, listener); CU_ASSERT_FATAL(publisher > 0); - dds_delete(publisher); + (void) dds_delete(publisher); dds_reset_listener(listener); @@ -104,7 +104,7 @@ CU_Test(ddsc_publisher, create) dds_lset_data_available(listener, NULL); publisher = dds_create_publisher(participant, NULL, listener); CU_ASSERT_FATAL(publisher > 0); - dds_delete(publisher); + (void) dds_delete(publisher); dds_reset_listener(listener); @@ -112,7 +112,7 @@ CU_Test(ddsc_publisher, create) dds_lset_data_available(listener, DDS_LUNSET); publisher = dds_create_publisher(participant, NULL, listener); CU_ASSERT_FATAL(publisher > 0); - dds_delete(publisher); + (void) dds_delete(publisher); dds_reset_listener(listener); @@ -120,17 +120,17 @@ CU_Test(ddsc_publisher, create) dds_lset_data_available(listener, data_available_cb); publisher = dds_create_publisher(participant, NULL, listener); CU_ASSERT_FATAL(publisher > 0); - dds_delete(publisher); + (void) dds_delete(publisher); /* Use both qos setting and callback listener */ dds_lset_data_available(listener, data_available_cb); publisher = dds_create_publisher(participant, qos, listener); CU_ASSERT(publisher > 0); - dds_delete(publisher); + (void) dds_delete(publisher); dds_delete_listener(listener); dds_delete_qos(qos); - dds_delete (participant); + (void) dds_delete (participant); } CU_Test(ddsc_publisher, invalid_qos) @@ -195,8 +195,8 @@ CU_Test(ddsc_publisher, suspend_resume) status = dds_resume(publisher); CU_ASSERT_EQUAL_FATAL(status, DDS_RETCODE_UNSUPPORTED); - dds_delete(publisher); - dds_delete(participant); + (void) dds_delete(publisher); + (void) dds_delete(participant); return; } @@ -285,8 +285,8 @@ CU_Test(ddsc_publisher, wait_for_acks) status = dds_wait_for_acks(publisher, DDS_INFINITY); CU_ASSERT_EQUAL_FATAL(status, DDS_RETCODE_UNSUPPORTED); - dds_delete(publisher); - dds_delete(participant); + (void) dds_delete(publisher); + (void) dds_delete(participant); return; } diff --git a/src/core/ddsc/tests/qosmatch.c b/src/core/ddsc/tests/qosmatch.c index 58a6cf2120..443eae8d73 100644 --- a/src/core/ddsc/tests/qosmatch.c +++ b/src/core/ddsc/tests/qosmatch.c @@ -53,11 +53,11 @@ static void setqos (dds_qos_t *q, size_t i, bool isrd, bool create) else { char buf[20]; - snprintf (buf, sizeof (buf), "ud%zu%c", i, isrd ? 'r' : 'w'); + (void) snprintf (buf, sizeof (buf), "ud%zu%c", i, isrd ? 'r' : 'w'); dds_qset_userdata (q, buf, strlen (buf)); - snprintf (buf, sizeof (buf), "td%zu", i); + (void) snprintf (buf, sizeof (buf), "td%zu", i); dds_qset_topicdata (q, buf, strlen (buf)); - snprintf (buf, sizeof (buf), "gd%zu", psi); + (void) snprintf (buf, sizeof (buf), "gd%zu", psi); dds_qset_groupdata (q, buf, strlen (buf)); } } @@ -72,11 +72,11 @@ static void setqos (dds_qos_t *q, size_t i, bool isrd, bool create) else { char buf[20]; - snprintf (buf, sizeof (buf), "ud%zu%c", i, isrd ? 'r' : 'w'); + (void) snprintf (buf, sizeof (buf), "ud%zu%c", i, isrd ? 'r' : 'w'); dds_qset_userdata (q, buf, strlen (buf)); - snprintf (buf, sizeof (buf), "td%zu", (size_t) 0); + (void) snprintf (buf, sizeof (buf), "td%zu", (size_t) 0); dds_qset_topicdata (q, buf, strlen (buf)); - snprintf (buf, sizeof (buf), "gd%zu", psi); + (void) snprintf (buf, sizeof (buf), "gd%zu", psi); dds_qset_groupdata (q, buf, strlen (buf)); } } @@ -115,7 +115,7 @@ static void setqos (dds_qos_t *q, size_t i, bool isrd, bool create) { const size_t n = 40; ps[j] = ddsrt_malloc (n); - snprintf (ps[j], n, "p%zu_%zu", psi, isrd ? (psi-j-1) : j); + (void) snprintf (ps[j], n, "p%zu_%zu", psi, isrd ? (psi-j-1) : j); } dds_qset_partition (q, (uint32_t) psi, (const char **) ps); for (size_t j = 0; j < psi; j++) @@ -305,7 +305,7 @@ static uint32_t pub_thread (void *varg) CU_ASSERT_FATAL (rc == 0); /* Wait until subscribers terminate */ - printf ("wait for subscribers to terminate\n"); + (void) printf ("wait for subscribers to terminate\n"); fflush (stdout); while (true) { @@ -442,7 +442,7 @@ static uint32_t sub_thread (void *varg) dds_sleepfor (DDS_MSECS (100)); } - printf ("wait for publisher to have completed its checks\n"); + (void) printf ("wait for publisher to have completed its checks\n"); wait_for_done (pprd, UD_QMPUBDONE); dds_delete_qos (qos); diff --git a/src/core/ddsc/tests/querycondition.c b/src/core/ddsc/tests/querycondition.c index 11c1ff82b0..e65f223b64 100644 --- a/src/core/ddsc/tests/querycondition.c +++ b/src/core/ddsc/tests/querycondition.c @@ -190,11 +190,11 @@ querycondition_init_deephist(void) static void querycondition_fini(void) { - dds_delete(g_reader); - dds_delete(g_writer); - dds_delete(g_waitset); - dds_delete(g_topic); - dds_delete(g_participant); + (void) dds_delete(g_reader); + (void) dds_delete(g_writer); + (void) dds_delete(g_waitset); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); } @@ -232,7 +232,7 @@ CU_Test(ddsc_querycondition_create, deleted_reader, .init=querycondition_init, . { uint32_t mask = DDS_ANY_SAMPLE_STATE | DDS_ANY_VIEW_STATE | DDS_ANY_INSTANCE_STATE; dds_entity_t cond; - dds_delete(g_reader); + (void) dds_delete(g_reader); cond = dds_create_querycondition(g_reader, mask, filter_mod2); CU_ASSERT_EQUAL_FATAL(cond, DDS_RETCODE_BAD_PARAMETER); } @@ -282,7 +282,7 @@ CU_Test(ddsc_querycondition_get_mask, deleted, .init=querycondition_init, .fini= dds_return_t ret; condition = dds_create_querycondition(g_reader, mask, filter_mod2); CU_ASSERT_FATAL(condition > 0); - dds_delete(condition); + (void) dds_delete(condition); mask = 0; ret = dds_get_mask(condition, &mask); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); @@ -301,7 +301,7 @@ CU_Test(ddsc_querycondition_get_mask, null, .init=querycondition_init, .fini=que ret = dds_get_mask(condition, NULL); DDSRT_WARNING_MSVC_ON(6387); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -352,7 +352,7 @@ CU_Theory((uint32_t ss, uint32_t vs, uint32_t is), ddsc_querycondition_get_mask, CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK); CU_ASSERT_EQUAL_FATAL(maskIn, maskOut); - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -410,7 +410,7 @@ CU_Test(ddsc_querycondition_read, any, .init=querycondition_init, .fini=querycon CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -460,7 +460,7 @@ CU_Test(ddsc_querycondition_read, not_read_sample_state, .init=querycondition_in CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -510,7 +510,7 @@ CU_Test(ddsc_querycondition_read, read_sample_state, .init=querycondition_init, CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -560,7 +560,7 @@ CU_Test(ddsc_querycondition_read, new_view_state, .init=querycondition_init, .fi CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -610,7 +610,7 @@ CU_Test(ddsc_querycondition_read, not_new_view_state, .init=querycondition_init, CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -660,7 +660,7 @@ CU_Test(ddsc_querycondition_read, alive_instance_state, .init=querycondition_ini CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -710,7 +710,7 @@ CU_Test(ddsc_querycondition_read, disposed_instance_state, .init=querycondition_ CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -760,7 +760,7 @@ CU_Test(ddsc_querycondition_read, no_writers_instance_state, .init=queryconditio CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -810,7 +810,7 @@ CU_Test(ddsc_querycondition_read, combination_of_states, .init=querycondition_in CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -840,7 +840,7 @@ CU_Test(ddsc_querycondition_read, none, .init=querycondition_init, .fini=queryco * | 6 | 3 | 2 | not_read | new | alive | */ - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -891,7 +891,7 @@ CU_Test(ddsc_querycondition_read, with_mask, .init=querycondition_init, .fini=qu CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -973,7 +973,7 @@ CU_Test(ddsc_querycondition_take, any, .init=querycondition_init, .fini=querycon CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -1023,7 +1023,7 @@ CU_Test(ddsc_querycondition_take, not_read_sample_state, .init=querycondition_in CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -1073,7 +1073,7 @@ CU_Test(ddsc_querycondition_take, read_sample_state, .init=querycondition_init, CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -1123,7 +1123,7 @@ CU_Test(ddsc_querycondition_take, new_view_state, .init=querycondition_init, .fi CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -1173,7 +1173,7 @@ CU_Test(ddsc_querycondition_take, not_new_view_state, .init=querycondition_init, CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -1223,7 +1223,7 @@ CU_Test(ddsc_querycondition_take, alive_instance_state, .init=querycondition_ini CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -1273,7 +1273,7 @@ CU_Test(ddsc_querycondition_take, disposed_instance_state, .init=querycondition_ CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -1323,7 +1323,7 @@ CU_Test(ddsc_querycondition_take, no_writers_instance_state, .init=queryconditio CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -1373,7 +1373,7 @@ CU_Test(ddsc_querycondition_take, combination_of_states, .init=querycondition_in CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -1403,7 +1403,7 @@ CU_Test(ddsc_querycondition_take, none, .init=querycondition_init, .fini=queryco * | 6 | 3 | 2 | not_read | new | alive | */ - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ @@ -1454,7 +1454,7 @@ CU_Test(ddsc_querycondition_take, with_mask, .init=querycondition_init, .fini=qu CU_ASSERT_EQUAL_FATAL(g_info[i].instance_state, expected_ist); } - dds_delete(condition); + (void) dds_delete(condition); } /*************************************************************************************************/ diff --git a/src/core/ddsc/tests/read_instance.c b/src/core/ddsc/tests/read_instance.c index 3d4f8c6e6e..4dcf861064 100644 --- a/src/core/ddsc/tests/read_instance.c +++ b/src/core/ddsc/tests/read_instance.c @@ -236,15 +236,15 @@ read_instance_init(void) static void read_instance_fini(void) { - dds_delete(g_rcond); - dds_delete(g_qcond); - dds_delete(g_reader); - dds_delete(g_writer); - dds_delete(g_subscriber); - dds_delete(g_publisher); - dds_delete(g_waitset); - dds_delete(g_topic); - dds_delete(g_participant); + (void) dds_delete(g_rcond); + (void) dds_delete(g_qcond); + (void) dds_delete(g_reader); + (void) dds_delete(g_writer); + (void) dds_delete(g_subscriber); + (void) dds_delete(g_publisher); + (void) dds_delete(g_waitset); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); } static dds_return_t diff --git a/src/core/ddsc/tests/readcondition.c b/src/core/ddsc/tests/readcondition.c index 571a19302f..7e254cffe6 100644 --- a/src/core/ddsc/tests/readcondition.c +++ b/src/core/ddsc/tests/readcondition.c @@ -202,7 +202,7 @@ CU_Test(ddsc_readcondition_create, deleted_reader, .init=readcondition_init, .fi { uint32_t mask = DDS_ANY_SAMPLE_STATE | DDS_ANY_VIEW_STATE | DDS_ANY_INSTANCE_STATE; dds_entity_t cond; - dds_delete (g_reader); + (void) dds_delete (g_reader); cond = dds_create_readcondition (g_reader, mask); CU_ASSERT_EQUAL_FATAL (cond, DDS_RETCODE_BAD_PARAMETER); } @@ -236,7 +236,7 @@ CU_Test(ddsc_readcondition_get_mask, deleted, .init=readcondition_init, .fini=re dds_return_t ret; condition = dds_create_readcondition (g_reader, mask); CU_ASSERT_FATAL (condition > 0); - dds_delete (condition); + (void) dds_delete (condition); mask = 0; ret = dds_get_mask (condition, &mask); CU_ASSERT_EQUAL_FATAL (ret, DDS_RETCODE_BAD_PARAMETER); @@ -253,7 +253,7 @@ CU_Test(ddsc_readcondition_get_mask, null, .init=readcondition_init, .fini=readc ret = dds_get_mask (condition, NULL); DDSRT_WARNING_MSVC_ON (6387); CU_ASSERT_EQUAL_FATAL (ret, DDS_RETCODE_BAD_PARAMETER); - dds_delete (condition); + (void) dds_delete (condition); } CU_TheoryDataPoints(ddsc_readcondition_get_mask, invalid_conditions) = { @@ -459,13 +459,13 @@ static void readcondition_readtake ( if (mask == 0) { ret = op (condition, g_samples, g_info, MAX_SAMPLES, MAX_SAMPLES); - printf ("readcondition_readtake: %s: check %s/%s/%s expecting %d samples, got %d\n", + (void) printf ("readcondition_readtake: %s: check %s/%s/%s expecting %d samples, got %d\n", opname, sst_str (sst), vst_str (vst), ist_str (ist), expn, (int) ret); } else { ret = op_mask (condition, g_samples, g_info, MAX_SAMPLES, MAX_SAMPLES, mask); - printf ("readcondition_readtake: %s_mask: check %s/%s/%s + %s/%s/%s expecting %d samples, got %d\n", + (void) printf ("readcondition_readtake: %s_mask: check %s/%s/%s + %s/%s/%s expecting %d samples, got %d\n", opname, sst_str (sst), vst_str (vst), ist_str (ist), sst_str (mask & DDS_ANY_SAMPLE_STATE), vst_str (mask & DDS_ANY_VIEW_STATE), @@ -476,7 +476,7 @@ static void readcondition_readtake ( { const Space_Type1 *s = g_samples[i]; const dds_sample_info_t *si = &g_info[i]; - printf ("- %d %s/%s/%s\n", (int) s->long_1, sst_str (si->sample_state), vst_str (si->view_state), ist_str (si->instance_state)); + (void) printf ("- %d %s/%s/%s\n", (int) s->long_1, sst_str (si->sample_state), vst_str (si->view_state), ist_str (si->instance_state)); } CU_ASSERT_EQUAL_FATAL (ret, expn); @@ -528,7 +528,7 @@ static uint32_t writethread (void *varg) ret = dds_write (arg->wr, &data); } ddsrt_atomic_or32 (&arg->stop, (ret != 0) ? 2 : 0); - printf ("nwrites: %d\n", (int) data.long_3); + (void) printf ("nwrites: %d\n", (int) data.long_3); return 0; } @@ -610,8 +610,8 @@ CU_Test(ddsc_readcondition, stress) ddsrt_atomic_or32 (&wrarg.stop, 1); ddsrt_thread_join (wrtid, NULL); - printf ("nconds %"PRIu32"\n", nconds); - printf ("stop %"PRIu32"\n", ddsrt_atomic_ld32 (&wrarg.stop)); + (void) printf ("nconds %"PRIu32"\n", nconds); + (void) printf ("stop %"PRIu32"\n", ddsrt_atomic_ld32 (&wrarg.stop)); CU_ASSERT_FATAL (nconds > 100); // sanity check CU_ASSERT_FATAL (!(ddsrt_atomic_ld32 (&wrarg.stop) & 2)); diff --git a/src/core/ddsc/tests/reader.c b/src/core/ddsc/tests/reader.c index 071a9df45f..781b6c6bbb 100644 --- a/src/core/ddsc/tests/reader.c +++ b/src/core/ddsc/tests/reader.c @@ -181,11 +181,11 @@ reader_fini(void) { dds_delete_qos(g_qos); dds_delete_listener(g_listener); - dds_delete(g_reader); - dds_delete(g_writer); - dds_delete(g_waitset); - dds_delete(g_topic); - dds_delete(g_participant); + (void) dds_delete(g_reader); + (void) dds_delete(g_writer); + (void) dds_delete(g_waitset); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); } static dds_return_t @@ -272,7 +272,7 @@ CU_Test(ddsc_reader_create, wrong_participant, .init=reader_init, .fini=reader_f CU_ASSERT_FATAL(participant2 > 0); dds_entity_t reader = dds_create_reader(participant2, g_topic, NULL, NULL); CU_ASSERT_EQUAL_FATAL(reader, DDS_RETCODE_BAD_PARAMETER); - dds_delete(participant2); + (void) dds_delete(participant2); } /*************************************************************************************************/ @@ -303,10 +303,10 @@ CU_Test(ddsc_reader_create, participant_mismatch) /* Expect the creation to have failed. */ CU_ASSERT_FATAL(reader <= 0); - dds_delete(top2); - dds_delete(sub1); - dds_delete(par2); - dds_delete(par1); + (void) dds_delete(top2); + (void) dds_delete(sub1); + (void) dds_delete(par2); + (void) dds_delete(par1); } /*************************************************************************************************/ @@ -375,7 +375,7 @@ CU_Test(ddsc_read, already_deleted, .init=reader_init, .fini=reader_fini) { dds_return_t ret; /* Try to read with a deleted reader. */ - dds_delete(g_reader); + (void) dds_delete(g_reader); ret = dds_read(g_reader, g_samples, g_info, MAX_SAMPLES, MAX_SAMPLES); CU_ASSERT_EQUAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -484,7 +484,7 @@ CU_Test(ddsc_read_wl, already_deleted, .init=reader_init, .fini=reader_fini) { dds_return_t ret; /* Try to read with a deleted reader. */ - dds_delete(g_reader); + (void) dds_delete(g_reader); ret = dds_read_wl(g_reader, g_loans, g_info, MAX_SAMPLES); CU_ASSERT_EQUAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -610,7 +610,7 @@ CU_Test(ddsc_read_mask, already_deleted, .init=reader_init, .fini=reader_fini) uint32_t mask = DDS_ANY_SAMPLE_STATE | DDS_ANY_VIEW_STATE | DDS_ANY_INSTANCE_STATE; dds_return_t ret; /* Try to read with a deleted reader. */ - dds_delete(g_reader); + (void) dds_delete(g_reader); ret = dds_read_mask(g_reader, g_samples, g_info, MAX_SAMPLES, MAX_SAMPLES, mask); CU_ASSERT_EQUAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1157,7 +1157,7 @@ CU_Test(ddsc_read_mask_wl, already_deleted, .init=reader_init, .fini=reader_fini uint32_t mask = DDS_ANY_SAMPLE_STATE | DDS_ANY_VIEW_STATE | DDS_ANY_INSTANCE_STATE; dds_return_t ret; /* Try to read with a deleted reader. */ - dds_delete(g_reader); + (void) dds_delete(g_reader); ret = dds_read_mask_wl(g_reader, g_loans, g_info, MAX_SAMPLES, mask); CU_ASSERT_EQUAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1741,7 +1741,7 @@ CU_Test(ddsc_take, already_deleted, .init=reader_init, .fini=reader_fini) { dds_return_t ret; /* Try to take with a deleted reader. */ - dds_delete(g_reader); + (void) dds_delete(g_reader); ret = dds_take(g_reader, g_samples, g_info, MAX_SAMPLES, MAX_SAMPLES); CU_ASSERT_EQUAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1850,7 +1850,7 @@ CU_Test(ddsc_take_wl, already_deleted, .init=reader_init, .fini=reader_fini) { dds_return_t ret; /* Try to read with a deleted reader. */ - dds_delete(g_reader); + (void) dds_delete(g_reader); ret = dds_take_wl(g_reader, g_loans, g_info, MAX_SAMPLES); CU_ASSERT_EQUAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -1977,7 +1977,7 @@ CU_Test(ddsc_take_mask, already_deleted, .init=reader_init, .fini=reader_fini) uint32_t mask = DDS_ANY_SAMPLE_STATE | DDS_ANY_VIEW_STATE | DDS_ANY_INSTANCE_STATE; dds_return_t ret; /* Try to read with a deleted reader. */ - dds_delete(g_reader); + (void) dds_delete(g_reader); ret = dds_take_mask(g_reader, g_samples, g_info, MAX_SAMPLES, MAX_SAMPLES, mask); CU_ASSERT_EQUAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -2586,13 +2586,13 @@ CU_Test(ddsc_take_mask, take_instance_last_sample) * But now the problem appeared: * The reader crashed when deleting.... */ - dds_delete(g_reader); + (void) dds_delete(g_reader); /* Before the crash was fixed, we didn't come here. */ - dds_delete(g_writer); - dds_delete(g_waitset); - dds_delete(g_topic); - dds_delete(g_participant); + (void) dds_delete(g_writer); + (void) dds_delete(g_waitset); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); dds_delete_qos(g_qos); } /*************************************************************************************************/ @@ -2657,7 +2657,7 @@ CU_Test(ddsc_take_mask_wl, already_deleted, .init=reader_init, .fini=reader_fini uint32_t mask = DDS_ANY_SAMPLE_STATE | DDS_ANY_VIEW_STATE | DDS_ANY_INSTANCE_STATE; dds_return_t ret; /* Try to read with a deleted reader. */ - dds_delete(g_reader); + (void) dds_delete(g_reader); ret = dds_take_mask_wl(g_reader, g_loans, g_info, MAX_SAMPLES, mask); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } diff --git a/src/core/ddsc/tests/reader_iterator.c b/src/core/ddsc/tests/reader_iterator.c index 2cb65933be..0ec526ee82 100644 --- a/src/core/ddsc/tests/reader_iterator.c +++ b/src/core/ddsc/tests/reader_iterator.c @@ -226,7 +226,7 @@ reader_iterator_init(void) ret = dds_read(qcond, g_samples, g_info, MAX_SAMPLES, MAX_SAMPLES); CU_ASSERT_FATAL(ret > 0); - dds_delete(qcond); + (void) dds_delete(qcond); } /* Dispose and unregister the last two samples. */ @@ -271,15 +271,15 @@ reader_iterator_init(void) static void reader_iterator_fini(void) { - dds_delete(g_rcond); - dds_delete(g_qcond); - dds_delete(g_reader); - dds_delete(g_writer); - dds_delete(g_subscriber); - dds_delete(g_publisher); - dds_delete(g_waitset); - dds_delete(g_topic); - dds_delete(g_participant); + (void) dds_delete(g_rcond); + (void) dds_delete(g_qcond); + (void) dds_delete(g_reader); + (void) dds_delete(g_writer); + (void) dds_delete(g_subscriber); + (void) dds_delete(g_publisher); + (void) dds_delete(g_waitset); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); } static dds_return_t diff --git a/src/core/ddsc/tests/register.c b/src/core/ddsc/tests/register.c index e8a434c1c9..0c6318528b 100644 --- a/src/core/ddsc/tests/register.c +++ b/src/core/ddsc/tests/register.c @@ -118,11 +118,11 @@ registering_init(void) static void registering_fini(void) { - dds_delete(g_reader); - dds_delete(g_writer); - dds_delete(g_waitset); - dds_delete(g_topic); - dds_delete(g_participant); + (void) dds_delete(g_reader); + (void) dds_delete(g_writer); + (void) dds_delete(g_waitset); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); } @@ -136,7 +136,7 @@ CU_Test(ddsc_register_instance, deleted_entity, .init=registering_init, .fini=re { dds_return_t ret; dds_instance_handle_t handle; - dds_delete(g_writer); + (void) dds_delete(g_writer); ret = dds_register_instance(g_writer, &handle, g_data); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } diff --git a/src/core/ddsc/tests/subscriber.c b/src/core/ddsc/tests/subscriber.c index ef12c7794a..d2e20f61e2 100644 --- a/src/core/ddsc/tests/subscriber.c +++ b/src/core/ddsc/tests/subscriber.c @@ -51,8 +51,8 @@ CU_Test(ddsc_subscriber, notify_readers) { ret = dds_notify_readers(subscriber); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_UNSUPPORTED); - dds_delete(subscriber); - dds_delete(participant); + (void) dds_delete(subscriber); + (void) dds_delete(participant); } CU_Test(ddsc_subscriber, create) { @@ -72,14 +72,14 @@ CU_Test(ddsc_subscriber, create) { subscriber = dds_create_subscriber(participant, NULL, NULL); CU_ASSERT_FATAL(subscriber > 0); - dds_delete(subscriber); + (void) dds_delete(subscriber); /*** Verify qos parameter ***/ sqos = dds_create_qos(); /* Use defaults (no user-defined policies) */ subscriber = dds_create_subscriber(participant, sqos, NULL); CU_ASSERT_FATAL(subscriber > 0); - dds_delete(subscriber); + (void) dds_delete(subscriber); dds_delete_qos(sqos); sqos = dds_create_qos(); @@ -88,7 +88,7 @@ CU_Test(ddsc_subscriber, create) { DDSRT_WARNING_CLANG_ON(assign-enum); subscriber = dds_create_subscriber(participant, sqos, NULL); CU_ASSERT_FATAL(subscriber > 0); - dds_delete(subscriber); + (void) dds_delete(subscriber); dds_delete_qos(sqos); sqos = dds_create_qos(); @@ -104,24 +104,24 @@ CU_Test(ddsc_subscriber, create) { listener = dds_create_listener(NULL); /* Use defaults (all listeners unset) */ subscriber = dds_create_subscriber(participant, NULL, listener); CU_ASSERT_FATAL(subscriber > 0); - dds_delete(subscriber); + (void) dds_delete(subscriber); dds_delete_listener(listener); listener = dds_create_listener(NULL); dds_lset_data_available(listener, &on_data_available); /* Set on_data_available listener */ subscriber = dds_create_subscriber(participant, NULL, listener); CU_ASSERT_FATAL(subscriber > 0); - dds_delete(subscriber); + (void) dds_delete(subscriber); dds_delete_listener(listener); listener = dds_create_listener(NULL); dds_lset_publication_matched(listener, &on_publication_matched); /* Set on_publication_matched listener (ignored, not applicable for subscriber) */ subscriber = dds_create_subscriber(participant, NULL, listener); CU_ASSERT_FATAL(subscriber > 0); - dds_delete(subscriber); + (void) dds_delete(subscriber); dds_delete_listener(listener); - dds_delete(participant); + (void) dds_delete(participant); } #ifdef _MSC_VER diff --git a/src/core/ddsc/tests/take_instance.c b/src/core/ddsc/tests/take_instance.c index 8baae06dbb..2bed6c635c 100644 --- a/src/core/ddsc/tests/take_instance.c +++ b/src/core/ddsc/tests/take_instance.c @@ -236,15 +236,15 @@ take_instance_init(void) static void take_instance_fini(void) { - dds_delete(g_rcond); - dds_delete(g_qcond); - dds_delete(g_reader); - dds_delete(g_writer); - dds_delete(g_subscriber); - dds_delete(g_publisher); - dds_delete(g_waitset); - dds_delete(g_topic); - dds_delete(g_participant); + (void) dds_delete(g_rcond); + (void) dds_delete(g_qcond); + (void) dds_delete(g_reader); + (void) dds_delete(g_writer); + (void) dds_delete(g_subscriber); + (void) dds_delete(g_publisher); + (void) dds_delete(g_waitset); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); } static dds_return_t diff --git a/src/core/ddsc/tests/test_common.c b/src/core/ddsc/tests/test_common.c index e94f4a4c3f..1b88d8c925 100644 --- a/src/core/ddsc/tests/test_common.c +++ b/src/core/ddsc/tests/test_common.c @@ -39,7 +39,7 @@ static void sync_reader_writer_impl (dds_entity_t participant_rd, dds_entity_t r CU_ASSERT_EQUAL_FATAL (ret, 0); ret = dds_waitset_detach (waitset_rd, reader); CU_ASSERT_EQUAL_FATAL (ret, DDS_RETCODE_OK); - dds_delete (waitset_rd); + (void) dds_delete (waitset_rd); /* Sync writer to reader. */ ret = dds_set_status_mask (writer, DDS_PUBLICATION_MATCHED_STATUS); @@ -56,7 +56,7 @@ static void sync_reader_writer_impl (dds_entity_t participant_rd, dds_entity_t r CU_ASSERT_EQUAL_FATAL (ret, 0); ret = dds_waitset_detach (waitset_wr, writer); CU_ASSERT_EQUAL_FATAL (ret, DDS_RETCODE_OK); - dds_delete (waitset_wr); + (void) dds_delete (waitset_wr); } void sync_reader_writer (dds_entity_t participant_rd, dds_entity_t reader, dds_entity_t participant_wr, dds_entity_t writer) diff --git a/src/core/ddsc/tests/test_oneliner.c b/src/core/ddsc/tests/test_oneliner.c index f84071527e..5774c02983 100644 --- a/src/core/ddsc/tests/test_oneliner.c +++ b/src/core/ddsc/tests/test_oneliner.c @@ -267,7 +267,7 @@ static int mvfprintf (struct oneliner_ctx *ctx, FILE *fp, const char *msg, va_li if (needs_timestamp) { const dds_time_t dt = dds_time () - ctx->l.tref; - fprintf (fp, "%d.%06d ", (int32_t) (dt / DDS_NSECS_IN_SEC), (int32_t) (dt % DDS_NSECS_IN_SEC) / 1000); + (void) fprintf (fp, "%d.%06d ", (int32_t) (dt / DDS_NSECS_IN_SEC), (int32_t) (dt % DDS_NSECS_IN_SEC) / 1000); } int n = vfprintf (fp, msg, args); fflush (fp); @@ -325,7 +325,7 @@ static void error_dds (struct oneliner_ctx *ctx, dds_return_t ret, const char *m va_end (ap); size_t n = strlen (ctx->msg); if (n < sizeof (ctx->msg)) - snprintf (ctx->msg + n, sizeof (ctx->msg) - n, " (%s)", dds_strretcode (ret)); + (void) snprintf (ctx->msg + n, sizeof (ctx->msg) - n, " (%s)", dds_strretcode (ret)); longjmp (ctx->jb, 1); } diff --git a/src/core/ddsc/tests/test_shm_serialization.c b/src/core/ddsc/tests/test_shm_serialization.c index 1e1c053844..717ea747df 100644 --- a/src/core/ddsc/tests/test_shm_serialization.c +++ b/src/core/ddsc/tests/test_shm_serialization.c @@ -86,15 +86,15 @@ CU_Test(ddsc_shm_serialization, get_serialized_size) { size_t serialized_size = ddsi_serdata_size(serdata) - sizeof(struct CDRHeader); ddsi_serdata_unref(serdata); - printf("required size %zu \n", required_size); - printf("actual_serialized_size %zu \n", serialized_size); + (void) printf("required size %zu \n", required_size); + (void) printf("actual_serialized_size %zu \n", serialized_size); // serialized size is always a multiple of 4 (padding is added to ensure this) CU_ASSERT(required_size == serialized_size); CU_ASSERT(required_size % 4 == 0); dds_topic_unpin(tp); - dds_delete(participant); + (void) dds_delete(participant); rc = dds_delete(DDS_CYCLONEDDS_HANDLE); CU_ASSERT_FATAL(rc == 0); } @@ -104,9 +104,9 @@ CU_Test(ddsc_shm_serialization, get_serialized_size) { static void printbuffer(void* buffer, size_t n) { char* buf = (char*) buffer; for (size_t i = 0; i < n; i++) { - printf("%02x ", buf[i] & 0xff); + (void) printf("%02x ", buf[i] & 0xff); } - printf("\n"); + (void) printf("\n"); } CU_Test(ddsc_shm_serialization, serialize_into) { @@ -148,15 +148,15 @@ CU_Test(ddsc_shm_serialization, serialize_into) { CU_ASSERT(memcmp(d->data, buffer, serialized_size) == 0); - printf("buffer "); + (void) printf("buffer "); printbuffer(buffer, serialized_size); - printf("serdata "); + (void) printf("serdata "); printbuffer(d->data, serialized_size); ddsi_serdata_unref(serdata); dds_free(buffer); dds_topic_unpin(tp); - dds_delete(participant); + (void) dds_delete(participant); rc = dds_delete(DDS_CYCLONEDDS_HANDLE); CU_ASSERT_FATAL(rc == 0); } @@ -239,7 +239,7 @@ CU_Test(ddsc_shm_serialization, transmit_dynamic_type, .timeout = 30) { } if (received != 1 || !infos[0].valid_data) { - printf("Failure - nothing received\n"); + (void) printf("Failure - nothing received\n"); goto fail; } @@ -248,13 +248,13 @@ CU_Test(ddsc_shm_serialization, transmit_dynamic_type, .timeout = 30) { CU_ASSERT(compare_messages(&sample, received_sample)); dds_delete_qos(qos); - dds_delete(participant); + (void) dds_delete(participant); rc = dds_delete(DDS_CYCLONEDDS_HANDLE); CU_ASSERT_FATAL(rc == 0); return; fail: dds_delete_qos(qos); - dds_delete(participant); - dds_delete(DDS_CYCLONEDDS_HANDLE); + (void) dds_delete(participant); + (void) dds_delete(DDS_CYCLONEDDS_HANDLE); CU_FAIL(); } diff --git a/src/core/ddsc/tests/test_util.c b/src/core/ddsc/tests/test_util.c index 026e4e3c99..06d70842bb 100644 --- a/src/core/ddsc/tests/test_util.c +++ b/src/core/ddsc/tests/test_util.c @@ -22,7 +22,7 @@ void tprintf (const char *msg, ...) { va_list args; dds_time_t t = dds_time (); - printf ("%d.%06d ", (int32_t) (t / DDS_NSECS_IN_SEC), (int32_t) (t % DDS_NSECS_IN_SEC) / 1000); + (void) printf ("%d.%06d ", (int32_t) (t / DDS_NSECS_IN_SEC), (int32_t) (t % DDS_NSECS_IN_SEC) / 1000); va_start (args, msg); vprintf (msg, args); va_end (args); diff --git a/src/core/ddsc/tests/topic.c b/src/core/ddsc/tests/topic.c index c9a8f750cd..c150382e3f 100644 --- a/src/core/ddsc/tests/topic.c +++ b/src/core/ddsc/tests/topic.c @@ -52,9 +52,9 @@ ddsc_topic_fini(void) { dds_delete_qos(g_qos); dds_delete_listener(g_listener); - dds_delete(g_topic_rtmdt); - dds_delete(g_topic_rtmaddr); - dds_delete(g_participant); + (void) dds_delete(g_topic_rtmdt); + (void) dds_delete(g_topic_rtmaddr); + (void) dds_delete(g_participant); } /* These will check the topic creation in various ways */ @@ -181,7 +181,7 @@ CU_Theory((char *name, size_t size), ddsc_topic_get_name, invalid_params, .init CU_Test(ddsc_topic_get_name, deleted, .init = ddsc_topic_init, .fini = ddsc_topic_fini) { char name[MAX_NAME_SIZE]; - dds_delete(g_topic_rtmdt); + (void) dds_delete(g_topic_rtmdt); dds_return_t ret = dds_get_name(g_topic_rtmdt, name, MAX_NAME_SIZE); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -233,7 +233,7 @@ CU_Theory((char *name, size_t size), ddsc_topic_get_type_name, invalid_params, . CU_Test(ddsc_topic_get_type_name, deleted, .init = ddsc_topic_init, .fini = ddsc_topic_fini) { char name[MAX_NAME_SIZE]; - dds_delete(g_topic_rtmdt); + (void) dds_delete(g_topic_rtmdt); dds_return_t ret = dds_get_type_name(g_topic_rtmdt, name, MAX_NAME_SIZE); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } diff --git a/src/core/ddsc/tests/topic_discovery.c b/src/core/ddsc/tests/topic_discovery.c index 9ace659785..68ae7acc73 100644 --- a/src/core/ddsc/tests/topic_discovery.c +++ b/src/core/ddsc/tests/topic_discovery.c @@ -57,9 +57,9 @@ static void topic_discovery_init (void) static void topic_discovery_fini (void) { - dds_delete (g_domain_remote); + (void) dds_delete (g_domain_remote); /* Add a delay so that sedp dispose messages for topics (and endpoints) are sent and processed */ - dds_delete (g_domain1); + (void) dds_delete (g_domain1); } CU_TheoryDataPoints(ddsc_topic_discovery, remote_topics) = { @@ -181,8 +181,8 @@ static void check_topic_samples (dds_entity_t topic_rd, char *topic_name, uint32 bool not_alive = sample_info->instance_state != DDS_IST_ALIVE; tprintf ("read topic: %s, key={", sample->topic_name); for (uint32_t i = 0; i < sizeof (first_key); i++) - printf ("%02x", sample->key.d[i]); - printf ("} %sALIVE\n", not_alive ? "NOT_" : ""); + (void) printf ("%02x", sample->key.d[i]); + (void) printf ("} %sALIVE\n", not_alive ? "NOT_" : ""); if (!not_alive && (topic_name == NULL || !strcmp (sample->topic_name, topic_name))) { if (topic_seen == 0) @@ -294,8 +294,8 @@ static uint32_t delete_participants_thread (void *varg) uint32_t n = NUM_PP; while (n-- > 0) { - dds_delete (participants[n]); - dds_delete (participants_remote[n]); + (void) dds_delete (participants[n]); + (void) dds_delete (participants_remote[n]); dds_sleepfor (DDS_MSECS (DELAY_MSECS)); } ddsrt_atomic_st32 (&terminate, 1); @@ -307,8 +307,8 @@ static uint32_t delete_topics_thread (void *varg) (void) varg; while (!ddsrt_atomic_ld32 (&terminate)) { - dds_delete (((dds_entity_t *) topics)[ddsrt_random () % (NUM_PP * NUM_TP)]); - dds_delete (((dds_entity_t *) topics_remote)[ddsrt_random () % (NUM_PP * NUM_TP)]); + (void) dds_delete (((dds_entity_t *) topics)[ddsrt_random () % (NUM_PP * NUM_TP)]); + (void) dds_delete (((dds_entity_t *) topics_remote)[ddsrt_random () % (NUM_PP * NUM_TP)]); dds_sleepfor (DDS_MSECS (DELAY_MSECS / NUM_TP)); } return 0; diff --git a/src/core/ddsc/tests/topic_find_global.c b/src/core/ddsc/tests/topic_find_global.c index 64d26bbfa1..91617a0aba 100644 --- a/src/core/ddsc/tests/topic_find_global.c +++ b/src/core/ddsc/tests/topic_find_global.c @@ -63,9 +63,9 @@ static void topic_find_global_init (void) static void topic_find_global_fini (void) { - dds_delete (g_domain1); - dds_delete (g_domain_remote1); - dds_delete (g_domain_remote2); + (void) dds_delete (g_domain1); + (void) dds_delete (g_domain_remote1); + (void) dds_delete (g_domain_remote2); } static void create_remote_topic (char * topic_name_remote) @@ -150,7 +150,7 @@ struct create_topic_thread_arg static void set_topic_name (char *name, const char *prefix, uint32_t index) { - snprintf (name, MAX_NAME_SIZE + 10, "%s_%u", prefix, index); + (void) snprintf (name, MAX_NAME_SIZE + 10, "%s_%u", prefix, index); } static uint32_t topics_thread (void *a) diff --git a/src/core/ddsc/tests/topic_find_local.c b/src/core/ddsc/tests/topic_find_local.c index ceb7a76bd5..efe88b824f 100644 --- a/src/core/ddsc/tests/topic_find_local.c +++ b/src/core/ddsc/tests/topic_find_local.c @@ -63,7 +63,7 @@ static void topic_find_local_fini (void) #ifdef DDS_HAS_TOPIC_DISCOVERY dds_free_typeinfo (g_type_info); #endif - dds_delete (g_domain1); + (void) dds_delete (g_domain1); } enum topic_find_local_domain_impl_delete_what { @@ -151,7 +151,7 @@ CU_Test(ddsc_topic_find_local, unknown, .init = topic_find_local_init, .fini = t CU_Test(ddsc_topic_find_local, deleted, .init = topic_find_local_init, .fini = topic_find_local_fini) { - dds_delete (g_topic1); + (void) dds_delete (g_topic1); dds_entity_t topic = dds_find_topic (DDS_FIND_SCOPE_PARTICIPANT, g_participant1, g_topic_name_local, g_type_info, 0); CU_ASSERT_EQUAL_FATAL (topic, 0); } diff --git a/src/core/ddsc/tests/transientlocal.c b/src/core/ddsc/tests/transientlocal.c index 6974b9a5e3..c1da186907 100644 --- a/src/core/ddsc/tests/transientlocal.c +++ b/src/core/ddsc/tests/transientlocal.c @@ -92,6 +92,6 @@ CU_Test(ddsc_transient_local, late_joiner) #endif CU_ASSERT_EQUAL_FATAL(ret, 4); - dds_delete(par); + (void) dds_delete(par); dds_delete_qos(qos); } diff --git a/src/core/ddsc/tests/typebuilder.c b/src/core/ddsc/tests/typebuilder.c index 2eea96dacd..286fc61be1 100644 --- a/src/core/ddsc/tests/typebuilder.c +++ b/src/core/ddsc/tests/typebuilder.c @@ -36,7 +36,7 @@ static void typebuilder_init (void) static void typebuilder_fini (void) { - dds_delete (g_participant); + (void) dds_delete (g_participant); } static void topic_type_ref (dds_entity_t topic, struct ddsi_type **type) @@ -151,7 +151,7 @@ CU_Theory((const dds_topic_descriptor_t *desc), ddsc_typebuilder, topic_desc, .i struct ddsi_type *type; dds_topic_descriptor_t *generated_desc; - printf ("Testing %s\n", desc->m_typename); + (void) printf ("Testing %s\n", desc->m_typename); create_unique_topic_name ("ddsc_typebuilder", topic_name, sizeof (topic_name)); topic = dds_create_topic (g_participant, desc, topic_name, NULL, NULL); @@ -164,42 +164,42 @@ CU_Theory((const dds_topic_descriptor_t *desc), ddsc_typebuilder, topic_desc, .i CU_ASSERT_EQUAL_FATAL (ret, DDS_RETCODE_OK); // check - printf ("size: %u (%u)\n", generated_desc->m_size, desc->m_size); + (void) printf ("size: %u (%u)\n", generated_desc->m_size, desc->m_size); CU_ASSERT_EQUAL_FATAL (desc->m_size, generated_desc->m_size); - printf ("align: %u (%u)\n", generated_desc->m_align, desc->m_align); + (void) printf ("align: %u (%u)\n", generated_desc->m_align, desc->m_align); CU_ASSERT_EQUAL_FATAL (desc->m_align, generated_desc->m_align); - printf ("flagset: %x (%x)\n", generated_desc->m_flagset, desc->m_flagset); + (void) printf ("flagset: %x (%x)\n", generated_desc->m_flagset, desc->m_flagset); CU_ASSERT_EQUAL_FATAL (desc->m_flagset, generated_desc->m_flagset); - printf ("nkeys: %u (%u)\n", generated_desc->m_nkeys, desc->m_nkeys); + (void) printf ("nkeys: %u (%u)\n", generated_desc->m_nkeys, desc->m_nkeys); CU_ASSERT_EQUAL_FATAL (desc->m_nkeys, generated_desc->m_nkeys); for (uint32_t n = 0; n < desc->m_nkeys; n++) { - printf("key[%u] name: %s (%s)\n", n, generated_desc->m_keys[n].m_name, desc->m_keys[n].m_name); + (void) printf("key[%u] name: %s (%s)\n", n, generated_desc->m_keys[n].m_name, desc->m_keys[n].m_name); CU_ASSERT_EQUAL_FATAL (strcmp (desc->m_keys[n].m_name, generated_desc->m_keys[n].m_name), 0); - printf(" offset: %u (%u)\n", generated_desc->m_keys[n].m_offset, desc->m_keys[n].m_offset); + (void) printf(" offset: %u (%u)\n", generated_desc->m_keys[n].m_offset, desc->m_keys[n].m_offset); CU_ASSERT_EQUAL_FATAL (desc->m_keys[n].m_offset, generated_desc->m_keys[n].m_offset); - printf(" index: %u (%u)\n", generated_desc->m_keys[n].m_idx, desc->m_keys[n].m_idx); + (void) printf(" index: %u (%u)\n", generated_desc->m_keys[n].m_idx, desc->m_keys[n].m_idx); CU_ASSERT_EQUAL_FATAL (desc->m_keys[n].m_idx, generated_desc->m_keys[n].m_idx); } - printf ("typename: %s (%s)\n", generated_desc->m_typename, desc->m_typename); + (void) printf ("typename: %s (%s)\n", generated_desc->m_typename, desc->m_typename); CU_ASSERT_EQUAL_FATAL (strcmp (desc->m_typename, generated_desc->m_typename), 0); - printf ("nops: %u (%u)\n", generated_desc->m_nops, desc->m_nops); + (void) printf ("nops: %u (%u)\n", generated_desc->m_nops, desc->m_nops); CU_ASSERT_EQUAL_FATAL (desc->m_nops, generated_desc->m_nops); uint32_t ops_cnt_gen = dds_stream_countops (generated_desc->m_ops, generated_desc->m_nkeys, generated_desc->m_keys); uint32_t ops_cnt = dds_stream_countops (desc->m_ops, desc->m_nkeys, desc->m_keys); - printf ("ops count: %u (%u)\n", ops_cnt_gen, ops_cnt); + (void) printf ("ops count: %u (%u)\n", ops_cnt_gen, ops_cnt); CU_ASSERT_EQUAL_FATAL (ops_cnt_gen, ops_cnt); for (uint32_t n = 0; n < ops_cnt; n++) { if (desc->m_ops[n] != generated_desc->m_ops[n]) { - printf ("incorrect op at index %u: 0x%08x (0x%08x)\n", n, generated_desc->m_ops[n], desc->m_ops[n]); + (void) printf ("incorrect op at index %u: 0x%08x (0x%08x)\n", n, generated_desc->m_ops[n], desc->m_ops[n]); CU_FAIL_FATAL ("different ops"); } } - printf ("typeinfo: %u (%u)\n", generated_desc->type_information.sz, desc->type_information.sz); + (void) printf ("typeinfo: %u (%u)\n", generated_desc->type_information.sz, desc->type_information.sz); const struct ddsi_sertype_cdr_data tinfo_ser = { .sz = desc->type_information.sz, .data = desc->type_information.data }; ddsi_typeinfo_t *tinfo = ddsi_typeinfo_deser (&tinfo_ser); const struct ddsi_sertype_cdr_data gen_tinfo_ser = { .sz = generated_desc->type_information.sz, .data = generated_desc->type_information.data }; @@ -210,7 +210,7 @@ CU_Theory((const dds_topic_descriptor_t *desc), ddsc_typebuilder, topic_desc, .i ddsi_typeinfo_fini (gen_tinfo); ddsrt_free (gen_tinfo); - printf ("typemap: %u (%u)\n", generated_desc->type_mapping.sz, desc->type_mapping.sz); + (void) printf ("typemap: %u (%u)\n", generated_desc->type_mapping.sz, desc->type_mapping.sz); const struct ddsi_sertype_cdr_data tmap_ser = { .sz = desc->type_mapping.sz, .data = desc->type_mapping.data }; ddsi_typemap_t *tmap = ddsi_typemap_deser (&tmap_ser); const struct ddsi_sertype_cdr_data gen_tmap_ser = { .sz = generated_desc->type_mapping.sz, .data = generated_desc->type_mapping.data }; @@ -227,7 +227,7 @@ CU_Theory((const dds_topic_descriptor_t *desc), ddsc_typebuilder, topic_desc, .i ddsi_topic_descriptor_fini (generated_desc); ddsrt_free (generated_desc); topic_type_unref (topic, type); - printf ("\n"); + (void) printf ("\n"); } CU_Test(ddsc_typebuilder, invalid_toplevel, .init = typebuilder_init, .fini = typebuilder_fini) diff --git a/src/core/ddsc/tests/typelookup.c b/src/core/ddsc/tests/typelookup.c index df1a97203c..aa5828b206 100644 --- a/src/core/ddsc/tests/typelookup.c +++ b/src/core/ddsc/tests/typelookup.c @@ -70,12 +70,12 @@ static void typelookup_init (void) static void typelookup_fini (void) { - dds_delete (g_subscriber2); - dds_delete (g_publisher1); - dds_delete (g_participant2); - dds_delete (g_participant1); - dds_delete (g_domain2); - dds_delete (g_domain1); + (void) dds_delete (g_subscriber2); + (void) dds_delete (g_publisher1); + (void) dds_delete (g_participant2); + (void) dds_delete (g_participant1); + (void) dds_delete (g_domain2); + (void) dds_delete (g_domain1); } static void get_type (dds_entity_t entity, ddsi_typeid_t **type_id, char **type_name, ddsi_typeid_kind_t kind) @@ -146,9 +146,9 @@ static void get_type (dds_entity_t entity, ddsi_typeid_t **type_id, char **type_ static void print_ep (const dds_guid_t *key) { - printf ("endpoint "); + (void) printf ("endpoint "); for (size_t j = 0; j < sizeof (key->v); j++) - printf ("%s%02x", (j == 0 || j % 4) ? "" : ":", key->v[j]); + (void) printf ("%s%02x", (j == 0 || j % 4) ? "" : ":", key->v[j]); } typedef struct endpoint_info { @@ -182,10 +182,10 @@ static endpoint_info_t * find_typeid_match (dds_entity_t participant, dds_entity struct ddsi_typeid_str tidstr; ddsi_typeid_t *tid = ddsi_typeinfo_typeid (t, kind); print_ep (&data->key); - printf (" type: %s", ddsi_make_typeid_str (&tidstr, tid)); + (void) printf (" type: %s", ddsi_make_typeid_str (&tidstr, tid)); if (!ddsi_typeid_compare (tid, type_id) && !strcmp (data->topic_name, match_topic)) { - printf(" match"); + (void) printf(" match"); // copy data from sample to our own struct result = ddsrt_malloc (sizeof (*result)); result->type_info = ddsi_typeinfo_dup (t); @@ -194,12 +194,12 @@ static endpoint_info_t * find_typeid_match (dds_entity_t participant, dds_entity } ddsi_typeid_fini (tid); ddsrt_free (tid); - printf("\n"); + (void) printf("\n"); } else { print_ep (&data->key); - printf (" no type\n"); + (void) printf (" no type\n"); } } } @@ -236,7 +236,7 @@ static bool reader_wait_for_data (dds_entity_t pp, dds_entity_t rd, dds_duration ret = dds_waitset_wait (ws, &triggered, 1, dur); if (ret > 0) CU_ASSERT_EQUAL_FATAL (rd, (dds_entity_t)(intptr_t) triggered); - dds_delete (ws); + (void) dds_delete (ws); return ret > 0; } diff --git a/src/core/ddsc/tests/types.c b/src/core/ddsc/tests/types.c index 21b7e0e178..7865ef30d8 100644 --- a/src/core/ddsc/tests/types.c +++ b/src/core/ddsc/tests/types.c @@ -32,9 +32,9 @@ status = dds_write(wri, &data); \ CU_ASSERT_EQUAL_FATAL(status, DDS_RETCODE_OK); \ \ - dds_delete(wri); \ - dds_delete(top); \ - dds_delete(par); \ + (void) dds_delete(wri); \ + (void) dds_delete(top); \ + (void) dds_delete(par); \ } while (0) @@ -116,7 +116,7 @@ CU_Test(ddsc_types, alltypeskey) status = dds_write(wri, &atk_data); CU_ASSERT_EQUAL_FATAL(status, DDS_RETCODE_OK); - dds_delete(wri); - dds_delete(top); - dds_delete(par); + (void) dds_delete(wri); + (void) dds_delete(top); + (void) dds_delete(par); } diff --git a/src/core/ddsc/tests/unregister.c b/src/core/ddsc/tests/unregister.c index bd3792dbe7..bd7dc72a40 100644 --- a/src/core/ddsc/tests/unregister.c +++ b/src/core/ddsc/tests/unregister.c @@ -118,11 +118,11 @@ unregistering_init(void) static void unregistering_fini(void) { - dds_delete(g_reader); - dds_delete(g_writer); - dds_delete(g_waitset); - dds_delete(g_topic); - dds_delete(g_participant); + (void) dds_delete(g_reader); + (void) dds_delete(g_writer); + (void) dds_delete(g_waitset); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); } @@ -137,7 +137,7 @@ unregistering_fini(void) CU_Test(ddsc_unregister_instance, deleted, .init=unregistering_init, .fini=unregistering_fini) { dds_return_t ret; - dds_delete(g_writer); + (void) dds_delete(g_writer); ret = dds_unregister_instance(g_writer, g_data); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); @@ -231,7 +231,7 @@ CU_Test(ddsc_unregister_instance, unregistering_old_instance, .init=unregisterin CU_Test(ddsc_unregister_instance_ts, deleted, .init=unregistering_init, .fini=unregistering_fini) { dds_return_t ret; - dds_delete(g_writer); + (void) dds_delete(g_writer); ret = dds_unregister_instance_ts(g_writer, g_data, g_present); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -367,7 +367,7 @@ CU_Test(ddsc_unregister_instance_ts, unregistering_past_sample, .init=unregister CU_Test(ddsc_unregister_instance_ih, deleted, .init=unregistering_init, .fini=unregistering_fini) { dds_return_t ret; - dds_delete(g_writer); + (void) dds_delete(g_writer); ret = dds_unregister_instance_ih(g_writer, DDS_HANDLE_NIL); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -464,7 +464,7 @@ CU_Test(ddsc_unregister_instance_ih, unregistering_old_instance, .init=unregiste CU_Test(ddsc_unregister_instance_ih_ts, deleted, .init=unregistering_init, .fini=unregistering_fini) { dds_return_t ret; - dds_delete(g_writer); + (void) dds_delete(g_writer); ret = dds_unregister_instance_ih_ts(g_writer, DDS_HANDLE_NIL, g_present); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_BAD_PARAMETER); } @@ -618,9 +618,9 @@ CU_Test(ddsc_unregister_instance_ih_ts, unregistering_instance) ret = dds_unregister_instance_ih_ts(g_writer, ih, dds_time()); CU_ASSERT_EQUAL_FATAL(ret, DDS_RETCODE_OK); - dds_delete(g_writer); - dds_delete(g_topic); - dds_delete(g_participant); + (void) dds_delete(g_writer); + (void) dds_delete(g_topic); + (void) dds_delete(g_participant); } /*************************************************************************************************/ @@ -669,7 +669,7 @@ CU_Test(ddsc_unregister_instance, dispose_unregistered_sample, .init=unregisteri CU_FAIL_FATAL("Unknown sample read"); } } - dds_delete(writer); + (void) dds_delete(writer); } /*************************************************************************************************/ @@ -718,7 +718,7 @@ CU_Test(ddsc_unregister_instance_ts, dispose_unregistered_sample, .init=unregist CU_FAIL_FATAL("Unknown sample read"); } } - dds_delete(writer); + (void) dds_delete(writer); } /*************************************************************************************************/ diff --git a/src/core/ddsc/tests/unsupported.c b/src/core/ddsc/tests/unsupported.c index f7b81579d8..c249328812 100644 --- a/src/core/ddsc/tests/unsupported.c +++ b/src/core/ddsc/tests/unsupported.c @@ -57,7 +57,7 @@ static void teardown(void) { for(unsigned i = (sizeof e / sizeof *e); i > 0; i--) { - dds_delete(e[i - 1]); + (void) dds_delete(e[i - 1]); } } diff --git a/src/core/ddsc/tests/userdata.c b/src/core/ddsc/tests/userdata.c index 705a6be7d0..4253917dbf 100644 --- a/src/core/ddsc/tests/userdata.c +++ b/src/core/ddsc/tests/userdata.c @@ -107,7 +107,7 @@ static uint32_t pp_thread (void *varg) if (arg->master) { bool eq = (usz == expusz && (usz == 0 || memcmp (ud, expud, usz) == 0)); - printf ("expected %u %zu/%s received %zu/%s\n", exp_index, expusz, expud, usz, ud ? (char *) ud : "(null)"); + (void) printf ("expected %u %zu/%s received %zu/%s\n", exp_index, expusz, expud, usz, ud ? (char *) ud : "(null)"); fflush (stdout); CU_ASSERT_FATAL (eq); if (++exp_index == sizeof (exp_ud) / sizeof (exp_ud[0])) @@ -124,13 +124,13 @@ static uint32_t pp_thread (void *varg) } else { - printf ("slave: received %zu/%s\n", usz, ud ? (char *) ud : "(null)"); + (void) printf ("slave: received %zu/%s\n", usz, ud ? (char *) ud : "(null)"); fflush (stdout); expud = ud; expusz = usz; } - printf ("%s: set qos to %zu/%s\n", arg->master ? "master" : "slave", expusz, expud); + (void) printf ("%s: set qos to %zu/%s\n", arg->master ? "master" : "slave", expusz, expud); fflush (stdout); dds_qset_userdata (qos, expud, expusz); rc = dds_set_qos (dp, qos); @@ -344,7 +344,7 @@ static uint32_t rw_thread (void *varg) if (arg->master) { bool eq = (usz == expusz && (usz == 0 || memcmp (ud, expud, usz) == 0)); - printf ("expected %u %zu/%s received %zu/%s\n", exp_index, expusz, expud, usz, ud ? (char *) ud : "(null)"); + (void) printf ("expected %u %zu/%s received %zu/%s\n", exp_index, expusz, expud, usz, ud ? (char *) ud : "(null)"); CU_ASSERT_FATAL (eq); if (++exp_index == sizeof (exp_rwud) / sizeof (exp_rwud[0])) { @@ -360,7 +360,7 @@ static uint32_t rw_thread (void *varg) } else { - printf ("slave: received %zu/%s\n", usz, ud ? (char *) ud : "(null)"); + (void) printf ("slave: received %zu/%s\n", usz, ud ? (char *) ud : "(null)"); expud = ud; expusz = usz; } diff --git a/src/core/ddsc/tests/waitset.c b/src/core/ddsc/tests/waitset.c index adb1d0ebed..d6050ef678 100644 --- a/src/core/ddsc/tests/waitset.c +++ b/src/core/ddsc/tests/waitset.c @@ -212,7 +212,7 @@ CU_Theory((dds_entity_t *ws, dds_entity_t *e, dds_attach_t a), ddsc_waitset_atta CU_Test(ddsc_waitset_attach, deleted_waitset, .init=ddsc_waitset_basic_init, .fini=ddsc_waitset_basic_fini) { - dds_delete(waitset); + (void) dds_delete(waitset); dds_return_t ret = dds_waitset_attach(waitset, participant, 0); CU_ASSERT_FATAL (ret == DDS_RETCODE_BAD_PARAMETER); } @@ -242,7 +242,7 @@ CU_Theory ((int owner, int ok1, int ok2, int fail), ddsc_waitset_attach, scoping } else { ownh = par[owner]; } - printf ("%d %d %d %d | %"PRId32"\n", owner, ok1, ok2, fail, ownh); + (void) printf ("%d %d %d %d | %"PRId32"\n", owner, ok1, ok2, fail, ownh); ws = dds_create_waitset (ownh); CU_ASSERT_FATAL (ws > 0); rc = dds_waitset_attach (ws, par[ok1], 0); @@ -376,7 +376,7 @@ CU_Test(ddsc_waitset_attach_detach, combinations, .init=ddsc_waitset_init, .fini flipidx++; assert (flipidx < count); - //printf ("%zu %zu %02zx -> %02zx : %02zx %"PRIu32" %s\n", round, i, prevset, set, flipped, flipidx, (prevset & flipped) ? "detach" : "attach"); + //(void) printf ("%zu %zu %02zx -> %02zx : %02zx %"PRIu32" %s\n", round, i, prevset, set, flipped, flipidx, (prevset & flipped) ? "detach" : "attach"); if (prevset & flipped) { ret = dds_waitset_detach (waitset, entities[flipidx]); @@ -476,7 +476,7 @@ CU_Test(ddsc_waitset_delete_attached, various, .init=ddsc_waitset_init, .fini=dd CU_Test(ddsc_waitset_set_trigger, deleted_waitset, .init=ddsc_waitset_basic_init, .fini=ddsc_waitset_basic_fini) { - dds_delete (waitset); + (void) dds_delete (waitset); dds_return_t ret = dds_waitset_set_trigger (waitset, true); CU_ASSERT_FATAL (ret == DDS_RETCODE_BAD_PARAMETER); } @@ -501,7 +501,7 @@ CU_Theory((dds_entity_t *ws), ddsc_waitset_set_trigger, non_waitsets, .init=ddsc CU_Test(ddsc_waitset_wait, deleted_waitset, .init=ddsc_waitset_attached_init, .fini=ddsc_waitset_attached_fini) { - dds_delete (waitset); + (void) dds_delete (waitset); dds_attach_t triggered; dds_return_t ret = dds_waitset_wait (waitset, &triggered, 1, DDS_SECS (1)); CU_ASSERT_FATAL (ret == DDS_RETCODE_BAD_PARAMETER); @@ -638,7 +638,7 @@ CU_Test(ddsc_waitset_get_entities, no_array, .init=ddsc_waitset_attached_init, . CU_Test(ddsc_waitset_get_entities, deleted_waitset, .init=ddsc_waitset_attached_init, .fini=ddsc_waitset_attached_fini) { dds_entity_t entities[MAX_ENTITIES_CNT]; - dds_delete (waitset); + (void) dds_delete (waitset); dds_return_t ret = dds_waitset_get_entities (waitset, entities, MAX_ENTITIES_CNT); CU_ASSERT_FATAL (ret == DDS_RETCODE_BAD_PARAMETER); } @@ -846,8 +846,8 @@ CU_Theory((bool use_nop_listener), ddsc_waitset_triggering, after_listener, .ini // nop listeners mean we operate without a timeout and can repeat the experiment more often // repeating makes sense because it improves our chances of catching an ordering problem - printf ("ddsc_waitset_triggering after_listener - reader %d\n", reader); - printf ("ddsc_waitset_triggering after_listener - use_nop_listener = %d\n", use_nop_listener); + (void) printf ("ddsc_waitset_triggering after_listener - reader %d\n", reader); + (void) printf ("ddsc_waitset_triggering after_listener - use_nop_listener = %d\n", use_nop_listener); unsigned flags_counts[8] = { 0 }; const unsigned rounds = (use_nop_listener ? 100 : 10); for (unsigned i = 0; i < rounds; i++) @@ -910,7 +910,7 @@ CU_Theory((bool use_nop_listener), ddsc_waitset_triggering, after_listener, .ini CU_ASSERT_FATAL (cur <= sizeof (flags_counts) / sizeof (flags_counts[0])); flags_counts[cur]++; if (cur != exp) - printf ("current flags: 0x%"PRIx32", expected: 0x%"PRIx32"\n", cur, exp); + (void) printf ("current flags: 0x%"PRIx32", expected: 0x%"PRIx32"\n", cur, exp); } // something must have happened diff --git a/src/core/ddsc/tests/waitset_torture.c b/src/core/ddsc/tests/waitset_torture.c index 4e2191a230..1d66924517 100644 --- a/src/core/ddsc/tests/waitset_torture.c +++ b/src/core/ddsc/tests/waitset_torture.c @@ -133,7 +133,7 @@ static uint32_t guardcond_create_delete_thread (void *varg) } else if (ent < 0 && idx < N_GUARDCONDS) { - fprintf (stderr, "dds_create_guardcondition failed: %s\n", dds_strretcode (ent)); + (void) fprintf (stderr, "dds_create_guardcondition failed: %s\n", dds_strretcode (ent)); ddsrt_atomic_st32 (&terminate, 1); return 1; } @@ -162,7 +162,7 @@ static uint32_t waitset_create_delete_thread (void *varg) dds_entity_t ws = dds_create_waitset (DDS_CYCLONEDDS_HANDLE); if (ws < 0) { - fprintf (stderr, "dds_create_waitset failed: %s\n", dds_strretcode (ws)); + (void) fprintf (stderr, "dds_create_waitset failed: %s\n", dds_strretcode (ws)); ddsrt_atomic_st32 (&terminate, 1); return 1; } @@ -232,7 +232,7 @@ static uint32_t waitset_attach_detach_thread (void *varg) { /* attempts at attaching a guard condition twice or detaching an unattached one are expected, and those result in a PRECONDITION_NOT_MET */ - fprintf (stderr, "dds_waitset_detach 0x%"PRIx32" 0x%"PRIx32" failed: %s\n", (dds_entity_t) wsh, (dds_entity_t) gch, dds_strretcode (rc)); + (void) fprintf (stderr, "dds_waitset_detach 0x%"PRIx32" 0x%"PRIx32" failed: %s\n", (dds_entity_t) wsh, (dds_entity_t) gch, dds_strretcode (rc)); ddsrt_atomic_st32 (&terminate, 1); return 1; } @@ -246,7 +246,7 @@ static uint32_t waitset_attach_detach_thread (void *varg) } else if (rc != DDS_RETCODE_PRECONDITION_NOT_MET && rc != DDS_RETCODE_BAD_PARAMETER) { - fprintf (stderr, "dds_waitset_attach 0x%"PRIx32" 0x%"PRIx32" failed: %s\n", (dds_entity_t) wsh, (dds_entity_t) gch, dds_strretcode (rc)); + (void) fprintf (stderr, "dds_waitset_attach 0x%"PRIx32" 0x%"PRIx32" failed: %s\n", (dds_entity_t) wsh, (dds_entity_t) gch, dds_strretcode (rc)); ddsrt_atomic_st32 (&terminate, 1); return 1; } @@ -306,7 +306,7 @@ CU_Test (ddsc_waitset, torture) int32_t n = dds_waitset_wait (ws, NULL, 0, DDS_MSECS (10)); if (!((rc >= 0 && rc <= N_ENTITIES) || rc == DDS_RETCODE_BAD_PARAMETER)) { - fprintf (stderr, "dds_waitset_wait failed: %s\n", dds_strretcode (rc)); + (void) fprintf (stderr, "dds_waitset_wait failed: %s\n", dds_strretcode (rc)); ddsrt_atomic_st32 (&terminate, 1); rc = DDS_RETCODE_ERROR; } @@ -352,16 +352,16 @@ CU_Test (ddsc_waitset, torture) rc = dds_delete (ppant); CU_ASSERT_FATAL (rc == DDS_RETCODE_OK); - printf ("attach %"PRIu32" detach %"PRIu32" settrig %"PRIu32"\n", ddsrt_atomic_ld32 (&attach_ok), ddsrt_atomic_ld32 (&detach_ok), ddsrt_atomic_ld32 (&settrig_ok)); - printf ("create/delete ent"); + (void) printf ("attach %"PRIu32" detach %"PRIu32" settrig %"PRIu32"\n", ddsrt_atomic_ld32 (&attach_ok), ddsrt_atomic_ld32 (&detach_ok), ddsrt_atomic_ld32 (&settrig_ok)); + (void) printf ("create/delete ent"); uint32_t create_ent_ok_sum = 0; for (size_t i = 0; i < sizeof (create_ent_ok) / sizeof (create_ent_ok[0]); i++) { uint32_t c = ddsrt_atomic_ld32 (&create_ent_ok[i]); create_ent_ok_sum += c; - printf (" %"PRIu32"/%"PRIu32, c, ddsrt_atomic_ld32 (&delete_ent_ok[i])); + (void) printf (" %"PRIu32"/%"PRIu32, c, ddsrt_atomic_ld32 (&delete_ent_ok[i])); } - printf ("\n"); + (void) printf ("\n"); { uint32_t rd_cr_sub = ddsrt_atomic_ld32 (&create_ent_ok[2]); @@ -373,15 +373,15 @@ CU_Test (ddsc_waitset, torture) CU_ASSERT (rd_del - rd_cr_ppant <= sub_del); /* other readers may have been deleted by deleting a sub */ } - printf ("create/delete ws %"PRIu32"/%"PRIu32"\n", ddsrt_atomic_ld32 (&create_ws_ok), ddsrt_atomic_ld32 (&delete_ws_ok)); - printf ("wait {err %"PRIu32"}", wait_err); + (void) printf ("create/delete ws %"PRIu32"/%"PRIu32"\n", ddsrt_atomic_ld32 (&create_ws_ok), ddsrt_atomic_ld32 (&delete_ws_ok)); + (void) printf ("wait {err %"PRIu32"}", wait_err); uint32_t wait_ok_sum = 0; for (size_t i = 0; i < sizeof (wait_ok) / sizeof (wait_ok[0]); i++) { wait_ok_sum += wait_ok[i]; - printf (" %"PRIu32, wait_ok[i]); + (void) printf (" %"PRIu32, wait_ok[i]); } - printf ("\n"); + (void) printf ("\n"); /* Running on Windows on the CI infrastructure has very little concurrency, but Linux and macOS seem ok. The thresholds here appear to be sufficiently low to not give diff --git a/src/core/ddsc/tests/whc.c b/src/core/ddsc/tests/whc.c index 30ad072190..0c0496ba0e 100644 --- a/src/core/ddsc/tests/whc.c +++ b/src/core/ddsc/tests/whc.c @@ -73,13 +73,13 @@ static void whc_init(void) static void whc_fini (void) { dds_delete_qos(g_qos); - dds_delete(g_subscriber); - dds_delete(g_remote_subscriber); - dds_delete(g_publisher); - dds_delete(g_participant); - dds_delete(g_remote_participant); - dds_delete(g_domain); - dds_delete(g_remote_domain); + (void) dds_delete(g_subscriber); + (void) dds_delete(g_remote_subscriber); + (void) dds_delete(g_publisher); + (void) dds_delete(g_participant); + (void) dds_delete(g_remote_participant); + (void) dds_delete(g_domain); + (void) dds_delete(g_remote_domain); } static dds_entity_t create_and_sync_reader(dds_entity_t subscriber, dds_entity_t topic, dds_qos_t *qos, dds_entity_t writer) @@ -119,7 +119,7 @@ static void check_intermediate_whc_state(dds_entity_t writer, seqno_t exp_min, s get_writer_whc_state (writer, &whcst); /* WHC must not contain any samples < exp_min and must contain at least exp_max if it contains at least one sample. (We never know for certain when ACKs arrive.) */ - printf(" -- intermediate state: unacked: %zu; min %"PRIu64" (exp %"PRIu64"); max %"PRIu64" (exp %"PRIu64")\n", whcst.unacked_bytes, whcst.min_seq, exp_min, whcst.max_seq, exp_max); + (void) printf(" -- intermediate state: unacked: %zu; min %"PRIu64" (exp %"PRIu64"); max %"PRIu64" (exp %"PRIu64")\n", whcst.unacked_bytes, whcst.min_seq, exp_min, whcst.max_seq, exp_max); CU_ASSERT_FATAL (whcst.min_seq >= exp_min || (whcst.min_seq == 0 && whcst.max_seq == 0)); CU_ASSERT_FATAL (whcst.max_seq == exp_max || (whcst.min_seq == 0 && whcst.max_seq == 0)); } @@ -128,7 +128,7 @@ static void check_whc_state(dds_entity_t writer, seqno_t exp_min, seqno_t exp_ma { struct whc_state whcst; get_writer_whc_state (writer, &whcst); - printf(" -- final state: unacked: %zu; min %"PRIu64" (exp %"PRIu64"); max %"PRIu64" (exp %"PRIu64")\n", whcst.unacked_bytes, whcst.min_seq, exp_min, whcst.max_seq, exp_max); + (void) printf(" -- final state: unacked: %zu; min %"PRIu64" (exp %"PRIu64"); max %"PRIu64" (exp %"PRIu64")\n", whcst.unacked_bytes, whcst.min_seq, exp_min, whcst.max_seq, exp_max); CU_ASSERT_EQUAL_FATAL (whcst.unacked_bytes, 0); CU_ASSERT_EQUAL_FATAL (whcst.min_seq, exp_min); CU_ASSERT_EQUAL_FATAL (whcst.max_seq, exp_max); @@ -152,7 +152,7 @@ static void test_whc_end_state(dds_durability_kind_t d, dds_reliability_kind_t r dds_return_t ret; int32_t s, i; - printf ("test_whc_end_state: %s, %s, %s(%d), durability %s(%d), readers: %u local, %u remote, instances: %"PRId32", key %u, deadline %"PRId64"\n", + (void) printf ("test_whc_end_state: %s, %s, %s(%d), durability %s(%d), readers: %u local, %u remote, instances: %"PRId32", key %u, deadline %"PRId64"\n", d == V ? "volatile" : "TL", r == BE ? "best-effort" : "reliable", h == KA ? "keep-all" : "keep-last", h == KA ? 0 : hd, @@ -244,9 +244,9 @@ static void test_whc_end_state(dds_durability_kind_t d, dds_reliability_kind_t r int32_t exp_min = (d == TL) ? ((dh == KA) ? 1 : exp_max - dhd * ni + 1) : 0; check_whc_state (writer, (uint32_t)exp_min, (uint32_t)exp_max); - dds_delete (writer); - dds_delete (remote_topic); - dds_delete (topic); + (void) dds_delete (writer); + (void) dds_delete (remote_topic); + (void) dds_delete (topic); } #define ARRAY_LEN(A) ((int32_t)(sizeof(A) / sizeof(A[0]))) diff --git a/src/core/ddsc/tests/write.c b/src/core/ddsc/tests/write.c index f2dd5f7494..cf7df07312 100644 --- a/src/core/ddsc/tests/write.c +++ b/src/core/ddsc/tests/write.c @@ -54,10 +54,10 @@ teardown(void) RoundTripModule_DataType_free (&data, DDS_FREE_CONTENTS); memset(&data, 0, sizeof(data)); - dds_delete(writer); - dds_delete(publisher); - dds_delete(topic); - dds_delete(participant); + (void) dds_delete(writer); + (void) dds_delete(publisher); + (void) dds_delete(topic); + (void) dds_delete(participant); } CU_Test(ddsc_write, basic, .init = setup, .fini = teardown) @@ -154,7 +154,7 @@ CU_Test(ddsc_write, simpletypes) status = dds_write(wri, &st_data); CU_ASSERT_EQUAL_FATAL(status, DDS_RETCODE_OK); - dds_delete(wri); - dds_delete(top); - dds_delete(par); + (void) dds_delete(wri); + (void) dds_delete(top); + (void) dds_delete(par); } diff --git a/src/core/ddsc/tests/write_various_types.c b/src/core/ddsc/tests/write_various_types.c index 415cca9258..5752213c31 100644 --- a/src/core/ddsc/tests/write_various_types.c +++ b/src/core/ddsc/tests/write_various_types.c @@ -63,12 +63,12 @@ static void writetypes_init(void) static void writetypes_fini (void) { - dds_delete (g_sub_subscriber); - dds_delete (g_pub_publisher); - dds_delete (g_sub_participant); - dds_delete (g_pub_participant); - dds_delete (g_sub_domain); - dds_delete (g_pub_domain); + (void) dds_delete (g_sub_subscriber); + (void) dds_delete (g_pub_publisher); + (void) dds_delete (g_sub_participant); + (void) dds_delete (g_pub_participant); + (void) dds_delete (g_sub_domain); + (void) dds_delete (g_pub_domain); } typedef bool (*compare_fn_t) (const void *a, const void *b); diff --git a/src/core/ddsc/tests/writer.c b/src/core/ddsc/tests/writer.c index 29bb31bb8e..1bcbe25bfd 100644 --- a/src/core/ddsc/tests/writer.c +++ b/src/core/ddsc/tests/writer.c @@ -35,10 +35,10 @@ setup(void) static void teardown(void) { - dds_delete(writer); - dds_delete(publisher); - dds_delete(topic); - dds_delete(participant); + (void) dds_delete(writer); + (void) dds_delete(publisher); + (void) dds_delete(topic); + (void) dds_delete(participant); } CU_Test(ddsc_create_writer, basic, .init = setup, .fini = teardown) @@ -78,7 +78,7 @@ CU_Test(ddsc_create_writer, wrong_participant, .init = setup, .fini = teardown) CU_ASSERT_FATAL(participant2 > 0); writer = dds_create_writer(participant2, topic, NULL, NULL); CU_ASSERT_EQUAL_FATAL(writer, DDS_RETCODE_BAD_PARAMETER); - dds_delete(participant2); + (void) dds_delete(participant2); } CU_Test(ddsc_create_writer, publisher, .init = setup, .fini = teardown) @@ -89,7 +89,7 @@ CU_Test(ddsc_create_writer, publisher, .init = setup, .fini = teardown) CU_Test(ddsc_create_writer, deleted_publisher, .init = setup, .fini = teardown) { - dds_delete(publisher); + (void) dds_delete(publisher); writer = dds_create_writer(publisher, topic, NULL, NULL); CU_ASSERT_EQUAL_FATAL(writer, DDS_RETCODE_BAD_PARAMETER); @@ -111,7 +111,7 @@ CU_Test(ddsc_create_writer, bad_topic, .init = setup, .fini = teardown) CU_Test(ddsc_create_writer, deleted_topic, .init = setup, .fini = teardown) { - dds_delete(topic); + (void) dds_delete(topic); writer = dds_create_writer(publisher, topic, NULL, NULL); CU_ASSERT_EQUAL_FATAL(writer, DDS_RETCODE_BAD_PARAMETER); @@ -137,6 +137,6 @@ CU_Test(ddsc_create_writer, participant_mismatch, .init = setup, .fini = teardow /* Expect the creation to have failed. */ CU_ASSERT_FATAL(writer <= 0); - dds_delete(l_pub); - dds_delete(l_par); + (void) dds_delete(l_pub); + (void) dds_delete(l_par); } diff --git a/src/core/ddsc/tests/xtypes.c b/src/core/ddsc/tests/xtypes.c index 30d9fe7da6..8ed5f4e8b5 100644 --- a/src/core/ddsc/tests/xtypes.c +++ b/src/core/ddsc/tests/xtypes.c @@ -85,8 +85,8 @@ static void xtypes_init (void) static void xtypes_fini (void) { - dds_delete (g_domain2); - dds_delete (g_domain1); + (void) dds_delete (g_domain2); + (void) dds_delete (g_domain1); } static bool reader_wait_for_data (dds_entity_t pp, dds_entity_t rd, dds_duration_t dur) @@ -99,7 +99,7 @@ static bool reader_wait_for_data (dds_entity_t pp, dds_entity_t rd, dds_duration ret = dds_waitset_wait (ws, &triggered, 1, dur); if (ret > 0) CU_ASSERT_EQUAL_FATAL (rd, (dds_entity_t)(intptr_t) triggered); - dds_delete (ws); + (void) dds_delete (ws); return ret > 0; } @@ -335,7 +335,7 @@ CU_Theory ((const char *descr, const dds_topic_descriptor_t *desc1, const dds_to { for (int t = 0; t <= 1; t++) { - printf ("Running test xtypes_basic: %s (run %d/2)\n", descr, t + 1); + (void) printf ("Running test xtypes_basic: %s (run %d/2)\n", descr, t + 1); sample_init i = t ? fn_init2 : fn_init1; sample_check c = t ? fn_check2 : fn_check1; do_test (t ? desc1 : desc2, NULL, t ? desc2 : desc1, NULL, i != NULL, i, c != NULL, c); @@ -404,7 +404,7 @@ CU_TheoryDataPoints (ddsc_xtypes, must_understand) = { CU_Theory ((const dds_topic_descriptor_t *rd_desc, const dds_topic_descriptor_t *wr_desc, bool assignable, sample_init fn_init, bool read_sample), ddsc_xtypes, must_understand, .init = xtypes_init, .fini = xtypes_fini) { - printf ("Running test xtypes_must_understand: %s %s\n", wr_desc->m_typename, rd_desc->m_typename); + (void) printf ("Running test xtypes_must_understand: %s %s\n", wr_desc->m_typename, rd_desc->m_typename); do_test (rd_desc, NULL, wr_desc, NULL, assignable, fn_init, read_sample, 0); } #undef D @@ -462,7 +462,7 @@ CU_Theory ((const char *test, const dds_topic_descriptor_t *rd_desc, const dds_t bool prevent_type_widening, bool ignore_seq_bounds, bool ignore_str_bounds, bool ignore_member_names, bool force_type_validation, bool assignable), ddsc_xtypes, type_consistency_enforcement, .init = xtypes_init, .fini = xtypes_fini) { - printf ("Running test xtypes_type_consistency_enforcement: %s wr %s rd %s\n", test, wr_desc->m_typename, rd_desc->m_typename); + (void) printf ("Running test xtypes_type_consistency_enforcement: %s wr %s rd %s\n", test, wr_desc->m_typename, rd_desc->m_typename); dds_qos_t *rd_qos = dds_create_qos (); dds_qset_type_consistency (rd_qos, kind, ignore_seq_bounds, ignore_str_bounds, ignore_member_names, prevent_type_widening, force_type_validation); do_test (rd_desc, rd_qos, wr_desc, NULL, assignable, 0, false, 0); @@ -484,7 +484,7 @@ CU_Test (ddsc_xtypes, type_consistency_enforcement_force_validation, .init = xty for (uint32_t n = 0; n <= 1; n++) { bool force_type_validation = (n == 1); - printf ("Running test type_consistency_enforcement_force_validation: force_type_validation = %s\n", force_type_validation ? "true" : "false"); + (void) printf ("Running test type_consistency_enforcement_force_validation: force_type_validation = %s\n", force_type_validation ? "true" : "false"); dds_qos_t *rd_qos = dds_create_qos (); dds_qset_type_consistency (rd_qos, DDS_TYPE_CONSISTENCY_ALLOW_TYPE_COERCION, true, true, false, false, force_type_validation); do_test (&XSpaceNoTypeInfo_t1_desc, rd_qos, &XSpaceNoTypeInfo_t1_desc, NULL, !force_type_validation, 0, false, 0); @@ -531,7 +531,7 @@ CU_TheoryDataPoints (ddsc_xtypes, enum_extensibility) = { CU_Theory ((const dds_topic_descriptor_t *rd_desc, const dds_topic_descriptor_t *wr_desc, bool assignable, sample_init fn_init, bool read_sample), ddsc_xtypes, enum_extensibility, .init = xtypes_init, .fini = xtypes_fini) { - printf ("Running test xtypes_enum: %s %s\n", wr_desc->m_typename, rd_desc->m_typename); + (void) printf ("Running test xtypes_enum: %s %s\n", wr_desc->m_typename, rd_desc->m_typename); do_test (rd_desc, NULL, wr_desc, NULL, assignable, fn_init, read_sample, 0); } @@ -818,7 +818,7 @@ CU_TheoryDataPoints (ddsc_xtypes, invalid_type_object_local) = { CU_Theory ((const char *test_descr, const dds_topic_descriptor_t *topic_desc, typeobj_modify mod, bool matching_typeinfo), ddsc_xtypes, invalid_type_object_local, .init = xtypes_init, .fini = xtypes_fini) { char topic_name[100]; - printf("Test invalid_type_object_local: %s\n", test_descr); + (void) printf("Test invalid_type_object_local: %s\n", test_descr); dds_topic_descriptor_t desc; modify_type_meta (&desc, topic_desc, mod, matching_typeinfo, DDS_XTypes_EK_MINIMAL); @@ -881,7 +881,7 @@ CU_TheoryDataPoints (ddsc_xtypes, invalid_type_object_remote) = { CU_Theory ((const char *test_descr, const dds_topic_descriptor_t *topic_desc, typeobj_modify mod), ddsc_xtypes, invalid_type_object_remote, .init = xtypes_init, .fini = xtypes_fini) { struct ddsi_domaingv *gv = get_domaingv (g_participant1); - printf("Test invalid_type_object_remote: %s\n", test_descr); + (void) printf("Test invalid_type_object_remote: %s\n", test_descr); char topic_name[100]; create_unique_topic_name ("ddsc_xtypes", topic_name, sizeof (topic_name)); diff --git a/src/core/ddsi/defconfig.c b/src/core/ddsi/defconfig.c index 8117e559d4..656583f357 100644 --- a/src/core/ddsi/defconfig.c +++ b/src/core/ddsi/defconfig.c @@ -109,9 +109,9 @@ void ddsi_config_init_default (struct ddsi_config *cfg) /* generated from ddsi_cfgelems.h[11913cd398f1cd1b52e06d924718df62a5981beb] */ /* generated from ddsi_config.c[ed9898f72f9dbcfa20ce7706835da091efcea0ca] */ /* generated from _confgen.h[f2d235d5551cbf920a8a2962831dddeabd2856ac] */ -/* generated from _confgen.c[1193219ddb4769b90566cf197e73d22fb6f75835] */ -/* generated from generate_rnc.c[a2ec6e48d33ac14a320c8ec3f320028a737920e0] */ -/* generated from generate_md.c[a61b6a9649d18afeca4c73b5784f36989d7994e0] */ -/* generated from generate_rst.c[34dcb6b5e2ac2cd15e78497107ce0b6eed6e6e94] */ -/* generated from generate_xsd.c[45064e8869b3c00573057d7c8f02d20f04b40e16] */ -/* generated from generate_defconfig.c[eec9ab7b2d053e68500799b693d089e84153a37b] */ +/* generated from _confgen.c[c23ec2e896226a424a21f1a4b343cb780056f52e] */ +/* generated from generate_rnc.c[79379fcd8615d777c20c0c0324547bfdcc180c60] */ +/* generated from generate_md.c[f3669b494645cfff74758b587b4a552910901378] */ +/* generated from generate_rst.c[1e95348d13f06a441bc0cef8731e4ffeb99cad1a] */ +/* generated from generate_xsd.c[22ae895de728df202f681642178300f14102af65] */ +/* generated from generate_defconfig.c[e2f6526ef516323caa0b0f497c493f69d02a40ff] */ diff --git a/src/core/ddsi/src/ddsi_entity.c b/src/core/ddsi/src/ddsi_entity.c index c206c21f59..f9113b45e0 100644 --- a/src/core/ddsi/src/ddsi_entity.c +++ b/src/core/ddsi/src/ddsi_entity.c @@ -133,7 +133,7 @@ bool ddsi_update_qos_locked (struct ddsi_entity_common *e, dds_qos_t *ent_qos, c int b = (xqos->present & QP_TOPIC_DATA) ? (int) xqos->topic_data.length : 6; char *astr = (ent_qos->present & QP_TOPIC_DATA) ? (char *) ent_qos->topic_data.value : "(null)"; char *bstr = (xqos->present & QP_TOPIC_DATA) ? (char *) xqos->topic_data.value : "(null)"; - printf ("%d: "PGUIDFMT" ent_qos %d \"%*.*s\" xqos %d \"%*.*s\" => mask %d\n", + (void) printf ("%d: "PGUIDFMT" ent_qos %d \"%*.*s\" xqos %d \"%*.*s\" => mask %d\n", (int) getpid (), PGUID (e->guid), !!(ent_qos->present & QP_TOPIC_DATA), a, a, astr, !!(xqos->present & QP_TOPIC_DATA), b, b, bstr, diff --git a/src/core/ddsi/src/ddsi_handshake.c b/src/core/ddsi/src/ddsi_handshake.c index 1355a12de2..c3df968526 100644 --- a/src/core/ddsi/src/ddsi_handshake.c +++ b/src/core/ddsi/src/ddsi_handshake.c @@ -47,7 +47,7 @@ #else #undef TRACE #define TRACE(args) nn_trace args -#define TRACE_FUNC(ptr) printf("[%p] %s\n", ptr, __FUNCTION__); +#define TRACE_FUNC(ptr) (void) printf("[%p] %s\n", ptr, __FUNCTION__); #endif typedef enum { diff --git a/src/core/ddsi/src/ddsi_ipaddr.c b/src/core/ddsi/src/ddsi_ipaddr.c index add2e2dcfa..0d8f107e4d 100644 --- a/src/core/ddsi/src/ddsi_ipaddr.c +++ b/src/core/ddsi/src/ddsi_ipaddr.c @@ -258,7 +258,7 @@ char *ddsi_ipaddr_to_string (char *dst, size_t sizeof_dst, const ddsi_locator_t if (cnt >= 0) pos += (size_t) cnt; if (interf && pos < sizeof_dst) - snprintf (dst + pos, sizeof_dst - pos, "@%"PRIu32, interf->if_index); + (void) snprintf (dst + pos, sizeof_dst - pos, "@%"PRIu32, interf->if_index); } return dst; } diff --git a/src/core/ddsi/src/ddsi_portmapping.c b/src/core/ddsi/src/ddsi_portmapping.c index c4ea46de16..17502bfbfd 100644 --- a/src/core/ddsi/src/ddsi_portmapping.c +++ b/src/core/ddsi/src/ddsi_portmapping.c @@ -74,7 +74,7 @@ static bool get_port_int (uint32_t *port, const struct ddsi_portmapping *map, en const uint32_t billion = 1000000000; const uint32_t y = (uint32_t) (a % billion) + (uint32_t) (b % billion); const uint64_t x = (a / billion) + (b / billion) + (y / billion); - snprintf (str_if_overflow, strsize, "%"PRIu64"%09"PRIu32, x, y % billion); + (void) snprintf (str_if_overflow, strsize, "%"PRIu64"%09"PRIu32, x, y % billion); return false; } } diff --git a/src/core/ddsi/src/ddsi_serdata_default.c b/src/core/ddsi/src/ddsi_serdata_default.c index 702ed84d19..d31c9f1368 100644 --- a/src/core/ddsi/src/ddsi_serdata_default.c +++ b/src/core/ddsi/src/ddsi_serdata_default.c @@ -348,11 +348,11 @@ static struct ddsi_serdata_default *serdata_default_from_ser_common (const struc goto err; // for (int n = 0; n < d->key.keysize; n++) { // if (d->key.buftype == KEYBUFTYPE_DYNALLOC || d->key.buftype == KEYBUFTYPE_DYNALIAS) - // printf("%02x ", d->key.u.dynbuf[n]); + // (void) printf("%02x ", d->key.u.dynbuf[n]); // else - // printf("%02x ", d->key.u.stbuf[n]); + // (void) printf("%02x ", d->key.u.stbuf[n]); // } - // printf("\n"); + // (void) printf("\n"); return d; err: diff --git a/src/core/ddsi/src/ddsi_typelib.c b/src/core/ddsi/src/ddsi_typelib.c index 24ae19a375..77d781b613 100644 --- a/src/core/ddsi/src/ddsi_typelib.c +++ b/src/core/ddsi/src/ddsi_typelib.c @@ -1147,7 +1147,7 @@ bool ddsi_is_assignable_from (struct ddsi_domaingv *gv, const struct ddsi_type_p char *ddsi_make_typeid_str_impl (struct ddsi_typeid_str *buf, const DDS_XTypes_TypeIdentifier *type_id) { - snprintf (buf->str, sizeof (buf->str), PTYPEIDFMT, PTYPEID (*type_id)); + (void) snprintf (buf->str, sizeof (buf->str), PTYPEIDFMT, PTYPEID (*type_id)); return buf->str; } diff --git a/src/core/ddsi/src/ddsi_typelookup.c b/src/core/ddsi/src/ddsi_typelookup.c index 178fec3564..a72b7d0e85 100644 --- a/src/core/ddsi/src/ddsi_typelookup.c +++ b/src/core/ddsi/src/ddsi_typelookup.c @@ -83,7 +83,7 @@ static int32_t tl_request_get_deps (struct ddsi_domaingv * const gv, struct ddsr if (!ddsi_type_resolved_locked (gv, dep_type, DDSI_TYPE_IGNORE_DEPS)) { assert (ddsi_typeid_is_hash (&dep_type->xt.id)); - ddsrt_hh_add (deps, &dep_type->xt.id); + (void)ddsrt_hh_add (deps, &dep_type->xt.id); cnt++; dep_type->state = DDSI_TYPE_REQUESTED; } diff --git a/src/core/ddsi/src/ddsi_udp.c b/src/core/ddsi/src/ddsi_udp.c index 6d47a7e4bd..6e36745746 100644 --- a/src/core/ddsi/src/ddsi_udp.c +++ b/src/core/ddsi/src/ddsi_udp.c @@ -535,7 +535,7 @@ static dds_return_t ddsi_udp_create_conn (ddsi_tran_conn_t *conn_out, ddsi_tran_ char buf[DDSI_LOCSTRLEN]; if (bind_to_any) - snprintf (buf, sizeof (buf), "ANY:%"PRIu32, port); + (void) snprintf (buf, sizeof (buf), "ANY:%"PRIu32, port); else ddsi_locator_to_string (buf, sizeof (buf), &ownloc_w_port); GVERROR ("ddsi_udp_create_conn: failed to bind to %s: %s\n", buf, diff --git a/src/core/ddsi/src/q_debmon.c b/src/core/ddsi/src/q_debmon.c index 38fdf809ca..19791e3790 100644 --- a/src/core/ddsi/src/q_debmon.c +++ b/src/core/ddsi/src/q_debmon.c @@ -79,7 +79,7 @@ static void cpemitchunk(struct st *st, ddsi_locator_t loc) // 'chunk header' 2* '\r\n' + 4 hex digits = 8 bytes // use buf+memcpy to avoid null terminator char header[11]; - snprintf(header, sizeof (header), "\r\n%04"PRIX16"\r\n\r\n", (uint16_t)(st->pos - 8)); + (void) snprintf(header, sizeof (header), "\r\n%04"PRIX16"\r\n\r\n", (uint16_t)(st->pos - 8)); memcpy(st->chunkbuf, header, (st->pos > 8) ? 8 : 10); ddsrt_iovec_t iov; diff --git a/src/core/ddsi/src/q_init.c b/src/core/ddsi/src/q_init.c index 97d2cde4b2..0be130b851 100644 --- a/src/core/ddsi/src/q_init.c +++ b/src/core/ddsi/src/q_init.c @@ -1388,7 +1388,7 @@ int rtps_init (struct ddsi_domaingv *gv) ddsrt_free(procname); } - snprintf(namebuf, sizeof(namebuf), "%" PRIdPID, ddsrt_getpid()); + (void) snprintf(namebuf, sizeof(namebuf), "%" PRIdPID, ddsrt_getpid()); ddsi_xqos_add_property_if_unset(&gv->default_local_plist_pp.qos, true, DDS_BUILTIN_TOPIC_PARTICIPANT_PROPERTY_PID, namebuf); #if DDSRT_HAVE_GETHOSTNAME diff --git a/src/core/ddsi/src/q_sockwaitset.c b/src/core/ddsi/src/q_sockwaitset.c index b5e4c221fe..76a237bcf3 100644 --- a/src/core/ddsi/src/q_sockwaitset.c +++ b/src/core/ddsi/src/q_sockwaitset.c @@ -588,7 +588,7 @@ static int make_pipe (int pfd[2]) char pipename[OSPL_PIPENAMESIZE]; int pipecount = 0; do { - snprintf ((char*)&pipename, sizeof (pipename), "/pipe/ospl%d", pipecount++); + (void) snprintf ((char*)&pipename, sizeof (pipename), "/pipe/ospl%d", pipecount++); } while ((result = pipeDevCreate ((char*)&pipename, 1, 1)) == -1 && os_getErrno() == EINVAL); if (result == -1) goto fail_pipedev; diff --git a/src/core/ddsi/tests/locators.c b/src/core/ddsi/tests/locators.c index 6c1faaa1f0..e7abf2607c 100644 --- a/src/core/ddsi/tests/locators.c +++ b/src/core/ddsi/tests/locators.c @@ -96,27 +96,27 @@ CU_Theory ((enum ddsi_transport_selector tr), ddsi_locator_from_string, ipv4_inv enum ddsi_locator_from_string_result res; char astr[40]; assert(fact); - snprintf (astr, sizeof (astr), "%s/", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID); - snprintf (astr, sizeof (astr), "%s/:", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/:", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID); - snprintf (astr, sizeof (astr), "%s/1.2:", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/1.2:", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID); - snprintf (astr, sizeof (astr), "%s/1.2:99999", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/1.2:99999", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID); // if DNS is supported, a hostname lookup is tried whenever parsing as a numerical address fails // which means we may get UNKNOWN - snprintf (astr, sizeof (astr), "%s/:1234", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/:1234", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID || res == AFSR_UNKNOWN); - snprintf (astr, sizeof (astr), "%s/[192.0.2.0]", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/[192.0.2.0]", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID || res == AFSR_UNKNOWN); - snprintf (astr, sizeof (astr), "%s/[192.0.2.0]:1234", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/[192.0.2.0]:1234", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID || res == AFSR_UNKNOWN); fini (&gv); @@ -182,14 +182,14 @@ CU_Theory ((enum ddsi_transport_selector tr, int32_t loc_kind), ddsi_locator_fro CU_ASSERT_FATAL (loc.port == NN_LOCATOR_PORT_INVALID); CU_ASSERT_FATAL (check_ipv4_address (&loc, (uint8_t[]){192,0,2,0})); - snprintf (astr, sizeof (astr), "%s/192.0.2.0", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/192.0.2.0", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_OK); CU_ASSERT_FATAL (loc.kind == loc_kind); CU_ASSERT_FATAL (loc.port == NN_LOCATOR_PORT_INVALID); CU_ASSERT_FATAL (check_ipv4_address (&loc, (uint8_t[]){192,0,2,0})); - snprintf (astr, sizeof (astr), "%s/192.0.2.0:1234", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/192.0.2.0:1234", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_OK); CU_ASSERT_FATAL (loc.kind == loc_kind); @@ -268,30 +268,30 @@ CU_Theory ((enum ddsi_transport_selector tr), ddsi_locator_from_string, ipv6_inv enum ddsi_locator_from_string_result res; char astr[40]; assert(fact); - snprintf (astr, sizeof (astr), "%s/", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID); // if DNS is supported, a hostname lookup is tried whenever parsing as a numerical address fails // which means we may get UNKNOWN - snprintf (astr, sizeof (astr), "%s/::1:31415", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/::1:31415", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID || res == AFSR_UNKNOWN); - snprintf (astr, sizeof (astr), "%s/:", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/:", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID || res == AFSR_UNKNOWN); - snprintf (astr, sizeof (astr), "%s/1.2:", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/1.2:", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID || res == AFSR_UNKNOWN); - snprintf (astr, sizeof (astr), "%s/]:", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/]:", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID || res == AFSR_UNKNOWN); - snprintf (astr, sizeof (astr), "%s/[", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/[", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID || res == AFSR_UNKNOWN); - snprintf (astr, sizeof (astr), "%s/[]", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/[]", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID || res == AFSR_UNKNOWN); - snprintf (astr, sizeof (astr), "%s/:1234", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/:1234", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_INVALID || res == AFSR_UNKNOWN); fini (&gv); @@ -390,7 +390,7 @@ CU_Theory ((enum ddsi_transport_selector tr, int32_t loc_kind), ddsi_locator_fro CU_ASSERT_FATAL (check_ipv64_address (&loc, (uint8_t[]){192,0,2,0})); } - snprintf (astr, sizeof (astr), "%s/192.0.2.0", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/192.0.2.0", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_OK || res == AFSR_UNKNOWN); if (res == AFSR_OK) { @@ -399,7 +399,7 @@ CU_Theory ((enum ddsi_transport_selector tr, int32_t loc_kind), ddsi_locator_fro CU_ASSERT_FATAL (check_ipv64_address (&loc, (uint8_t[]){192,0,2,0})); } - snprintf (astr, sizeof (astr), "%s/192.0.2.0:6789", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/192.0.2.0:6789", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_OK || res == AFSR_UNKNOWN); if (res == AFSR_OK) @@ -409,7 +409,7 @@ CU_Theory ((enum ddsi_transport_selector tr, int32_t loc_kind), ddsi_locator_fro CU_ASSERT_FATAL (check_ipv64_address (&loc, (uint8_t[]){192,0,2,0})); } - snprintf (astr, sizeof (astr), "%s/[192.0.2.0]:7890", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/[192.0.2.0]:7890", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); if (res == AFSR_OK) { @@ -419,7 +419,7 @@ CU_Theory ((enum ddsi_transport_selector tr, int32_t loc_kind), ddsi_locator_fro CU_ASSERT_FATAL (check_ipv64_address (&loc, (uint8_t[]){192,0,2,0})); } - snprintf (astr, sizeof (astr), "%s/[::1]:8901", fact->m_typename); + (void) snprintf (astr, sizeof (astr), "%s/[::1]:8901", fact->m_typename); res = ddsi_locator_from_string (&gv, &loc, astr, fact); CU_ASSERT_FATAL (res == AFSR_OK); CU_ASSERT_FATAL (loc.kind == loc_kind); diff --git a/src/core/ddsi/tests/plist_generic.c b/src/core/ddsi/tests/plist_generic.c index a0c5be97d8..4bc1eec9a4 100644 --- a/src/core/ddsi/tests/plist_generic.c +++ b/src/core/ddsi/tests/plist_generic.c @@ -176,9 +176,9 @@ CU_Test (ddsi_plist_generic, ser_and_deser) size_t cmpsize = (sersize < descs[i].exp_sersize) ? sersize : descs[i].exp_sersize; if (memcmp (ser, descs[i].exp_ser, cmpsize) != 0) { - printf ("memcmp i = %zu\n", i); + (void) printf ("memcmp i = %zu\n", i); for (size_t k = 0; k < cmpsize; k++) - printf (" %3zu %02x %02x\n", k, ((unsigned char *)ser)[k], descs[i].exp_ser[k]); + (void) printf (" %3zu %02x %02x\n", k, ((unsigned char *)ser)[k], descs[i].exp_ser[k]); CU_ASSERT (!(bool)"memcmp"); } /* check */ @@ -320,9 +320,9 @@ CU_Test (ddsi_plist_generic, optional) size_t cmpsize = (sersize < exp_sersize) ? sersize : exp_sersize; if (memcmp (ser, exp_ser, cmpsize) != 0) { - printf ("ddsi_plist_generic_optional: memcmp\n"); + (void) printf ("ddsi_plist_generic_optional: memcmp\n"); for (size_t k = 0; k < cmpsize; k++) - printf (" %3zu %02x %02x\n", k, ((unsigned char *)ser)[k], exp_ser[k]); + (void) printf (" %3zu %02x %02x\n", k, ((unsigned char *)ser)[k], exp_ser[k]); CU_ASSERT (!(bool)"memcmp"); } /* check */ diff --git a/src/core/ddsi/tests/radmin.c b/src/core/ddsi/tests/radmin.c index a1d5f993ee..62d64a2f88 100644 --- a/src/core/ddsi/tests/radmin.c +++ b/src/core/ddsi/tests/radmin.c @@ -89,22 +89,22 @@ static void check_reorder (struct nn_reorder *reorder, uint64_t ndiscard, seqno_ CU_ASSERT_FATAL (discarded_bytes == ndiscard); // expect the set of present sequence numbers to match int i = 0, err = 0; - printf ("check:"); + (void) printf ("check:"); for (seqno_t s = next_exp; s <= end; s++) { if (s < present[i] || present[i] == 0) { int w = nn_reorder_wantsample (reorder, s); - printf (" -%"PRId64"/%d", s, w); + (void) printf (" -%"PRId64"/%d", s, w); if (!w) err++; } else { if (s == present[i]) i++; int w = nn_reorder_wantsample (reorder, s); if (w) err++; - printf (" +%"PRId64"/%d", s, w); + (void) printf (" +%"PRId64"/%d", s, w); } } - printf ("\n"); + (void) printf ("\n"); CU_ASSERT_FATAL (err == 0); } diff --git a/src/core/ddsi/tests/security_msg.c b/src/core/ddsi/tests/security_msg.c index 4513ccc016..a18f883e85 100644 --- a/src/core/ddsi/tests/security_msg.c +++ b/src/core/ddsi/tests/security_msg.c @@ -306,9 +306,9 @@ CU_Test (ddsi_security_msg, serializer) assert(data != NULL); /* for Clang static analyzer */ if (memcmp (data, test_msg_ser, cmpsize) != 0) { - printf ("memcmp(%d)\n", (int)cmpsize); + (void) printf ("memcmp(%d)\n", (int)cmpsize); for (size_t k = 0; k < cmpsize; k++) - printf (" %3zu %02x %02x (%c) %s\n", k, data[k], test_msg_ser[k], + (void) printf (" %3zu %02x %02x (%c) %s\n", k, data[k], test_msg_ser[k], ((test_msg_ser[k] >= '0') && (test_msg_ser[k] <= 'z')) ? test_msg_ser[k] : ' ', (data[k] == test_msg_ser[k]) ? "" : "<--"); CU_ASSERT (!(bool)"memcmp"); diff --git a/src/core/ddsi/tests/sysdeps.c b/src/core/ddsi/tests/sysdeps.c index 0b94207f7b..c4e13d58ec 100644 --- a/src/core/ddsi/tests/sysdeps.c +++ b/src/core/ddsi/tests/sysdeps.c @@ -45,10 +45,10 @@ static bool looks_like_stackframe (const char *msg) enum state { WS_OR_PUNCT, WS_ZERO, WS_WORD, WS_HEX, WS_WORD_OR_HEX, WS_MESSY } state = WS_OR_PUNCT; unsigned char c; int nnum = 0, nword = 0; - printf ("%-8s", ""); + (void) printf ("%-8s", ""); while ((c = (unsigned char) *msg++) != 0) { - printf ("%d", (int) state); + (void) printf ("%d", (int) state); switch (state) { case WS_OR_PUNCT: @@ -80,7 +80,7 @@ static bool looks_like_stackframe (const char *msg) break; } } - printf("\n"); + (void) printf("\n"); // want at least a name and an offset or just an address in a not-too-messy string return (state != WS_MESSY) && ((nword + nnum) >= 2 || (nword == 0 && nnum == 1)); } @@ -88,7 +88,7 @@ static bool looks_like_stackframe (const char *msg) static void logger (void *ptr, const dds_log_data_t *data) { (void) ptr; - printf ("%-7s %s", loggerstatestr[loggerstate], data->message); + (void) printf ("%-7s %s", loggerstatestr[loggerstate], data->message); switch (loggerstate) { case STL_INIT: diff --git a/src/core/xtests/cdrtest/cdrtest.pl b/src/core/xtests/cdrtest/cdrtest.pl index d36da2bc6b..727ef27c3b 100644 --- a/src/core/xtests/cdrtest/cdrtest.pl +++ b/src/core/xtests/cdrtest/cdrtest.pl @@ -98,8 +98,8 @@ gencyc ($t); } print CYC < 31) oops (); - printf ("pubmatched: %d\n", rdid); + (void) printf ("pubmatched: %d\n", rdid); fflush (stdout); ddsrt_atomic_or32 (new_readers, UINT32_C (1) << rdid); dds_free (ud); @@ -83,7 +83,7 @@ int main (int argc, char ** argv) flag_prewrite = true; break; default: - fprintf (stderr, "usage error: see source code\n"); + (void) fprintf (stderr, "usage error: see source code\n"); exit (2); } } @@ -130,7 +130,7 @@ int main (int argc, char ** argv) oops (); sample.seq_at_match[i] = sample.seq; tnewrd = dds_time (); - printf ("%d.%09d newreader %d: start seq %d\n", (int) (tnewrd / DDS_NSECS_IN_SEC), (int) (tnewrd % DDS_NSECS_IN_SEC), (int) i, (int) sample.seq_at_match[i]); + (void) printf ("%d.%09d newreader %d: start seq %d\n", (int) (tnewrd / DDS_NSECS_IN_SEC), (int) (tnewrd % DDS_NSECS_IN_SEC), (int) i, (int) sample.seq_at_match[i]); fflush (stdout); } } @@ -147,7 +147,7 @@ int main (int argc, char ** argv) if (sample.seq > sample.final_seq) { tnow = dds_time (); - printf ("%d.%09d done writing\n", (int) (tnow / DDS_NSECS_IN_SEC), (int) (tnow % DDS_NSECS_IN_SEC)); + (void) printf ("%d.%09d done writing\n", (int) (tnow / DDS_NSECS_IN_SEC), (int) (tnow % DDS_NSECS_IN_SEC)); fflush (stdout); } } @@ -158,6 +158,6 @@ int main (int argc, char ** argv) dds_sleepfor (DDS_MSECS (100)); dds_wait_for_acks (wr, DDS_INFINITY); - dds_delete (ppant); + (void) dds_delete (ppant); return 0; } diff --git a/src/core/xtests/initsampledeliv/subscriber.c b/src/core/xtests/initsampledeliv/subscriber.c index df39d2d05b..38146aeec9 100644 --- a/src/core/xtests/initsampledeliv/subscriber.c +++ b/src/core/xtests/initsampledeliv/subscriber.c @@ -20,7 +20,7 @@ static void oops (const char *file, int line) { fflush (stdout); - fprintf (stderr, "%s:%d\n", file, line); + (void) fprintf (stderr, "%s:%d\n", file, line); abort (); } @@ -46,7 +46,7 @@ static void wait_for_writer (dds_entity_t ppant) } if (n < 0) oops (); } while (!done); - dds_delete (rd); + (void) dds_delete (rd); } static uint32_t get_subscription_matched_count (dds_entity_t rd) @@ -85,7 +85,7 @@ int main (int argc, char ** argv) flag_wait = true; break; default: - fprintf (stderr, "usage error: see source code\n"); + (void) fprintf (stderr, "usage error: see source code\n"); exit (2); } } @@ -101,13 +101,13 @@ int main (int argc, char ** argv) if (flag_wait) { - printf ("waiting for writer ...\n"); + (void) printf ("waiting for writer ...\n"); fflush (stdout); wait_for_writer (ppant); - printf ("writer seen; giving it some time to discover us and publish data ...\n"); + (void) printf ("writer seen; giving it some time to discover us and publish data ...\n"); fflush (stdout); dds_sleepfor (DDS_SECS (1)); - printf ("continuing ...\n"); + (void) printf ("continuing ...\n"); fflush (stdout); } @@ -143,13 +143,13 @@ int main (int argc, char ** argv) /* have to postpone first seq# check for transient-local data because the limit t-l history means the first sample we read may have an arbitrary sequence that antedated the matching */ - printf ("reader %d: first seq %d\n", i, (int) msg->seq); + (void) printf ("reader %d: first seq %d\n", i, (int) msg->seq); fflush (stdout); firstmsg[i] = msg->seq; } else if (msg->seq != prevmsg[i] + 1) { - printf ("reader %d: received %d, previous %d\n", i, (int) msg->seq, (int) prevmsg[i]); + (void) printf ("reader %d: received %d, previous %d\n", i, (int) msg->seq, (int) prevmsg[i]); oops (); } prevmsg[i] = msg->seq; @@ -187,12 +187,12 @@ int main (int argc, char ** argv) /* allow the rare cases where an additional sample was received for volatile data (for t-l data, the publisher waits to give so the subscriber can get the data in time */ - printf ("reader %"PRId32": first seq %"PRId32" but refseq %"PRId32"\n", i, firstmsg[i], refseq); + (void) printf ("reader %"PRId32": first seq %"PRId32" but refseq %"PRId32"\n", i, firstmsg[i], refseq); oops (); } } dds_delete_qos (qos); - dds_delete (ppant); + (void) dds_delete (ppant); return 0; } diff --git a/src/core/xtests/rhc_torture/rhc_torture.c b/src/core/xtests/rhc_torture/rhc_torture.c index 7d3637489d..afb3fef475 100644 --- a/src/core/xtests/rhc_torture/rhc_torture.c +++ b/src/core/xtests/rhc_torture/rhc_torture.c @@ -148,9 +148,9 @@ static uint64_t store (struct ddsi_tkmap *tkmap, struct dds_rhc *rhc, struct dds ddsi_serdata_to_sample (sd, &d, NULL, NULL); (void) print_tstamp (buf, sizeof (buf), sd->timestamp.v); if (sd->kind == SDK_KEY) - printf ("STORE %c%c %16"PRIx64" %16"PRIx64" %2"PRId32" %6s %s\n", si_u, si_d, iid, wr->e.iid, d.k, "_", buf); + (void) printf ("STORE %c%c %16"PRIx64" %16"PRIx64" %2"PRId32" %6s %s\n", si_u, si_d, iid, wr->e.iid, d.k, "_", buf); else - printf ("STORE %c%c %16"PRIx64" %16"PRIx64" %2"PRId32" %6"PRId32" %s\n", si_u, si_d, iid, wr->e.iid, d.k, d.x, buf); + (void) printf ("STORE %c%c %16"PRIx64" %16"PRIx64" %2"PRId32" %6"PRId32" %s\n", si_u, si_d, iid, wr->e.iid, d.k, d.x, buf); ddsi_sertype_free_sample (sd->type, &d, DDS_FREE_CONTENTS); } pwr_info.auto_dispose = wr->c.xqos->writer_data_lifecycle.autodispose_unregistered_instances; @@ -301,7 +301,7 @@ static void docheck (int n, const dds_sample_info_t *iseq, const RhcTypes_T *mse static void print_seq (int n, const dds_sample_info_t *iseq, const RhcTypes_T *mseq) { int i; - printf ("INDX SVI %-16s %-16s DGEN NWRG SR GR AR KV SEQ %s\n", "INSTHANDLE", "PUBHANDLE", "TSTAMP"); + (void) printf ("INDX SVI %-16s %-16s DGEN NWRG SR GR AR KV SEQ %s\n", "INSTHANDLE", "PUBHANDLE", "TSTAMP"); for (i = 0; i < n; i++) { dds_sample_info_t const * const si = &iseq[i]; @@ -309,17 +309,17 @@ static void print_seq (int n, const dds_sample_info_t *iseq, const RhcTypes_T *m char buf[64]; assert(si->instance_handle); assert(si->publication_handle); - printf ("[%2d] %c%c%c %16"PRIx64" %16"PRIx64" %4"PRIu32" %4"PRIu32" %2"PRIu32" %2"PRIu32" %2"PRIu32" %2"PRId32, + (void) printf ("[%2d] %c%c%c %16"PRIx64" %16"PRIx64" %4"PRIu32" %4"PRIu32" %2"PRIu32" %2"PRIu32" %2"PRIu32" %2"PRId32, i, si2ss(si), si2vs(si), si2is(si), si->instance_handle, si->publication_handle, si->disposed_generation_count, si->no_writers_generation_count, si->sample_rank, si->generation_rank, si->absolute_generation_rank, d->k); if (si->valid_data) - printf (" %6"PRId32, d->x); + (void) printf (" %6"PRId32, d->x); else - printf (" %6s", "_"); - printf (" %s\n", print_tstamp (buf, sizeof (buf), si->source_timestamp)); + (void) printf (" %6s", "_"); + (void) printf (" %s\n", print_tstamp (buf, sizeof (buf), si->source_timestamp)); } } @@ -328,20 +328,20 @@ static void rdtkcond (struct dds_rhc *rhc, dds_readcond *cond, const struct chec int cnt; if (print) - printf ("%s:\n", opname); + (void) printf ("%s:\n", opname); thread_state_awake_domain_ok (ddsi_lookup_thread_state ()); cnt = op (rhc, true, rres_ptrs, rres_iseq, (max <= 0) ? (uint32_t) (sizeof (rres_iseq) / sizeof (rres_iseq[0])) : (uint32_t) max, cond ? NO_STATE_MASK_SET : (DDS_ANY_SAMPLE_STATE | DDS_ANY_VIEW_STATE | DDS_ANY_INSTANCE_STATE), 0, cond); thread_state_asleep (ddsi_lookup_thread_state ()); if (max > 0 && cnt > max) { - printf ("%s TOO MUCH DATA (%d > %d)\n", opname, cnt, max); + (void) printf ("%s TOO MUCH DATA (%d > %d)\n", opname, cnt, max); abort (); } else if (cnt > 0) { if (print) print_seq (cnt, rres_iseq, rres_mseq); } else if (cnt == 0) { - if (print) printf ("(no data)\n"); + if (print) (void) printf ("(no data)\n"); } else { - printf ("%s ERROR %d\n", opname, cnt); + (void) printf ("%s ERROR %d\n", opname, cnt); abort (); } @@ -562,7 +562,7 @@ static void print_cond_w_addr (const char *label, dds_entity_t x) abort(); assert (dds_entity_kind (e) == DDS_KIND_COND_READ || dds_entity_kind (e) == DDS_KIND_COND_QUERY); print_condmask (buf, sizeof (buf), (dds_readcond *) e); - printf ("%s: %"PRId32" => %p %s\n", label, x, (void *) e, buf); + (void) printf ("%s: %"PRId32" => %p %s\n", label, x, (void *) e, buf); dds_entity_unlock (e); } @@ -650,7 +650,7 @@ static void test_conditions (dds_entity_t pp, dds_entity_t tp, const int count, rhcconds[ci] = get_condaddr (conds[ci]); if (print) { char buf[18]; - snprintf (buf, sizeof (buf), "conds[%d]", ci); + (void) snprintf (buf, sizeof (buf), "conds[%d]", ci); print_cond_w_addr (buf, conds[ci]); } dds_waitset_attach(waitset, conds[ci], ci); @@ -761,7 +761,7 @@ static void test_conditions (dds_entity_t pp, dds_entity_t tp, const int count, if (100 * i / count > lastprint_pct) { lastprint_pct = 100 * i / count; - printf ("%d%%%c", lastprint_pct, print ? '\n' : '\r'); + (void) printf ("%d%%%c", lastprint_pct, print ? '\n' : '\r'); fflush (stdout); } @@ -877,24 +877,24 @@ static void test_conditions (dds_entity_t pp, dds_entity_t tp, const int count, } for (size_t oper = 0; oper < sizeof (opcount) / sizeof (opcount[0]); oper++) - printf ("%5s: %8"PRIu32"\n", operstr[oper], opcount[oper]); + (void) printf ("%5s: %8"PRIu32"\n", operstr[oper], opcount[oper]); for (int i = 0; i < (int) (sizeof (states_seen) / sizeof (states_seen[0])); i++) { const char sst = (i & 1) ? 'N' : 'R'; const char vst = (i & 2) ? 'N' : 'O'; const char ist = (i >> 2) == 2 ? 'A' : (i >> 2) == 1 ? 'D' : 'U'; - printf ("%c%c%c: invalid %8"PRIu32" valid %8"PRIu32"\n", sst, vst, ist, states_seen[i][0], states_seen[i][1]); + (void) printf ("%c%c%c: invalid %8"PRIu32" valid %8"PRIu32"\n", sst, vst, ist, states_seen[i][0], states_seen[i][1]); } dds_waitset_detach (waitset, gdcond); for (int ci = 0; ci < nconds; ci++) dds_waitset_detach (waitset, conds[ci]); - dds_delete (waitset); - dds_delete (gdcond); + (void) dds_delete (waitset); + (void) dds_delete (gdcond); for (int ci = 0; ci < nconds; ci++) - dds_delete (conds[ci]); + (void) dds_delete (conds[ci]); for (size_t i = 0; i < nrd; i++) - dds_delete (rd[i]); + (void) dds_delete (rd[i]); for (size_t i = 0, n = (sizeof (wr) / sizeof (wr[0])); i < n; i++) fwr (wr[i]); } @@ -972,7 +972,7 @@ int main (int argc, char **argv) abort (); } - printf ("%"PRId64" prng seed %u first %d count %d print %d xchecks %d\n", dds_time (), seed, first, count, print, xchecks); + (void) printf ("%"PRId64" prng seed %u first %d count %d print %d xchecks %d\n", dds_time (), seed, first, count, print, xchecks); ddsrt_prng_init_simple (&prng, seed); if (xchecks != 0) @@ -1002,7 +1002,7 @@ int main (int argc, char **argv) { struct ddsi_domaingv *gv = get_gv (pp); struct ddsi_tkmap *tkmap = gv->m_tkmap; - printf ("%"PRId64" ************* 0 *************\n", dds_time ()); + (void) printf ("%"PRId64" ************* 0 *************\n", dds_time ()); struct dds_rhc *rhc = mkrhc (gv, NULL, DDS_HISTORY_KEEP_LAST, 1, DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP); struct ddsi_proxy_writer *wr0 = mkwr (1); struct ddsi_proxy_writer *wr1 = mkwr (1); @@ -1076,7 +1076,7 @@ int main (int argc, char **argv) { struct ddsi_domaingv *gv = get_gv (pp); struct ddsi_tkmap *tkmap = gv->m_tkmap; - printf ("%"PRId64" ************* 1 *************\n", dds_time ()); + (void) printf ("%"PRId64" ************* 1 *************\n", dds_time ()); struct dds_rhc *rhc = mkrhc (gv, NULL, DDS_HISTORY_KEEP_LAST, 4, DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP); struct ddsi_proxy_writer *wr[] = { mkwr (0), mkwr (0), mkwr (0) }; uint64_t iid0, iid_t; @@ -1153,11 +1153,11 @@ int main (int argc, char **argv) for (int zz = 0; zz < (int) (sizeof (zztab) / sizeof (zztab[0])); zz++) if (zz + 2 >= first) { - printf ("%"PRId64" ************* %d *************\n", dds_time (), zz + 2); + (void) printf ("%"PRId64" ************* %d *************\n", dds_time (), zz + 2); test_conditions (pp, tp, count, zztab[zz].create, zztab[zz].filter0, zztab[zz].filter1, print); } } - printf ("%"PRId64" cleaning up\n", dds_time ()); + (void) printf ("%"PRId64" cleaning up\n", dds_time ()); ddsrt_cond_destroy (&wait_gc_cycle_cond); ddsrt_mutex_destroy (&wait_gc_cycle_lock); @@ -1166,7 +1166,7 @@ int main (int argc, char **argv) RhcTypes_T_free (&rres_mseq[i], DDS_FREE_CONTENTS); ddsi_sertype_unref (mdtype); - dds_delete (pp); + (void) dds_delete (pp); if (sttarg.when) { diff --git a/src/core/xtests/symbol_export/symbol_export.c b/src/core/xtests/symbol_export/symbol_export.c index 4a37f30afe..3d4e02ad55 100644 --- a/src/core/xtests/symbol_export/symbol_export.c +++ b/src/core/xtests/symbol_export/symbol_export.c @@ -108,7 +108,7 @@ int main (int argc, char **argv) // dds.h dds_enable (1); - dds_delete (1); + (void) dds_delete (1); dds_get_publisher (1); dds_get_subscriber (1); dds_get_datareader (1); @@ -729,7 +729,7 @@ int main (int argc, char **argv) ddsrt_hh_new (0, ptr, ptr); ddsrt_hh_free (ptr); ddsrt_hh_lookup (ptr, ptr); - ddsrt_hh_add (ptr, ptr2); + (void)ddsrt_hh_add (ptr, ptr2); ddsrt_hh_remove (ptr, ptr2); ddsrt_hh_add_absent (ptr, ptr2); ddsrt_hh_remove_present (ptr, ptr2); diff --git a/src/ddsrt/include/dds/ddsrt/attributes.h b/src/ddsrt/include/dds/ddsrt/attributes.h index b4c1463f13..97e9b05c3e 100644 --- a/src/ddsrt/include/dds/ddsrt/attributes.h +++ b/src/ddsrt/include/dds/ddsrt/attributes.h @@ -93,7 +93,7 @@ # if !defined(__MINGW_PRINTF_FORMAT) # define __MINGW_PRINTF_FORMAT gnu_printf # endif - /* GCC assumes printf MS style arguments on Windows */ + /* GCC assumes (void) printf MS style arguments on Windows */ # define ddsrt_attribute_format_printf(string_index, first_to_check) \ ddsrt_attribute_format((__MINGW_PRINTF_FORMAT, string_index, first_to_check)) # else diff --git a/src/ddsrt/src/environ/solaris2.6/environ.c b/src/ddsrt/src/environ/solaris2.6/environ.c index 38543f2ef6..e1f610a503 100644 --- a/src/ddsrt/src/environ/solaris2.6/environ.c +++ b/src/ddsrt/src/environ/solaris2.6/environ.c @@ -60,7 +60,7 @@ ddsrt_setenv(const char *name, const char *value) const size_t namelen = strlen (name); const size_t entrysize = namelen + 1 + strlen (value) + 1; char *entry = malloc (entrysize); - snprintf (entry, entrysize, "%s=%s", name, value); + (void) snprintf (entry, entrysize, "%s=%s", name, value); size_t n = 0; while (environ[n] != NULL) { diff --git a/src/ddsrt/src/filesystem/windows/filesystem.c b/src/ddsrt/src/filesystem/windows/filesystem.c index 0a47abb756..48d642113d 100644 --- a/src/ddsrt/src/filesystem/windows/filesystem.c +++ b/src/ddsrt/src/filesystem/windows/filesystem.c @@ -27,7 +27,7 @@ dds_return_t ddsrt_opendir(const char *name, ddsrt_dir_handle_t *dir) result = DDS_RETCODE_ERROR; if (dir) { - snprintf(szDir, DDSRT_PATH_MAX, "%s\\*", name); + (void) snprintf(szDir, DDSRT_PATH_MAX, "%s\\*", name); hList = FindFirstFile(szDir, &FileData); if (hList != INVALID_HANDLE_VALUE) { diff --git a/src/ddsrt/src/ifaddrs/solaris2.6/ifaddrs.c b/src/ddsrt/src/ifaddrs/solaris2.6/ifaddrs.c index bbe3421692..8aab577cb6 100644 --- a/src/ddsrt/src/ifaddrs/solaris2.6/ifaddrs.c +++ b/src/ddsrt/src/ifaddrs/solaris2.6/ifaddrs.c @@ -59,7 +59,7 @@ ddsrt_getifaddrs( continue; /* Forget about anonymous network devices */ if (ifr->ifr_addr.sa_family != AF_INET) { - printf ("%s: not INET\n", ifr->ifr_name); + (void) printf ("%s: not INET\n", ifr->ifr_name); continue; } diff --git a/src/ddsrt/src/sockets.c b/src/ddsrt/src/sockets.c index 872ee920e1..1d5c7b26e4 100644 --- a/src/ddsrt/src/sockets.c +++ b/src/ddsrt/src/sockets.c @@ -248,7 +248,7 @@ DDSRT_WARNING_GNUC_OFF(sign-conversion) #else { in_addr_t x = ntohl(((struct sockaddr_in *)sa)->sin_addr.s_addr); - snprintf(buf,size,"%u.%u.%u.%u",(x>>24),(x>>16)&0xff,(x>>8)&0xff,x&0xff); + (void) snprintf(buf,size,"%u.%u.%u.%u",(x>>24),(x>>16)&0xff,(x>>8)&0xff,x&0xff); ptr = buf; } #endif diff --git a/src/ddsrt/src/threads/windows/threads.c b/src/ddsrt/src/threads/windows/threads.c index 233ac33268..933edc90b3 100644 --- a/src/ddsrt/src/threads/windows/threads.c +++ b/src/ddsrt/src/threads/windows/threads.c @@ -389,7 +389,7 @@ ddsrt_thread_getname_anythread ( } if (name[0] == 0) { - snprintf (name, sizeof (name), "%"PRIdTID, (ddsrt_tid_t)GetThreadId (tid)); + (void) snprintf (name, sizeof (name), "%"PRIdTID, (ddsrt_tid_t)GetThreadId (tid)); } } return DDS_RETCODE_OK; diff --git a/src/ddsrt/tests/dynlib.c b/src/ddsrt/tests/dynlib.c index c585cbcccc..49b053831b 100644 --- a/src/ddsrt/tests/dynlib.c +++ b/src/ddsrt/tests/dynlib.c @@ -30,7 +30,7 @@ do { \ char err[256]; \ r = ddsrt_dlerror(err, sizeof(err)); \ CU_ASSERT_FATAL(r > 0 || r == DDS_RETCODE_NOT_ENOUGH_SPACE); \ - printf("\n%s", err); \ + (void) printf("\n%s", err); \ CU_FAIL_FATAL(msg); \ } \ } while(0) @@ -44,7 +44,7 @@ CU_Test(ddsrt_library, dlopen_path) dds_return_t r; ddsrt_dynlib_t l; - printf("Absolute lib: %s\n", TEST_LIB_ABSOLUTE); + (void) printf("Absolute lib: %s\n", TEST_LIB_ABSOLUTE); r = ddsrt_dlopen(TEST_LIB_ABSOLUTE, false, &l); CU_ASSERT_EQUAL(r, DDS_RETCODE_OK); CU_ASSERT_PTR_NOT_NULL(l); @@ -94,7 +94,7 @@ CU_Test(ddsrt_library, dlopen_unknown) r = ddsrt_dlerror(buffer, sizeof(buffer)); CU_ASSERT_FATAL(r > 0 || r == DDS_RETCODE_NOT_ENOUGH_SPACE); - printf("\n%s", buffer); + (void) printf("\n%s", buffer); } CU_Test(ddsrt_library, dlsym) @@ -135,7 +135,7 @@ CU_Test(ddsrt_library, dlsym_unknown) r = ddsrt_dlerror(buffer, sizeof(buffer)); CU_ASSERT_FATAL(r > 0 || r == DDS_RETCODE_NOT_ENOUGH_SPACE); - printf("\n%s", buffer); + (void) printf("\n%s", buffer); r = ddsrt_dlclose(l); CU_ASSERT_EQUAL(r, DDS_RETCODE_OK); diff --git a/src/ddsrt/tests/environ.c b/src/ddsrt/tests/environ.c index 6f7dd89e6a..ae061f539b 100644 --- a/src/ddsrt/tests/environ.c +++ b/src/ddsrt/tests/environ.c @@ -136,11 +136,11 @@ CU_Theory((const char *var, const char *expect), ddsrt_environ, expand) /* Expand a string with available environment variables. */ ptr = ddsrt_expand_envvars(var,UINT32_MAX); if (ptr) { - /* printf("==== %10s: expand(%s), expect(%s))\n", var, ptr, expect); */ + /* (void) printf("==== %10s: expand(%s), expect(%s))\n", var, ptr, expect); */ CU_ASSERT_STRING_EQUAL(ptr, expect); ddsrt_free(ptr); } else { - /* printf("==== %10s: expand(), expect())\n", var ? var : ""); */ + /* (void) printf("==== %10s: expand(), expect())\n", var ? var : ""); */ CU_ASSERT_PTR_NULL(expect); } @@ -188,11 +188,11 @@ CU_Theory((const char *var, const char *expect), ddsrt_environ, expand_sh) /* Expand a string with available environment variables. */ ptr = ddsrt_expand_envvars_sh(var,UINT32_MAX); if (ptr) { - /* printf("==== %10s: expand(%s), expect(%s))\n", var, ptr, expect); */ + /* (void) printf("==== %10s: expand(%s), expect(%s))\n", var, ptr, expect); */ CU_ASSERT_STRING_EQUAL(ptr, expect); ddsrt_free(ptr); } else { - /* printf("==== %10s: expand(), expect())\n", var ? var : ""); */ + /* (void) printf("==== %10s: expand(), expect())\n", var ? var : ""); */ CU_ASSERT_PTR_NULL(expect); } diff --git a/src/ddsrt/tests/heap.c b/src/ddsrt/tests/heap.c index 14ea17bf86..71f9083e55 100644 --- a/src/ddsrt/tests/heap.c +++ b/src/ddsrt/tests/heap.c @@ -68,7 +68,7 @@ CU_Test(ddsrt_heap, realloc) for(size_t i = 0; i < nof_allocsizes; i++) { for(size_t j = 0; j < nof_allocsizes; j++) { s = allocsizes[i] * allocsizes[j]; /* Allocates up to 1MB */ - printf("ddsrt_realloc(%p) %zu -> %zu\n", ptr, prevs, s); + (void) printf("ddsrt_realloc(%p) %zu -> %zu\n", ptr, prevs, s); ptr = ddsrt_realloc(ptr, s); CU_ASSERT_PTR_NOT_NULL_FATAL(ptr); /* ddsrt_realloc is supposed to abort on failure */ assert(ptr); @@ -136,7 +136,7 @@ CU_Test(ddsrt_heap, ddsrt_realloc_s) for(size_t j = 0; j < nof_allocsizes_s; j++) { s = allocsizes_s[i] * allocsizes_s[j]; /* Allocates up to 8MB */ newptr = ddsrt_realloc_s(ptr, s); - printf("%p = ddsrt_realloc_s(%p) %zu -> %zu\n", newptr, ptr, prevs, s); + (void) printf("%p = ddsrt_realloc_s(%p) %zu -> %zu\n", newptr, ptr, prevs, s); if (s <= 16) { /* Failure to allocate can't be considered a test fault really, * except that a ddsrt_realloc_s(0 < s <=16) would fail is unlikely. */ diff --git a/src/ddsrt/tests/hopscotch.c b/src/ddsrt/tests/hopscotch.c index 3ece3e36f5..25bffd355a 100644 --- a/src/ddsrt/tests/hopscotch.c +++ b/src/ddsrt/tests/hopscotch.c @@ -65,7 +65,7 @@ static void init (bool random) bool haveseed = ddsrt_prng_makeseed (&prng_seed); CU_ASSERT_FATAL (haveseed); ddsrt_prng_init (&prng, &prng_seed); - printf ("%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32"\n", + (void) printf ("%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32"\n", prng_seed.key[0], prng_seed.key[1], prng_seed.key[2], prng_seed.key[3], prng_seed.key[4], prng_seed.key[5], prng_seed.key[6], prng_seed.key[7]); next_v = MAX_NKEYS; @@ -172,14 +172,14 @@ CU_TheoryDataPoints (ddsrt_hopscotch, random) = { CU_Theory ((const struct ops *ops, bool random, adj_fun_t adj, const char *adjname), ddsrt_hopscotch, random, .timeout = 20) { - printf ("%"PRId64" %s random=%d adj=%s\n", ddsrt_time_monotonic().v, ops->name, random, adjname); + (void) printf ("%"PRId64" %s random=%d adj=%s\n", ddsrt_time_monotonic().v, ops->name, random, adjname); fflush (stdout); init (random); void *h = ops->new (); uint32_t i, nk = 0; uint64_t nn = 0; ddsrt_mtime_t t0, t1; - printf ("%"PRId64" %s start\n", ddsrt_time_monotonic().v, ops->name); + (void) printf ("%"PRId64" %s start\n", ddsrt_time_monotonic().v, ops->name); fflush (stdout); t0 = ddsrt_time_monotonic (); for (uint32_t iter = 0; iter < MAX_ITERS; iter++) @@ -218,7 +218,7 @@ CU_Theory ((const struct ops *ops, bool random, adj_fun_t adj, const char *adjna } t1 = ddsrt_time_monotonic (); ops->free (h); - printf ("%"PRId64" %s done %"PRIu64" %.0f ns/cycle\n", ddsrt_time_monotonic().v, ops->name, nn, (double) (t1.v - t0.v) / (double) nn); + (void) printf ("%"PRId64" %s done %"PRIu64" %.0f ns/cycle\n", ddsrt_time_monotonic().v, ops->name, nn, (double) (t1.v - t0.v) / (double) nn); fflush (stdout); } @@ -264,7 +264,7 @@ static uint32_t chhtest_thread (void *varg) bool haveseed = ddsrt_prng_makeseed (&prng_seed); CU_ASSERT_FATAL (haveseed); ddsrt_prng_init (&local_prng, &prng_seed); - printf ("%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32"\n", + (void) printf ("%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32".%08"PRIx32"\n", prng_seed.key[0], prng_seed.key[1], prng_seed.key[2], prng_seed.key[3], prng_seed.key[4], prng_seed.key[5], prng_seed.key[6], prng_seed.key[7]); while (!ddsrt_atomic_ld32 (arg->stop)) { @@ -378,13 +378,13 @@ CU_Test(ddsrt_hopscotch, concurrent, .timeout = 20) { dds_return_t ret = ddsrt_thread_join (tids[i], NULL); CU_ASSERT_FATAL (ret == 0); - printf ("args[%"PRIu32"] add %"PRIu32" rm %"PRIu32" lk %"PRIu32" max %"PRIu32"\n", + (void) printf ("args[%"PRIu32"] add %"PRIu32" rm %"PRIu32" lk %"PRIu32" max %"PRIu32"\n", i, args[i].adds, args[i].removes, args[i].lookups, args[i].maxnkeys); } uint32_t count = 0; ddsrt_chh_enum_unsafe (chh, check ? chhtest_check : chhtest_count, &count); - printf ("nkeys in hash %"PRIu32"\n", count); + (void) printf ("nkeys in hash %"PRIu32"\n", count); if (check) { for (uint32_t i = 0; i < nkeys; i++) diff --git a/src/ddsrt/tests/select.c b/src/ddsrt/tests/select.c index 7693877f6d..fd708c4673 100644 --- a/src/ddsrt/tests/select.c +++ b/src/ddsrt/tests/select.c @@ -123,7 +123,7 @@ sockets_pipe(ddsrt_socket_t socks[2]) addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); addr.sin_port = 0; - fprintf (stderr, "sockets_pipe ... begin\n"); + (void) fprintf (stderr, "sockets_pipe ... begin\n"); CU_ASSERT_PTR_NOT_NULL_FATAL(socks); rc = ddsrt_socket(&sock, AF_INET, SOCK_STREAM, 0); CU_ASSERT_EQUAL_FATAL(rc, DDS_RETCODE_OK); @@ -134,17 +134,17 @@ sockets_pipe(ddsrt_socket_t socks[2]) addrlen = (socklen_t) sizeof(addr); rc = ddsrt_getsockname(sock, (struct sockaddr *)&addr, &addrlen); CU_ASSERT_EQUAL_FATAL(rc, DDS_RETCODE_OK); - fprintf (stderr, "sockets_pipe ... listen\n"); + (void) fprintf (stderr, "sockets_pipe ... listen\n"); rc = ddsrt_listen(sock, 1); CU_ASSERT_EQUAL_FATAL(rc, DDS_RETCODE_OK); - fprintf (stderr, "sockets_pipe ... connect\n"); + (void) fprintf (stderr, "sockets_pipe ... connect\n"); rc = ddsrt_connect(socks[1], (struct sockaddr *)&addr, sizeof(addr)); CU_ASSERT_EQUAL_FATAL(rc, DDS_RETCODE_OK); - fprintf (stderr, "sockets_pipe ... accept\n"); + (void) fprintf (stderr, "sockets_pipe ... accept\n"); rc = ddsrt_accept(sock, NULL, NULL, &socks[0]); CU_ASSERT_EQUAL_FATAL(rc, DDS_RETCODE_OK); ddsrt_close(sock); - fprintf (stderr, "sockets_pipe ... done\n"); + (void) fprintf (stderr, "sockets_pipe ... done\n"); } static const char mesg[] = "foobar"; @@ -172,9 +172,9 @@ static uint32_t select_timeout_routine(void *ptr) after = dds_time(); delay = after - before; - fprintf(stderr, "Waited for %"PRId64" (nanoseconds)\n", delay); - fprintf(stderr, "Expected to wait %"PRId64" (nanoseconds)\n", arg->delay); - fprintf(stderr, "ddsrt_select returned %"PRId32"\n", rc); + (void) fprintf(stderr, "Waited for %"PRId64" (nanoseconds)\n", delay); + (void) fprintf(stderr, "Expected to wait %"PRId64" (nanoseconds)\n", arg->delay); + (void) fprintf(stderr, "ddsrt_select returned %"PRId32"\n", rc); if (rc == DDS_RETCODE_TIMEOUT) res = ((after - delay) >= (arg->delay - arg->skew)); @@ -201,18 +201,18 @@ CU_Test(ddsrt_select, timeout) arg.skew = DDS_MSECS(1000); arg.sock = socks[0]; - fprintf (stderr, "create thread\n"); + (void) fprintf (stderr, "create thread\n"); ddsrt_threadattr_init(&attr); rc = ddsrt_thread_create(&thr, "select_timeout", &attr, &select_timeout_routine, &arg); CU_ASSERT_EQUAL_FATAL(rc, DDS_RETCODE_OK); /* Allow the thread some time to get ready. */ dds_sleepfor(arg.delay * 2); /* Send data to the read socket to avoid blocking indefinitely. */ - fprintf (stderr, "write data\n"); + (void) fprintf (stderr, "write data\n"); ssize_t sent = 0; rc = ddsrt_send(socks[1], mesg, sizeof(mesg), 0, &sent); CU_ASSERT_EQUAL_FATAL(rc, DDS_RETCODE_OK); - fprintf (stderr, "join thread\n"); + (void) fprintf (stderr, "join thread\n"); rc = ddsrt_thread_join(thr, &res); CU_ASSERT_EQUAL_FATAL(rc, DDS_RETCODE_OK); CU_ASSERT_EQUAL(res, 1); diff --git a/src/ddsrt/tests/sync.c b/src/ddsrt/tests/sync.c index dc4d676e20..f70367097c 100644 --- a/src/ddsrt/tests/sync.c +++ b/src/ddsrt/tests/sync.c @@ -268,9 +268,9 @@ static uint32_t waitfor_routine(void *ptr) } after = dds_time(); reltime = after - before; - fprintf(stderr, "waited for %"PRId64" (nanoseconds)\n", reltime); - fprintf(stderr, "expected to wait %"PRId64" (nanoseconds)\n", arg->reltime); - fprintf(stderr, "woke up %"PRIu32" times\n", cnt); + (void) fprintf(stderr, "waited for %"PRId64" (nanoseconds)\n", reltime); + (void) fprintf(stderr, "expected to wait %"PRId64" (nanoseconds)\n", arg->reltime); + (void) fprintf(stderr, "woke up %"PRIu32" times\n", cnt); ddsrt_mutex_unlock(&arg->lock); if (reltime >= arg->reltime) { /* Ensure that the condition variable at least waited for the amount of @@ -320,9 +320,9 @@ static uint32_t waituntil_routine(void *ptr) } after = dds_time(); ddsrt_mutex_unlock(&arg->lock); - fprintf(stderr, "waited until %"PRId64" (nanoseconds)\n", after); - fprintf(stderr, "expected to wait until %"PRId64" (nanoseconds)\n", arg->abstime); - fprintf(stderr, "woke up %"PRIu32" times\n", cnt); + (void) fprintf(stderr, "waited until %"PRId64" (nanoseconds)\n", after); + (void) fprintf(stderr, "expected to wait until %"PRId64" (nanoseconds)\n", arg->abstime); + (void) fprintf(stderr, "woke up %"PRIu32" times\n", cnt); if (after > arg->abstime) { res = cnt < 3; /* An arbitrary number to ensure the implementation did not just spin, aka is completely broken. */ diff --git a/src/idl/src/processor.c b/src/idl/src/processor.c index 8de047f32e..36171c524c 100644 --- a/src/idl/src/processor.c +++ b/src/idl/src/processor.c @@ -98,6 +98,7 @@ parse_builtin_annotations( case IDL_TOKEN_LINE_COMMENT: if (token.value.str && !save) { idl_free(token.value.str); + token.value.str = NULL; } break; default: @@ -121,6 +122,7 @@ parse_builtin_annotations( if (name.identifier) { idl_free(name.identifier); + name.identifier = NULL; } /* builtin annotations must not declare more than one annotation per block @@ -263,7 +265,7 @@ idl_log( if (cnt == -1) return; - fprintf(stderr, "%s\n", buf); + (void) fprintf(stderr, "%s\n", buf); } #define IDL_LC_ERROR 1 @@ -547,8 +549,10 @@ idl_retcode_t idl_parse(idl_pstate_t *pstate) case IDL_TOKEN_PP_NUMBER: case IDL_TOKEN_COMMENT: case IDL_TOKEN_LINE_COMMENT: - if (tok.value.str) + if (tok.value.str) { idl_free(tok.value.str); + tok.value.str = NULL; + } break; default: break; diff --git a/src/idl/src/string.c b/src/idl/src/string.c index 3b8242fb34..4b5d44c748 100644 --- a/src/idl/src/string.c +++ b/src/idl/src/string.c @@ -469,7 +469,7 @@ static locale_t posix_locale(void) #else locale = newlocale(LC_ALL, "C", (locale_t)0); #endif - pthread_setspecific(key, locale); + (void)pthread_setspecific(key, locale); return locale; } #endif /* _WIN32 */ diff --git a/src/idl/tests/annotation.c b/src/idl/tests/annotation.c index 76bb33e395..2a19252b81 100644 --- a/src/idl/tests/annotation.c +++ b/src/idl/tests/annotation.c @@ -831,7 +831,7 @@ CU_Test(idl_annotation, extensibility) idl_pstate_t *pstate = NULL; for (size_t i = 0; i < n; i++) { - printf("idl: %s\n", tests[i].str); + (void) printf("idl: %s\n", tests[i].str); pstate = NULL; ret = parse_string(IDL_FLAG_ANNOTATIONS, tests[i].str, &pstate); CU_ASSERT_EQUAL_FATAL(ret, tests[i].ret); @@ -978,7 +978,7 @@ CU_Test(idl_annotation, bit_bound) idl_pstate_t *pstate; for (size_t i = 0; i < n; i++) { - printf("idl_annotation.bit_bound test: %s\n", tests[i].str); + (void) printf("idl_annotation.bit_bound test: %s\n", tests[i].str); pstate = NULL; ret = parse_string(IDL_FLAG_ANNOTATIONS, tests[i].str, &pstate); if (tests[i].valid) { @@ -1035,7 +1035,7 @@ CU_Test(idl_annotation, position) idl_pstate_t *pstate; for (size_t i = 0; i < n; i++) { - printf("idl_annotation.position test: %s\n", tests[i].str); + (void) printf("idl_annotation.position test: %s\n", tests[i].str); pstate = NULL; ret = parse_string(IDL_FLAG_ANNOTATIONS, tests[i].str, &pstate); if (tests[i].valid) { diff --git a/src/idl/tests/file.c b/src/idl/tests/file.c index aa16af7be2..b176c8b169 100644 --- a/src/idl/tests/file.c +++ b/src/idl/tests/file.c @@ -135,7 +135,7 @@ CU_Test(idl_file, untaint) str = idl_strdup(tests[i].input); CU_ASSERT_PTR_NOT_NULL_FATAL(str); assert(str); - fprintf(stderr, "input: '%s'\n", str); + (void) fprintf(stderr, "input: '%s'\n", str); len = idl_untaint_path(str); if (tests[i].length == -1) { CU_ASSERT_EQUAL(len, -1); @@ -143,7 +143,7 @@ CU_Test(idl_file, untaint) CU_ASSERT_EQUAL(len, (ssize_t)strlen(tests[i].output)); } if (len >= 0) { - fprintf(stderr, "output: '%s'\n", str); + (void) fprintf(stderr, "output: '%s'\n", str); CU_ASSERT_STRING_EQUAL(str, tests[i].output); } free(str); @@ -159,7 +159,7 @@ CU_Test(idl_file, normalize_empty) CU_ASSERT_FATAL(ret >= 0); CU_ASSERT_PTR_NOT_NULL_FATAL(norm); assert(prefix); - fprintf(stderr, "path: %s\nexpect: %s\nnormalized: %s\n", prefix, prefix, norm); + (void) fprintf(stderr, "path: %s\nexpect: %s\nnormalized: %s\n", prefix, prefix, norm); CU_ASSERT_STRING_EQUAL(norm, prefix); free(norm); } @@ -176,7 +176,7 @@ CU_Test(idl_file, normalize_revert) CU_ASSERT_FATAL(ret >= 0); CU_ASSERT_PTR_NOT_NULL_FATAL(norm); assert(norm); - fprintf(stderr, "path: %s\n", path); + (void) fprintf(stderr, "path: %s\n", path); { size_t sep = 0; for (size_t i=0,n=strlen(prefix); i < n; i++) { if (idl_isseparator(path[i])) @@ -185,7 +185,7 @@ CU_Test(idl_file, normalize_revert) CU_ASSERT_NOT_EQUAL_FATAL(sep, 0); path[sep] = '\0'; } - fprintf(stderr, "expect: %s\nnormalized: %s\n", path, norm); + (void) fprintf(stderr, "expect: %s\nnormalized: %s\n", path, norm); CU_ASSERT_STRING_EQUAL(path, norm); free(path); free(norm); @@ -197,7 +197,7 @@ CU_Test(idl_file, normalize_revert_too_many) size_t size, step, steps = 1; /* one too many */ char *revert = NULL, *path = NULL, *norm = NULL; - fprintf(stderr, "prefix: %s\n", prefix); + (void) fprintf(stderr, "prefix: %s\n", prefix); for (size_t i=0; prefix[i]; i++) steps += idl_isseparator(prefix[i]); @@ -211,13 +211,13 @@ CU_Test(idl_file, normalize_revert_too_many) memcpy(revert + (i*step), "/..", step); revert[size] = '\0'; - fprintf(stderr, "revert: %s\n", revert); + (void) fprintf(stderr, "revert: %s\n", revert); path = NULL; (void) idl_asprintf(&path, "%s%s", prefix, revert); CU_ASSERT_PTR_NOT_NULL_FATAL(path); - fprintf(stderr, "path: %s\n", path); + (void) fprintf(stderr, "path: %s\n", path); norm = NULL; ret = idl_normalize_path(path, &norm); @@ -268,10 +268,10 @@ CU_Test(idl_file, relative_bad_params) rel = NULL; base = j ? t[i].path : t[i].base; path = j ? t[i].base : t[i].path; - fprintf(stderr, "base: %s\n", base); - fprintf(stderr, "path: %s\n", path); + (void) fprintf(stderr, "base: %s\n", base); + (void) fprintf(stderr, "path: %s\n", path); ret = idl_relative_path(base, path, &rel); - fprintf(stderr, "relative: %s\n", rel ? rel : "-"); + (void) fprintf(stderr, "relative: %s\n", rel ? rel : "-"); if (rel) free(rel); CU_ASSERT_EQUAL_FATAL(ret, bad_param); @@ -309,12 +309,12 @@ CU_Test(idl_file, relative) for (size_t i=0; i < n; i++) { rel = NULL; - fprintf(stderr, "base: '%s'\n", t[i].base); - fprintf(stderr, "path: '%s'\n", t[i].path); + (void) fprintf(stderr, "base: '%s'\n", t[i].base); + (void) fprintf(stderr, "path: '%s'\n", t[i].path); ret = idl_relative_path(t[i].base, t[i].path, &rel); CU_ASSERT_EQUAL(ret, t[i].retcode); if (rel) - fprintf(stderr, "relative: '%s'\n", rel); + (void) fprintf(stderr, "relative: '%s'\n", rel); if (t[i].relpath) { CU_ASSERT_PTR_NOT_NULL_FATAL(rel); CU_ASSERT(rel && strcmp(t[i].relpath, rel) == 0); diff --git a/src/idl/tests/forward.c b/src/idl/tests/forward.c index a2e9bc8fdd..42f181a466 100644 --- a/src/idl/tests/forward.c +++ b/src/idl/tests/forward.c @@ -50,7 +50,7 @@ CU_Test(idl_forward, struct_union_maybe_enum) for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) { idl_retcode_t ret; idl_pstate_t *pstate = NULL; - printf("test idl: %s\n", tests[i].idl); + (void) printf("test idl: %s\n", tests[i].idl); ret = parse_string(tests[i].idl, &pstate); CU_ASSERT_EQUAL_FATAL(ret, tests[i].retcode); if (ret == IDL_RETCODE_OK) { @@ -87,7 +87,7 @@ CU_Test(idl_forward, aliases) for (size_t i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { idl_retcode_t ret; idl_pstate_t *pstate = NULL; - printf("test idl: %s\n", tests[i].idl); + (void) printf("test idl: %s\n", tests[i].idl); ret = parse_string(tests[i].idl, &pstate); CU_ASSERT_EQUAL(ret, tests[i].retcode); if (ret == IDL_RETCODE_OK) { @@ -127,7 +127,7 @@ CU_Test(idl_forward, backwards_aliases) for (size_t i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { idl_retcode_t ret; idl_pstate_t *pstate = NULL; - printf("test idl: %s\n", tests[i].idl); + (void) printf("test idl: %s\n", tests[i].idl); ret = parse_string(tests[i].idl, &pstate); CU_ASSERT_EQUAL(ret, tests[i].retcode); if (ret == IDL_RETCODE_OK) { diff --git a/src/idl/tests/parser.c b/src/idl/tests/parser.c index 5ef5842ce5..f2d56abda2 100644 --- a/src/idl/tests/parser.c +++ b/src/idl/tests/parser.c @@ -302,7 +302,7 @@ static idl_retcode_t test_req_xcdr2(const idl_pstate_t* pstate, const bool revis CU_ASSERT_EQUAL(idl_requires_xcdr2(node), expected); if (idl_requires_xcdr2(node) == expected) return IDL_RETCODE_OK; - printf("required xcdr test failed\n"); + (void) printf("required xcdr test failed\n"); return IDL_RETCODE_SEMANTIC_ERROR; } @@ -366,7 +366,7 @@ CU_Test(idl_parser, require_xcdr2) }; for (size_t i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) { - printf("idl_parser_require_xcdr2 for idl: %s\n", tests[i].idl); + (void) printf("idl_parser_require_xcdr2 for idl: %s\n", tests[i].idl); test_require_xcdr2(&tests[i]); } } diff --git a/src/idl/tests/pragma.c b/src/idl/tests/pragma.c index 238463b2ee..e33f629a71 100644 --- a/src/idl/tests/pragma.c +++ b/src/idl/tests/pragma.c @@ -187,11 +187,11 @@ CU_Test(idl_pragma, keylist_conflicting) }; for (size_t i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) { - printf("Test idl: %s\n", tests[i].idl); + (void) printf("Test idl: %s\n", tests[i].idl); ret = parse_string(tests[i].idl, &pstate); CU_ASSERT_EQUAL_FATAL(ret, tests[i].ret); if (ret != tests[i].ret) - printf("retcode: %d\n%s\n", ret, tests[i].idl); + (void) printf("retcode: %d\n%s\n", ret, tests[i].idl); idl_delete_pstate(pstate); pstate = NULL; } diff --git a/src/idl/tests/scanner.c b/src/idl/tests/scanner.c index 4617afeb9f..d653f94c32 100644 --- a/src/idl/tests/scanner.c +++ b/src/idl/tests/scanner.c @@ -40,18 +40,18 @@ compare_position(idl_position_t *a, idl_position_t *b) static void assert_location(idl_location_t *a, idl_location_t *b) { - fprintf(stderr, "first.line: %"PRIu32", %"PRIu32"\n", a->first.line, b->first.line); - fprintf(stderr, "first.column: %"PRIu32", %"PRIu32"\n", a->first.column, b->first.column); + (void) fprintf(stderr, "first.line: %"PRIu32", %"PRIu32"\n", a->first.line, b->first.line); + (void) fprintf(stderr, "first.column: %"PRIu32", %"PRIu32"\n", a->first.column, b->first.column); CU_ASSERT_EQUAL(compare_position(&a->first, &b->first), 0); - fprintf(stderr, "last.line: %"PRIu32", %"PRIu32"\n", a->last.line, b->last.line); - fprintf(stderr, "last.column: %"PRIu32", %"PRIu32"\n", a->last.column, b->last.column); + (void) fprintf(stderr, "last.line: %"PRIu32", %"PRIu32"\n", a->last.line, b->last.line); + (void) fprintf(stderr, "last.column: %"PRIu32", %"PRIu32"\n", a->last.column, b->last.column); CU_ASSERT_EQUAL(compare_position(&a->last, &b->last), 0); } static void assert_token(idl_token_t *tok, idl_token_t *xtok) { - fprintf(stderr, "code: %"PRId32", %"PRId32"\n", tok->code, xtok->code); + (void) fprintf(stderr, "code: %"PRId32", %"PRId32"\n", tok->code, xtok->code); CU_ASSERT_EQUAL(tok->code, xtok->code); assert_location(&tok->location, &xtok->location); if (tok->code != xtok->code) @@ -64,9 +64,9 @@ assert_token(idl_token_t *tok, idl_token_t *xtok) break; CU_ASSERT_PTR_NOT_NULL(tok->value.str); if (tok->value.str) { - fprintf(stderr, "string: '%s', '%s'\n", tok->value.str, xtok->value.str); + (void) fprintf(stderr, "string: '%s', '%s'\n", tok->value.str, xtok->value.str); } else { - fprintf(stderr, "string: null, '%s'\n", xtok->value.str); + (void) fprintf(stderr, "string: null, '%s'\n", xtok->value.str); break; } CU_ASSERT_STRING_EQUAL(tok->value.str, xtok->value.str); diff --git a/src/idl/tests/typedef.c b/src/idl/tests/typedef.c index d5d03e3533..0d85a3a24b 100644 --- a/src/idl/tests/typedef.c +++ b/src/idl/tests/typedef.c @@ -245,7 +245,7 @@ CU_Test(idl_typedef, forward_declaration) for (size_t i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) { idl_retcode_t ret; idl_pstate_t *pstate = NULL; - printf("test idl: %s\n", tests[i].idl); + (void) printf("test idl: %s\n", tests[i].idl); ret = parse_string(tests[i].idl, &pstate); CU_ASSERT_EQUAL_FATAL(ret, tests[i].retcode); if (ret == IDL_RETCODE_OK) { @@ -279,7 +279,7 @@ CU_Test(idl_typedef, backwards_forward_declaration) for (size_t i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) { idl_retcode_t ret; idl_pstate_t *pstate = NULL; - printf("test idl: %s\n", tests[i].idl); + (void) printf("test idl: %s\n", tests[i].idl); ret = parse_string(tests[i].idl, &pstate); CU_ASSERT_EQUAL_FATAL(ret, tests[i].retcode); if (ret == IDL_RETCODE_OK) { @@ -315,7 +315,7 @@ CU_Test(idl_typedef, constructed_type) for (size_t i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) { idl_retcode_t ret; idl_pstate_t *pstate = NULL; - printf("test idl: %s\n", tests[i].idl); + (void) printf("test idl: %s\n", tests[i].idl); ret = parse_string(tests[i].idl, &pstate); CU_ASSERT_EQUAL_FATAL(ret, tests[i].retcode); if (ret == IDL_RETCODE_OK) { @@ -345,7 +345,7 @@ CU_Test(idl_typedef, scoped_name) for (size_t i = 0; i < sizeof(tests)/sizeof(tests[0]); i++) { idl_retcode_t ret; idl_pstate_t *pstate = NULL; - printf("test idl: %s\n", tests[i].idl); + (void) printf("test idl: %s\n", tests[i].idl); ret = parse_string(tests[i].idl, &pstate); CU_ASSERT_EQUAL_FATAL(ret, tests[i].retcode); idl_delete_pstate(pstate); diff --git a/src/security/builtin_plugins/access_control/src/access_control_parser.c b/src/security/builtin_plugins/access_control/src/access_control_parser.c index 3ba2671490..7575b75b27 100644 --- a/src/security/builtin_plugins/access_control/src/access_control_parser.c +++ b/src/security/builtin_plugins/access_control/src/access_control_parser.c @@ -30,7 +30,7 @@ static void print_tab(int spaces) { while (spaces > 0) { - printf(" "); + (void) printf(" "); spaces--; } } @@ -38,20 +38,20 @@ static void print_tab(int spaces) static void print_string_value(struct string_value *val, const char *info, int spaces) { print_tab(spaces); - printf("%s", info); + (void) printf("%s", info); if (val) - printf(": %s", val->value ? val->value : ""); - printf("\n"); + (void) printf(": %s", val->value ? val->value : ""); + (void) printf("\n"); } #define PRINT_VALUE_BASIC(name_, type_) \ static void print_##name_##_value (type_ *val, const char *info, int spaces) \ { \ print_tab(spaces); \ - printf("%s", info); \ + (void) printf("%s", info); \ if (val) \ - printf(": %d", val->value); \ - printf("\n"); \ + (void) printf(": %d", val->value); \ + (void) printf("\n"); \ } PRINT_VALUE_BASIC(bool, struct boolean_value) PRINT_VALUE_BASIC(int, struct integer_value) @@ -62,7 +62,7 @@ PRINT_VALUE_BASIC(basic_protection, struct basicprotection_kind_value) static void print_domains(struct domains *domains, int spaces) { print_tab(spaces); - printf("domains {\n"); + (void) printf("domains {\n"); if (domains) { struct domain_id_set *current = domains->domain_id_set; @@ -82,16 +82,16 @@ static void print_domains(struct domains *domains, int spaces) } else { - printf(" {\n"); + (void) printf(" {\n"); } print_tab(spaces); - printf("}\n"); + (void) printf("}\n"); } static void print_topic_rule(struct topic_rule *rule, int spaces) { print_tab(spaces); - printf("topic_rule {\n"); + (void) printf("topic_rule {\n"); if (rule) { print_string_value(rule->topic_expression, "topic_expression", spaces + 3); @@ -104,16 +104,16 @@ static void print_topic_rule(struct topic_rule *rule, int spaces) } else { - printf(" {\n"); + (void) printf(" {\n"); } print_tab(spaces); - printf("}\n"); + (void) printf("}\n"); } static void print_topic_access_rules(struct topic_access_rules *tar, int spaces) { print_tab(spaces); - printf("topic_access_rules {\n"); + (void) printf("topic_access_rules {\n"); if (tar) { struct topic_rule *current = tar->topic_rule; @@ -125,16 +125,16 @@ static void print_topic_access_rules(struct topic_access_rules *tar, int spaces) } else { - printf(" {\n"); + (void) printf(" {\n"); } print_tab(spaces); - printf("}\n"); + (void) printf("}\n"); } static void print_domain_rule(struct domain_rule *rule, int spaces) { print_tab(spaces); - printf("domain_rule {\n"); + (void) printf("domain_rule {\n"); if (rule) { print_domains(rule->domains, spaces + 3); @@ -147,16 +147,16 @@ static void print_domain_rule(struct domain_rule *rule, int spaces) } else { - printf(" {\n"); + (void) printf(" {\n"); } print_tab(spaces); - printf("}\n"); + (void) printf("}\n"); } static void print_domain_access_rules(struct domain_access_rules *dar, int spaces) { print_tab(spaces); - printf("domain_access_rules {\n"); + (void) printf("domain_access_rules {\n"); if (dar) { struct domain_rule *current = dar->domain_rule; @@ -168,10 +168,10 @@ static void print_domain_access_rules(struct domain_access_rules *dar, int space } else { - printf(" {\n"); + (void) printf(" {\n"); } print_tab(spaces); - printf("}\n"); + (void) printf("}\n"); } static void print_governance_parser_result(struct governance_parser *parser) @@ -179,9 +179,9 @@ static void print_governance_parser_result(struct governance_parser *parser) assert(parser); assert(parser->dds); assert(parser->dds->domain_access_rules); - printf("-----------------------------------------------\n"); + (void) printf("-----------------------------------------------\n"); print_domain_access_rules(parser->dds->domain_access_rules, 0); - printf("-----------------------------------------------\n"); + (void) printf("-----------------------------------------------\n"); } static void print_topic(struct string_value *topic, int spaces) @@ -198,10 +198,10 @@ static void print_topics(struct topics *topics, int spaces) if (topics) { print_tab(spaces); - printf("topics {\n"); + (void) printf("topics {\n"); print_topic(topics->topic, spaces + 3); print_tab(spaces); - printf("}\n"); + (void) printf("}\n"); } } @@ -219,10 +219,10 @@ static void print_partitions(struct partitions *partitions, int spaces) if (partitions) { print_tab(spaces); - printf("partitions {\n"); + (void) printf("partitions {\n"); print_partition(partitions->partition, spaces + 3); print_tab(spaces); - printf("}\n"); + (void) printf("}\n"); } } @@ -235,15 +235,15 @@ static void print_criteria(struct criteria *criteria, int spaces) { print_tab(spaces); if (current->criteria_type == SUBSCRIBE_CRITERIA) - printf("subscribe {\n"); + (void) printf("subscribe {\n"); else if (current->criteria_type == PUBLISH_CRITERIA) - printf("publish {\n"); + (void) printf("publish {\n"); else assert(0); print_topics(current->topics, spaces + 3); print_partitions(current->partitions, spaces + 3); print_tab(spaces); - printf("}\n"); + (void) printf("}\n"); current = (struct criteria *)current->node.next; } } @@ -258,15 +258,15 @@ static void print_allow_deny_rule(struct allow_deny_rule *allow_deny_rule, int s { print_tab(spaces); if (current->rule_type == ALLOW_RULE) - printf("allow_rule {\n"); + (void) printf("allow_rule {\n"); else if (current->rule_type == DENY_RULE) - printf("deny_rule {\n"); + (void) printf("deny_rule {\n"); else assert(0); print_domains(current->domains, spaces + 3); print_criteria(current->criteria, spaces + 3); print_tab(spaces); - printf("}\n"); + (void) printf("}\n"); current = (struct allow_deny_rule *)current->node.next; } } @@ -276,13 +276,13 @@ static void print_permissions(struct permissions *permissions, int spaces) { struct grant *current = permissions->grant; print_tab(spaces); - printf("permissions {\n"); + (void) printf("permissions {\n"); while (current != NULL) { print_tab(spaces + 3); - printf("grant {\n"); + (void) printf("grant {\n"); print_tab(spaces + 6); - printf("name: %s\n", current->name); + (void) printf("name: %s\n", current->name); print_string_value(current->subject_name, "subject_name", spaces + 6); print_string_value(current->validity->not_before, "validity_not_before", spaces + 6); print_string_value(current->validity->not_after, "validity_not_after", spaces + 6); @@ -290,10 +290,10 @@ static void print_permissions(struct permissions *permissions, int spaces) print_string_value(current->default_action, "default", spaces + 6); current = (struct grant *)current->node.next; print_tab(spaces + 3); - printf("}\n"); + (void) printf("}\n"); } print_tab(spaces); - printf("}\n"); + (void) printf("}\n"); } static void print_permissions_parser_result(struct permissions_parser *parser) @@ -301,9 +301,9 @@ static void print_permissions_parser_result(struct permissions_parser *parser) assert(parser); assert(parser->dds); assert(parser->dds->permissions); - printf("-----------------------------------------------\n"); + (void) printf("-----------------------------------------------\n"); print_permissions(parser->dds->permissions, 0); - printf("-----------------------------------------------\n"); + (void) printf("-----------------------------------------------\n"); } #endif /* DEBUG_PARSER */ @@ -589,7 +589,7 @@ static int governance_element_open_cb(void *varg, uintptr_t parentinfo, uintptr_ } else { - printf("Unknown XML element: %s\n", name); + (void) printf("Unknown XML element: %s\n", name); return -1; } @@ -697,7 +697,7 @@ static int governance_element_close_cb(void *varg, uintptr_t eleminfo, int line) static void governance_error_cb(void *varg, const char *msg, int line) { DDSRT_UNUSED_ARG(varg); - printf("Failed to parse configuration file: error %d - %s\n", line, msg); + (void) printf("Failed to parse configuration file: error %d - %s\n", line, msg); } static void free_stringvalue(struct string_value *str) @@ -956,12 +956,12 @@ static int permissions_element_open_cb(void *varg, uintptr_t parentinfo, uintptr /*if this is the first element in the IGNORED branch, then give warning for the user*/ #if 0 if (parser->current->parent->kind != ELEMENT_KIND_IGNORED) - printf("Warning: Unsupported element \"%s\" has been ignored in permissions file.\n", name); + (void) printf("Warning: Unsupported element \"%s\" has been ignored in permissions file.\n", name); #endif } else { - printf("Unknown XML element: %s\n", name); + (void) printf("Unknown XML element: %s\n", name); return -1; } @@ -1045,7 +1045,7 @@ static int permissions_element_close_cb(void *varg, uintptr_t eleminfo, int line static void permissions_error_cb(void *varg, const char *msg, int line) { DDSRT_UNUSED_ARG(varg); - printf("Failed to parse configuration file: error %d - %s\n", line, msg); + (void) printf("Failed to parse configuration file: error %d - %s\n", line, msg); } bool ac_parse_permissions_xml(const char *xml, struct permissions_parser **permissions_tree, DDS_Security_SecurityException *ex) diff --git a/src/security/builtin_plugins/cryptographic/src/crypto_objects.c b/src/security/builtin_plugins/cryptographic/src/crypto_objects.c index e94bd81a90..603154f95e 100644 --- a/src/security/builtin_plugins/cryptographic/src/crypto_objects.c +++ b/src/security/builtin_plugins/cryptographic/src/crypto_objects.c @@ -183,7 +183,7 @@ CryptoObject * crypto_object_table_insert(struct CryptoObjectTable *table, Crypt ddsrt_mutex_lock(&table->lock); if (!(cur = crypto_object_keep (table->findfnc(table, &object->handle)))) - ddsrt_hh_add(table->htab, crypto_object_keep(object)); + (void)ddsrt_hh_add(table->htab, crypto_object_keep(object)); else crypto_object_release(cur); ddsrt_mutex_unlock(&table->lock); diff --git a/src/security/builtin_plugins/tests/common/src/handshake_helper.c b/src/security/builtin_plugins/tests/common/src/handshake_helper.c index 4a424507b0..358068fca4 100644 --- a/src/security/builtin_plugins/tests/common/src/handshake_helper.c +++ b/src/security/builtin_plugins/tests/common/src/handshake_helper.c @@ -55,12 +55,12 @@ dh_set_public_key( /* for DEBUG purposes */ void print_binary_test( char* name, unsigned char *value, uint32_t size){ uint32_t i; - printf("%s: ",name ); + (void) printf("%s: ",name ); for( i=0; i< size; i++) { - printf("%x",value[i]); + (void) printf("%x",value[i]); } - printf("\n"); + (void) printf("\n"); } DDS_Security_BinaryProperty_t * @@ -298,21 +298,21 @@ modp_data_to_pubkey( if (!(asni = d2i_ASN1_INTEGER(NULL, &data, (long)size))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to decode DH public key: %s", msg); + (void) printf("Failed to decode DH public key: %s", msg); ddsrt_free(msg); goto fail_asni; } if (!(bn = ASN1_INTEGER_to_BN(asni, NULL))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to convert to BIGNU<: %s", msg); + (void) printf("Failed to convert to BIGNU<: %s", msg); ddsrt_free(msg); goto fail_bn; } if (!(dhkey = DH_get_2048_256())) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate dhkey: %s", msg); + (void) printf("Failed to allocate dhkey: %s", msg); ddsrt_free(msg); goto fail_dhkey; } @@ -321,14 +321,14 @@ modp_data_to_pubkey( if (!(pkey = EVP_PKEY_new())) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate pkey: %s", msg); + (void) printf("Failed to allocate pkey: %s", msg); ddsrt_free(msg); goto fail_pkey; } if (!EVP_PKEY_set1_DH(pkey, dhkey)) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to set public key: %s", msg); + (void) printf("Failed to set public key: %s", msg); ddsrt_free(msg); EVP_PKEY_free(pkey); pkey = NULL; @@ -361,35 +361,35 @@ ecdh_data_to_pubkey( if (!(group = EC_GROUP_new_by_curve_name(NID_X9_62_prime256v1))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate EC group: %s", msg); + (void) printf("Failed to allocate EC group: %s", msg); ddsrt_free(msg); } else if (!(point = EC_POINT_new(group))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate EC point: %s", msg); + (void) printf("Failed to allocate EC point: %s", msg); ddsrt_free(msg); } else if (EC_POINT_oct2point(group, point, data, size, NULL) != 1) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to deserialize EC public key to EC point: %s", msg); + (void) printf("Failed to deserialize EC public key to EC point: %s", msg); ddsrt_free(msg); } else if (!(eckey = EC_KEY_new())) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate EC KEY: %s", msg); + (void) printf("Failed to allocate EC KEY: %s", msg); ddsrt_free(msg); } else if (EC_KEY_set_group(eckey, group) != 1) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to convert octet sequence to ASN1 integer: %s", msg); + (void) printf("Failed to convert octet sequence to ASN1 integer: %s", msg); ddsrt_free(msg); } else if (EC_KEY_set_public_key(eckey, point) != 1) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to set EC public key: %s", msg); + (void) printf("Failed to set EC public key: %s", msg); ddsrt_free(msg); } else if (!(pkey = EVP_PKEY_new())) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate EVP key: %s", msg); + (void) printf("Failed to allocate EVP key: %s", msg); ddsrt_free(msg); } else if (EVP_PKEY_set1_EC_KEY(pkey, eckey) != 1) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to set EVP key to EC public key: %s", msg); + (void) printf("Failed to set EVP key to EC public key: %s", msg); ddsrt_free(msg); EVP_PKEY_free(pkey); pkey = NULL; @@ -450,8 +450,8 @@ check_shared_secret( { /* Error */ char *msg = get_openssl_error_message_for_test(); - printf("DH remote public: %s\n",dh_remote->value._buffer); - printf("SSL Error: %s\n", msg); + (void) printf("DH remote public: %s\n",dh_remote->value._buffer); + (void) printf("SSL Error: %s\n", msg); ddsrt_free(msg); CU_FAIL("Could not set peer"); } diff --git a/src/security/builtin_plugins/tests/common/src/loader.c b/src/security/builtin_plugins/tests/common/src/loader.c index 717b140929..a20d797de5 100644 --- a/src/security/builtin_plugins/tests/common/src/loader.c +++ b/src/security/builtin_plugins/tests/common/src/loader.c @@ -60,13 +60,13 @@ load_plugin( if( result != DDS_RETCODE_OK || info->func_init == NULL) { char buf[200]; ddsrt_dlerror(buf, 200); - printf("ERROR: could not init %s\n. Invalid init function: %s: %s", name_lib, name_init, buf); + (void) printf("ERROR: could not init %s\n. Invalid init function: %s: %s", name_lib, name_init, buf); return plugin; } result = ddsrt_dlsym(info->lib_handle, name_fini, (void **)&info->func_fini); if( result != DDS_RETCODE_OK || info->func_fini == NULL ) { - printf("ERROR: could not init %s\n. Invalid fini function: %s", name_lib, name_fini); + (void) printf("ERROR: could not init %s\n. Invalid fini function: %s", name_lib, name_fini); return plugin; } @@ -75,12 +75,12 @@ load_plugin( if (plugin) { info->context = plugin; } else { - printf("ERROR: could not init %s\n", name_lib); + (void) printf("ERROR: could not init %s\n", name_lib); } } else { char buffer[300]; ddsrt_dlerror(buffer,300); - printf("ERROR: could not load %s. %s\n", name_lib, buffer); + (void) printf("ERROR: could not load %s. %s\n", name_lib, buffer); } return plugin; } @@ -154,7 +154,7 @@ unload_plugin( } result = ddsrt_dlclose( info->lib_handle ); if ( result != 0 ){ - printf( "Error occurred while closing the library\n"); + (void) printf( "Error occurred while closing the library\n"); } } } diff --git a/src/security/builtin_plugins/tests/create_local_datareader_crypto_tokens/src/create_local_datareader_crypto_tokens_utests.c b/src/security/builtin_plugins/tests/create_local_datareader_crypto_tokens/src/create_local_datareader_crypto_tokens_utests.c index a1b7d051ef..20cd7182e2 100644 --- a/src/security/builtin_plugins/tests/create_local_datareader_crypto_tokens/src/create_local_datareader_crypto_tokens_utests.c +++ b/src/security/builtin_plugins/tests/create_local_datareader_crypto_tokens/src/create_local_datareader_crypto_tokens_utests.c @@ -113,7 +113,7 @@ static int register_local_participant(void) if (local_particpant_crypto == 0) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_particpant_crypto ? 0 : -1; @@ -135,7 +135,7 @@ static int register_remote_participant(void) if (remote_particpant_crypto == 0) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_particpant_crypto ? 0 : -1; @@ -161,7 +161,7 @@ static int register_local_datareader(void) if (local_reader_crypto == 0) { - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return local_reader_crypto ? 0 : -1; @@ -181,7 +181,7 @@ static int register_remote_datawriter(void) if (remote_writer_crypto == 0) { - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_writer_crypto ? 0 : -1; @@ -259,42 +259,42 @@ static bool check_key_material(DDS_Security_OctetSeq *data) { if (CRYPTO_TRANSFORM_KIND(key_mat.transformation_kind) == CRYPTO_TRANSFORMATION_KIND_AES256_GCM) { - printf("check_key_material: incorrect transformation_kind\n"); + (void) printf("check_key_material: incorrect transformation_kind\n"); status = false; } else if (CRYPTO_TRANSFORM_ID(key_mat.sender_key_id) == 0) { - printf("check_key_material: incorrect sender_key_id\n"); + (void) printf("check_key_material: incorrect sender_key_id\n"); status = false; } else if (key_mat.master_salt._length != DDS_SECURITY_MASTER_SALT_SIZE_256) { - printf("check_key_material: incorrect master_salt\n"); + (void) printf("check_key_material: incorrect master_salt\n"); status = false; } else if (!key_mat.master_salt._buffer) { - printf("check_key_material: incorrect master_salt\n"); + (void) printf("check_key_material: incorrect master_salt\n"); status = false; } else if (!data_not_empty(key_mat.master_salt._buffer, key_mat.master_salt._length)) { - printf("check_key_material: incorrect master_salt\n"); + (void) printf("check_key_material: incorrect master_salt\n"); status = false; } else if (key_mat.master_sender_key._length != DDS_SECURITY_MASTER_SENDER_KEY_SIZE_256) { - printf("check_key_material: incorrect master_sender_key\n"); + (void) printf("check_key_material: incorrect master_sender_key\n"); status = false; } else if (!key_mat.master_salt._buffer) { - printf("check_key_material: incorrect master_sender_key\n"); + (void) printf("check_key_material: incorrect master_sender_key\n"); status = false; } else if (!data_not_empty(key_mat.master_sender_key._buffer, key_mat.master_sender_key._length)) { - printf("check_key_material: incorrect master_sender_key\n"); + (void) printf("check_key_material: incorrect master_sender_key\n"); status = false; } } @@ -364,7 +364,7 @@ CU_Test(ddssec_builtin_create_local_datareader_crypto_tokens, happy_day, .init = if (!result) { - printf("create_local_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -379,7 +379,7 @@ CU_Test(ddssec_builtin_create_local_datareader_crypto_tokens, happy_day, .init = if (!result) { - printf("return_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -415,7 +415,7 @@ CU_Test(ddssec_builtin_create_local_datareader_crypto_tokens, invalid_args, .ini if (!result) { - printf("create_local_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -434,7 +434,7 @@ CU_Test(ddssec_builtin_create_local_datareader_crypto_tokens, invalid_args, .ini if (!result) { - printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -453,7 +453,7 @@ CU_Test(ddssec_builtin_create_local_datareader_crypto_tokens, invalid_args, .ini if (!result) { - printf("create_local_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -472,7 +472,7 @@ CU_Test(ddssec_builtin_create_local_datareader_crypto_tokens, invalid_args, .ini if (!result) { - printf("create_local_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -491,7 +491,7 @@ CU_Test(ddssec_builtin_create_local_datareader_crypto_tokens, invalid_args, .ini if (!result) { - printf("create_local_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); diff --git a/src/security/builtin_plugins/tests/create_local_datawriter_crypto_tokens/src/create_local_datawriter_crypto_tokens_utests.c b/src/security/builtin_plugins/tests/create_local_datawriter_crypto_tokens/src/create_local_datawriter_crypto_tokens_utests.c index a21d53f99c..871aca8770 100644 --- a/src/security/builtin_plugins/tests/create_local_datawriter_crypto_tokens/src/create_local_datawriter_crypto_tokens_utests.c +++ b/src/security/builtin_plugins/tests/create_local_datawriter_crypto_tokens/src/create_local_datawriter_crypto_tokens_utests.c @@ -105,7 +105,7 @@ static int register_local_participant(void) if (local_particpant_crypto == 0) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_particpant_crypto ? 0 : -1; @@ -127,7 +127,7 @@ static int register_remote_participant(void) if (remote_particpant_crypto == 0) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_particpant_crypto ? 0 : -1; @@ -163,7 +163,7 @@ static int register_local_datawriter(void) if (local_writer_crypto == 0) { - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return local_writer_crypto ? 0 : -1; @@ -184,7 +184,7 @@ static int register_remote_datareader(void) if (remote_reader_crypto == 0) { - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_reader_crypto ? 0 : -1; @@ -262,42 +262,42 @@ static bool check_key_material(DDS_Security_OctetSeq *data) { if (CRYPTO_TRANSFORM_KIND(key_mat.transformation_kind) == CRYPTO_TRANSFORMATION_KIND_AES256_GCM) { - printf("check_key_material: incorrect transformation_kind\n"); + (void) printf("check_key_material: incorrect transformation_kind\n"); status = false; } else if (CRYPTO_TRANSFORM_ID(key_mat.sender_key_id) == 0) { - printf("check_key_material: incorrect sender_key_id\n"); + (void) printf("check_key_material: incorrect sender_key_id\n"); status = false; } else if (key_mat.master_salt._length != DDS_SECURITY_MASTER_SALT_SIZE_256) { - printf("check_key_material: incorrect master_salt\n"); + (void) printf("check_key_material: incorrect master_salt\n"); status = false; } else if (!key_mat.master_salt._buffer) { - printf("check_key_material: incorrect master_salt\n"); + (void) printf("check_key_material: incorrect master_salt\n"); status = false; } else if (!data_not_empty(key_mat.master_salt._buffer, key_mat.master_salt._length)) { - printf("check_key_material: incorrect master_salt\n"); + (void) printf("check_key_material: incorrect master_salt\n"); status = false; } else if (key_mat.master_sender_key._length != DDS_SECURITY_MASTER_SENDER_KEY_SIZE_256) { - printf("check_key_material: incorrect master_sender_key\n"); + (void) printf("check_key_material: incorrect master_sender_key\n"); status = false; } else if (!key_mat.master_salt._buffer) { - printf("check_key_material: incorrect master_sender_key\n"); + (void) printf("check_key_material: incorrect master_sender_key\n"); status = false; } else if (!data_not_empty(key_mat.master_sender_key._buffer, key_mat.master_sender_key._length)) { - printf("check_key_material: incorrect master_sender_key\n"); + (void) printf("check_key_material: incorrect master_sender_key\n"); status = false; } } @@ -367,7 +367,7 @@ CU_Test(ddssec_builtin_create_local_datawriter_crypto_tokens, happy_day, .init = if (!result) { - printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -382,7 +382,7 @@ CU_Test(ddssec_builtin_create_local_datawriter_crypto_tokens, happy_day, .init = if (!result) { - printf("return_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -418,7 +418,7 @@ CU_Test(ddssec_builtin_create_local_datawriter_crypto_tokens, invalid_args, .ini if (!result) { - printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -437,7 +437,7 @@ CU_Test(ddssec_builtin_create_local_datawriter_crypto_tokens, invalid_args, .ini if (!result) { - printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -456,7 +456,7 @@ CU_Test(ddssec_builtin_create_local_datawriter_crypto_tokens, invalid_args, .ini if (!result) { - printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -475,7 +475,7 @@ CU_Test(ddssec_builtin_create_local_datawriter_crypto_tokens, invalid_args, .ini if (!result) { - printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -494,7 +494,7 @@ CU_Test(ddssec_builtin_create_local_datawriter_crypto_tokens, invalid_args, .ini if (!result) { - printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); diff --git a/src/security/builtin_plugins/tests/create_local_participant_crypto_tokens/src/create_local_participant_crypto_tokens_utests.c b/src/security/builtin_plugins/tests/create_local_participant_crypto_tokens/src/create_local_participant_crypto_tokens_utests.c index c30f60ab5a..e9dce97d2c 100644 --- a/src/security/builtin_plugins/tests/create_local_participant_crypto_tokens/src/create_local_participant_crypto_tokens_utests.c +++ b/src/security/builtin_plugins/tests/create_local_participant_crypto_tokens/src/create_local_participant_crypto_tokens_utests.c @@ -101,7 +101,7 @@ static int register_participants(void) if (local_crypto_handle == DDS_SECURITY_HANDLE_NIL) { r = -1; - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } if (r == 0) @@ -117,7 +117,7 @@ static int register_participants(void) if (remote_crypto_handle == DDS_SECURITY_HANDLE_NIL) { r = -1; - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } } @@ -134,7 +134,7 @@ static void unregister_participants(void) status = crypto->crypto_key_factory->unregister_participant(crypto->crypto_key_factory, local_crypto_handle, &exception); if (!status) { - printf("unregister_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("unregister_participant: %s\n", exception.message ? exception.message : "Error message missing"); } } @@ -143,7 +143,7 @@ static void unregister_participants(void) status = crypto->crypto_key_factory->unregister_participant(crypto->crypto_key_factory, remote_crypto_handle, &exception); if (!status) { - printf("unregister_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("unregister_participant: %s\n", exception.message ? exception.message : "Error message missing"); } } } @@ -227,7 +227,7 @@ CU_Test(ddssec_builtin_create_local_participant_crypto_tokens, happy_day, .init &exception); if (!result) { - printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -242,7 +242,7 @@ CU_Test(ddssec_builtin_create_local_participant_crypto_tokens, happy_day, .init if (!result) { - printf("return_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -280,7 +280,7 @@ CU_Test(ddssec_builtin_create_local_participant_crypto_tokens, invalid_args, .in &exception); if (!result) { - printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -298,7 +298,7 @@ CU_Test(ddssec_builtin_create_local_participant_crypto_tokens, invalid_args, .in &exception); if (!result) { - printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -316,7 +316,7 @@ CU_Test(ddssec_builtin_create_local_participant_crypto_tokens, invalid_args, .in &exception); if (!result) { - printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -334,7 +334,7 @@ CU_Test(ddssec_builtin_create_local_participant_crypto_tokens, invalid_args, .in &exception); if (!result) { - printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -352,7 +352,7 @@ CU_Test(ddssec_builtin_create_local_participant_crypto_tokens, invalid_args, .in &exception); if (!result) { - printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("create_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); diff --git a/src/security/builtin_plugins/tests/decode_datareader_submessage/src/decode_datareader_submessage_utests.c b/src/security/builtin_plugins/tests/decode_datareader_submessage/src/decode_datareader_submessage_utests.c index 5ef0f7a673..2c033402db 100644 --- a/src/security/builtin_plugins/tests/decode_datareader_submessage/src/decode_datareader_submessage_utests.c +++ b/src/security/builtin_plugins/tests/decode_datareader_submessage/src/decode_datareader_submessage_utests.c @@ -156,7 +156,7 @@ static int register_local_participant(void) if (local_participant_handle == DDS_SECURITY_HANDLE_NIL) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_participant_handle ? 0 : -1; @@ -189,7 +189,7 @@ static int register_remote_participant(void) if (remote_participant_handle == DDS_SECURITY_HANDLE_NIL) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_participant_handle ? 0 : -1; @@ -275,7 +275,7 @@ static DDS_Security_DatawriterCryptoHandle register_local_datawriter(DDS_Securit if (writer_crypto == 0) { - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return writer_crypto; @@ -296,7 +296,7 @@ static DDS_Security_DatawriterCryptoHandle register_remote_datawriter(DDS_Securi if (writer_crypto == 0) { - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return writer_crypto; @@ -327,7 +327,7 @@ static DDS_Security_DatareaderCryptoHandle register_local_datareader(DDS_Securit if (reader_crypto == 0) { - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return reader_crypto; @@ -352,7 +352,7 @@ static DDS_Security_DatareaderCryptoHandle register_remote_datareader(DDS_Securi if (reader_crypto == 0) { - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return reader_crypto; @@ -558,7 +558,7 @@ static void decode_datareader_submessage_not_signed( if (!result) { - printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -578,14 +578,14 @@ static void decode_datareader_submessage_not_signed( if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(exception.code == 0); CU_ASSERT(exception.message == NULL); if (exception.message) { - printf("Decoding failed: %s\n", exception.message); + (void) printf("Decoding failed: %s\n", exception.message); } CU_ASSERT_FATAL(result); CU_ASSERT_FATAL(decoded_buffer._length == plain_buffer._length); @@ -711,7 +711,7 @@ static void decode_datareader_submessage_signed( if (!result) { - printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -733,7 +733,7 @@ static void decode_datareader_submessage_signed( if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -856,7 +856,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_args, .init = suite if (!result) { - printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -876,7 +876,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_args, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -896,7 +896,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_args, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -916,7 +916,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_args, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -936,7 +936,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_args, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1024,7 +1024,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -1054,7 +1054,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1087,7 +1087,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1120,7 +1120,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1153,7 +1153,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1186,7 +1186,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1219,7 +1219,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1252,7 +1252,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1284,7 +1284,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1316,7 +1316,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1348,7 +1348,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1382,7 +1382,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1414,7 +1414,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1449,7 +1449,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1487,7 +1487,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1525,7 +1525,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1651,7 +1651,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, volatile_sec, .init = suite if (!result) { - printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -1671,7 +1671,7 @@ CU_Test(ddssec_builtin_decode_datareader_submessage, volatile_sec, .init = suite if (!result) { - printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); diff --git a/src/security/builtin_plugins/tests/decode_datawriter_submessage/src/decode_datawriter_submessage_utests.c b/src/security/builtin_plugins/tests/decode_datawriter_submessage/src/decode_datawriter_submessage_utests.c index 437579a927..2fec72b950 100644 --- a/src/security/builtin_plugins/tests/decode_datawriter_submessage/src/decode_datawriter_submessage_utests.c +++ b/src/security/builtin_plugins/tests/decode_datawriter_submessage/src/decode_datawriter_submessage_utests.c @@ -134,7 +134,7 @@ static int register_local_participant(void) if (local_participant_handle == DDS_SECURITY_HANDLE_NIL) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_participant_handle ? 0 : -1; @@ -220,7 +220,7 @@ static int register_remote_participant(void) if (remote_participant_handle == DDS_SECURITY_HANDLE_NIL) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_participant_handle ? 0 : -1; @@ -251,7 +251,7 @@ static DDS_Security_DatawriterCryptoHandle register_local_datawriter(DDS_Securit if (writer_crypto == 0) { - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return writer_crypto; @@ -272,7 +272,7 @@ static DDS_Security_DatawriterCryptoHandle register_remote_datawriter(DDS_Securi if (writer_crypto == 0) { - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return writer_crypto; @@ -303,7 +303,7 @@ static DDS_Security_DatareaderCryptoHandle register_local_datareader(DDS_Securit if (reader_crypto == 0) { - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return reader_crypto; @@ -328,7 +328,7 @@ static DDS_Security_DatareaderCryptoHandle register_remote_datareader(DDS_Securi if (reader_crypto == 0) { - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return reader_crypto; @@ -550,7 +550,7 @@ static void decode_datawriter_submessage_not_signed(DDS_Security_CryptoTransform if (!result) { - printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -570,7 +570,7 @@ static void decode_datawriter_submessage_not_signed(DDS_Security_CryptoTransform if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -707,7 +707,7 @@ static void decode_datawriter_submessage_signed(DDS_Security_CryptoTransformKind if (!result) { - printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -732,7 +732,7 @@ static void decode_datawriter_submessage_signed(DDS_Security_CryptoTransformKind if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -858,7 +858,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_args, .init = suite if (!result) { - printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -878,7 +878,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_args, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -898,7 +898,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_args, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -918,7 +918,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_args, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -938,7 +938,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_args, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1029,7 +1029,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -1059,7 +1059,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1092,7 +1092,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1125,7 +1125,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1158,7 +1158,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1191,7 +1191,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1224,7 +1224,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1257,7 +1257,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1289,7 +1289,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1321,7 +1321,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1353,7 +1353,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1387,7 +1387,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1419,7 +1419,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1454,7 +1454,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1492,7 +1492,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1530,7 +1530,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, invalid_data, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1659,7 +1659,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, volatile_sec, .init = suite if (!result) { - printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -1679,7 +1679,7 @@ CU_Test(ddssec_builtin_decode_datawriter_submessage, volatile_sec, .init = suite if (!result) { - printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); diff --git a/src/security/builtin_plugins/tests/decode_rtps_message/src/decode_rtps_message_utests.c b/src/security/builtin_plugins/tests/decode_rtps_message/src/decode_rtps_message_utests.c index 38045b61ac..725568b24c 100644 --- a/src/security/builtin_plugins/tests/decode_rtps_message/src/decode_rtps_message_utests.c +++ b/src/security/builtin_plugins/tests/decode_rtps_message/src/decode_rtps_message_utests.c @@ -120,12 +120,12 @@ static void deallocate_shared_secret(void) static void print_octets(const char *msg, const unsigned char *data, size_t sz) { size_t i; - printf("%s: ", msg); + (void) printf("%s: ", msg); for (i = 0; i < sz; i++) { - printf("%02x", data[i]); + (void) printf("%02x", data[i]); } - printf("\n"); + (void) printf("\n"); } static void prepare_participant_security_attributes_and_properties(DDS_Security_ParticipantSecurityAttributes *attributes, @@ -200,7 +200,7 @@ static int register_local_participants(DDS_Security_ParticipantSecurityAttribute if (local_participantA_crypto == 0) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } local_participantB_crypto = @@ -214,7 +214,7 @@ static int register_local_participants(DDS_Security_ParticipantSecurityAttribute if (local_participantA_crypto == 0 || local_participantB_crypto == 0) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_participantA_crypto && local_participantB_crypto ? 0 : -1; @@ -258,7 +258,7 @@ static int register_remote_participants(DDS_Security_ParticipantCryptoHandle loc if (participant_cryptos[i] == 0) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); result = 1; break; } @@ -297,7 +297,7 @@ static int register_remote_participant_for_participantB( if (*remote_participant_crypto == 0) { - printf("register_matched_remote_participant: %s\n", + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); result = 1; } @@ -552,7 +552,7 @@ static void decode_rtps_message_not_authenticated(DDS_Security_CryptoTransformKi if (!result) { - printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -572,7 +572,7 @@ static void decode_rtps_message_not_authenticated(DDS_Security_CryptoTransformKi if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -683,7 +683,7 @@ static void decode_rtps_message_authenticated(DDS_Security_CryptoTransformKind_E if (!result) { - printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -708,7 +708,7 @@ static void decode_rtps_message_authenticated(DDS_Security_CryptoTransformKind_E if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -804,7 +804,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_args, .init = suite_decode_r if (!result) { - printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -824,7 +824,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_args, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -844,7 +844,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_args, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -864,7 +864,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_args, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -884,7 +884,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_args, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -961,7 +961,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -991,7 +991,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1024,7 +1024,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1057,7 +1057,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1090,7 +1090,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1123,7 +1123,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1156,7 +1156,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1189,7 +1189,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1221,7 +1221,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1253,7 +1253,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1285,7 +1285,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1319,7 +1319,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1351,7 +1351,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1386,7 +1386,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1424,7 +1424,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r &exception); if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1461,7 +1461,7 @@ CU_Test(ddssec_builtin_decode_rtps_message, invalid_data, .init = suite_decode_r &exception); if (!result) { - printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); diff --git a/src/security/builtin_plugins/tests/decode_serialized_payload/src/decode_serialized_payload_utests.c b/src/security/builtin_plugins/tests/decode_serialized_payload/src/decode_serialized_payload_utests.c index ccc4d49bb6..ff14a9dd9c 100644 --- a/src/security/builtin_plugins/tests/decode_serialized_payload/src/decode_serialized_payload_utests.c +++ b/src/security/builtin_plugins/tests/decode_serialized_payload/src/decode_serialized_payload_utests.c @@ -131,7 +131,7 @@ static int register_local_participant(void) if (local_participant_handle == DDS_SECURITY_HANDLE_NIL) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_participant_handle ? 0 : -1; @@ -163,7 +163,7 @@ static int register_remote_participant(void) if (remote_participant_handle == DDS_SECURITY_HANDLE_NIL) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_participant_handle ? 0 : -1; @@ -214,7 +214,7 @@ static DDS_Security_DatawriterCryptoHandle register_local_datawriter(bool encryp if (writer_crypto == 0) { - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } assert (writer_crypto != 0); @@ -236,7 +236,7 @@ static DDS_Security_DatawriterCryptoHandle register_remote_datawriter(DDS_Securi if (writer_crypto == 0) { - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } assert (writer_crypto != 0); @@ -278,7 +278,7 @@ static DDS_Security_DatareaderCryptoHandle register_local_datareader(bool encryp if (reader_crypto == 0) { - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return reader_crypto; @@ -303,7 +303,7 @@ static DDS_Security_DatareaderCryptoHandle register_remote_datareader(DDS_Securi if (reader_crypto == 0) { - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return reader_crypto; @@ -495,7 +495,7 @@ static void decode_serialized_payload_check(uint32_t key_size, bool encrypted) if (!result) { - printf("encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -516,7 +516,7 @@ static void decode_serialized_payload_check(uint32_t key_size, bool encrypted) if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -616,7 +616,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_args, .init = suite_de if (!result) { - printf("encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -637,7 +637,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_args, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -658,7 +658,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_args, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -679,7 +679,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_args, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -700,7 +700,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_args, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -780,7 +780,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_data, .init = suite_de if (!result) { - printf("encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -809,7 +809,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_data, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -840,7 +840,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_data, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -871,7 +871,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_data, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -909,7 +909,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_data, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -947,7 +947,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_data, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -980,7 +980,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_data, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1016,7 +1016,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_data, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1043,7 +1043,7 @@ CU_Test(ddssec_builtin_decode_serialized_payload, invalid_data, .init = suite_de if (!result) { - printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("decode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); diff --git a/src/security/builtin_plugins/tests/encode_datareader_submessage/src/encode_datareader_submessage_utests.c b/src/security/builtin_plugins/tests/encode_datareader_submessage/src/encode_datareader_submessage_utests.c index 715d8d4b67..6611de7b07 100644 --- a/src/security/builtin_plugins/tests/encode_datareader_submessage/src/encode_datareader_submessage_utests.c +++ b/src/security/builtin_plugins/tests/encode_datareader_submessage/src/encode_datareader_submessage_utests.c @@ -167,7 +167,7 @@ static int register_local_participant(void) if (local_participant_handle == DDS_SECURITY_HANDLE_NIL) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_participant_handle ? 0 : -1; @@ -199,7 +199,7 @@ static int register_remote_participant(void) if (remote_participant_handle == DDS_SECURITY_HANDLE_NIL) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_participant_handle ? 0 : -1; @@ -230,7 +230,7 @@ static DDS_Security_DatareaderCryptoHandle register_local_datareader(DDS_Securit if (reader_crypto == 0) { - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return reader_crypto; @@ -261,7 +261,7 @@ static DDS_Security_DatawriterCryptoHandle register_remote_datawriter(DDS_Securi if (writer_crypto == 0) { - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return writer_crypto; @@ -285,7 +285,7 @@ static bool read_prefix(unsigned char **ptr, uint32_t *remain) if (*remain < sizeof(struct submsg_header)) { - printf("check_encoded_data: prefix missing\n"); + (void) printf("check_encoded_data: prefix missing\n"); return false; } @@ -293,7 +293,7 @@ static bool read_prefix(unsigned char **ptr, uint32_t *remain) if (prefix->id != SMID_SEC_PREFIX) { - printf("check_encoded_data: prefix incorrect smid 0x%x02\n", prefix->id); + (void) printf("check_encoded_data: prefix incorrect smid 0x%x02\n", prefix->id); return false; } @@ -308,7 +308,7 @@ static bool read_prefix(unsigned char **ptr, uint32_t *remain) if (hlen != sizeof(struct crypto_header)) { - printf("check_encoded_data: crypto_header missing\n"); + (void) printf("check_encoded_data: crypto_header missing\n"); return false; } @@ -322,7 +322,7 @@ static bool read_header(struct crypto_header **header, unsigned char **ptr, uint { if (*remain < sizeof(struct crypto_header)) { - printf("check_encoded_data: crypto_header too short\n"); + (void) printf("check_encoded_data: crypto_header too short\n"); return false; } @@ -362,7 +362,7 @@ static bool read_body(DDS_Security_OctetSeq *contents, bool encrypted, unsigned if (body->id != SMID_SEC_BODY) { - printf("check_encoded_data: submessage SEC_BODY missing\n"); + (void) printf("check_encoded_data: submessage SEC_BODY missing\n"); return false; } enc = (struct encrypted_data *)(body + 1); @@ -375,7 +375,7 @@ static bool read_body(DDS_Security_OctetSeq *contents, bool encrypted, unsigned { if (body->id == SMID_SEC_BODY) { - printf("check_encoded_data: submessage SEC_BODY not expected\n"); + (void) printf("check_encoded_data: submessage SEC_BODY not expected\n"); return false; } clen = swap ? ddsrt_bswap2u(body->length) : body->length; @@ -396,7 +396,7 @@ static bool read_postfix(unsigned char **ptr, uint32_t *remain) if (*remain < sizeof(struct submsg_header)) { - printf("check_encoded_data: postfix missing\n"); + (void) printf("check_encoded_data: postfix missing\n"); return false; } @@ -404,7 +404,7 @@ static bool read_postfix(unsigned char **ptr, uint32_t *remain) if (postfix->id != SMID_SEC_POSTFIX) { - printf("check_encoded_data: postfix invalid smid\n"); + (void) printf("check_encoded_data: postfix invalid smid\n"); return false; } @@ -418,7 +418,7 @@ static bool read_footer(struct crypto_footer **footer, unsigned char **ptr, uint { if (*remain < CRYPTO_HMAC_SIZE + sizeof(uint32_t)) { - printf("check_encoded_data: crypto_footer incorrect size\n"); + (void) printf("check_encoded_data: crypto_footer incorrect size\n"); return false; } @@ -724,12 +724,12 @@ static bool check_writer_sign(DDS_Security_DatareaderCryptoHandle writer_crypto, keymat = get_datawriter_key_material(writer_crypto); if (key_id != keymat->receiver_specific_key_id) { - printf("check_writer_sign: key_id does not match\n"); + (void) printf("check_writer_sign: key_id does not match\n"); return false; } else if (!calculate_receiver_specific_key_test(&key, session_id, keymat->master_salt, keymat->master_receiver_specific_key, keymat->transformation_kind)) { - printf("check_writer_sign: calculate key failed\n"); + (void) printf("check_writer_sign: calculate key failed\n"); return false; } else if (!cipher_sign_data(key.data, key_size, init_vector, common_mac, CRYPTO_HMAC_SIZE, md)) @@ -738,7 +738,7 @@ static bool check_writer_sign(DDS_Security_DatareaderCryptoHandle writer_crypto, } else if (memcmp(hmac, md, CRYPTO_HMAC_SIZE) != 0) { - printf("check_writer_sign: hmac incorrect\n"); + (void) printf("check_writer_sign: hmac incorrect\n"); return false; } @@ -847,7 +847,7 @@ static void encode_datareader_submessage_not_signed(uint32_t transformation_kind if (!result) { - printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -876,7 +876,7 @@ static void encode_datareader_submessage_not_signed(uint32_t transformation_kind if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); @@ -891,7 +891,7 @@ static void encode_datareader_submessage_not_signed(uint32_t transformation_kind session_keys->master_key_material, &data, NULL, footer->common_mac); if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); @@ -1005,7 +1005,7 @@ static void encode_datareader_submessage_sign(uint32_t transformation_kind) if (!result) { - printf("writer_crypto: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("writer_crypto: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -1034,7 +1034,7 @@ static void encode_datareader_submessage_sign(uint32_t transformation_kind) session_keys->master_key_material, &data, &decoded_buffer, footer->common_mac); if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); @@ -1050,14 +1050,14 @@ static void encode_datareader_submessage_sign(uint32_t transformation_kind) if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); CU_ASSERT(memcmp(plain_buffer._buffer, data._buffer, plain_buffer._length) == 0); } - printf("num hmacs = %u\n", footer->length); + (void) printf("num hmacs = %u\n", footer->length); CU_ASSERT(check_writer_signing(&writer_list, footer, session_id, header->session_id, session_keys->key_size)); @@ -1146,7 +1146,7 @@ CU_Test(ddssec_builtin_encode_datareader_submessage, invalid_args, .init = suite if (!result) { - printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1166,7 +1166,7 @@ CU_Test(ddssec_builtin_encode_datareader_submessage, invalid_args, .init = suite if (!result) { - printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1187,7 +1187,7 @@ CU_Test(ddssec_builtin_encode_datareader_submessage, invalid_args, .init = suite if (!result) { - printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1208,7 +1208,7 @@ CU_Test(ddssec_builtin_encode_datareader_submessage, invalid_args, .init = suite if (!result) { - printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datareader_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } unregister_datawriter(writer_list._buffer[0]); diff --git a/src/security/builtin_plugins/tests/encode_datawriter_submessage/src/encode_datawriter_submessage_utests.c b/src/security/builtin_plugins/tests/encode_datawriter_submessage/src/encode_datawriter_submessage_utests.c index 0c9c448e84..3cb4485af2 100644 --- a/src/security/builtin_plugins/tests/encode_datawriter_submessage/src/encode_datawriter_submessage_utests.c +++ b/src/security/builtin_plugins/tests/encode_datawriter_submessage/src/encode_datawriter_submessage_utests.c @@ -141,7 +141,7 @@ static int register_local_participant(void) if (local_particpant_crypto == 0) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_particpant_crypto ? 0 : -1; @@ -173,7 +173,7 @@ static int register_remote_participant(void) if (remote_particpant_crypto == 0) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_particpant_crypto ? 0 : -1; @@ -254,7 +254,7 @@ static DDS_Security_DatawriterCryptoHandle register_local_datawriter(DDS_Securit if (writer_crypto == 0) { - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return writer_crypto; @@ -289,7 +289,7 @@ static DDS_Security_DatareaderCryptoHandle register_remote_datareader(DDS_Securi if (reader_crypto == 0) { - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return reader_crypto; @@ -313,7 +313,7 @@ static bool read_prefix(unsigned char **ptr, uint32_t *remain) if (*remain < sizeof(struct submsg_header)) { - printf("check_encoded_data: prefix missing\n"); + (void) printf("check_encoded_data: prefix missing\n"); return false; } @@ -321,7 +321,7 @@ static bool read_prefix(unsigned char **ptr, uint32_t *remain) if (prefix->id != SMID_SEC_PREFIX) { - printf("check_encoded_data: prefix incorrect smid 0x%x02\n", prefix->id); + (void) printf("check_encoded_data: prefix incorrect smid 0x%x02\n", prefix->id); return false; } @@ -336,7 +336,7 @@ static bool read_prefix(unsigned char **ptr, uint32_t *remain) if (hlen != sizeof(struct crypto_header)) { - printf("check_encoded_data: crypto_header missing\n"); + (void) printf("check_encoded_data: crypto_header missing\n"); return false; } @@ -350,7 +350,7 @@ static bool read_header(struct crypto_header **header, unsigned char **ptr, uint { if (*remain < sizeof(struct crypto_header)) { - printf("check_encoded_data: crypto_header too short\n"); + (void) printf("check_encoded_data: crypto_header too short\n"); return false; } @@ -391,7 +391,7 @@ static bool read_body(DDS_Security_OctetSeq *contents, bool encrypted, unsigned if (body->id != SMID_SEC_BODY) { - printf("check_encoded_data: submessage SEC_BODY missing\n"); + (void) printf("check_encoded_data: submessage SEC_BODY missing\n"); return false; } enc = (struct encrypted_data *)(body + 1); @@ -404,7 +404,7 @@ static bool read_body(DDS_Security_OctetSeq *contents, bool encrypted, unsigned { if (body->id == SMID_SEC_BODY) { - printf("check_encoded_data: submessage SEC_BODY not expected\n"); + (void) printf("check_encoded_data: submessage SEC_BODY not expected\n"); return false; } clen = swap ? ddsrt_bswap2u(body->length) : body->length; @@ -425,7 +425,7 @@ static bool read_postfix(unsigned char **ptr,uint32_t *remain) if (*remain < sizeof(struct submsg_header)) { - printf("check_encoded_data: postfix missing\n"); + (void) printf("check_encoded_data: postfix missing\n"); return false; } @@ -433,7 +433,7 @@ static bool read_postfix(unsigned char **ptr,uint32_t *remain) if (postfix->id != SMID_SEC_POSTFIX) { - printf("check_encoded_data: postfix invalid smid\n"); + (void) printf("check_encoded_data: postfix invalid smid\n"); return false; } @@ -447,7 +447,7 @@ static bool read_footer(struct crypto_footer **footer, unsigned char **ptr, uint { if (*remain < CRYPTO_HMAC_SIZE + sizeof(uint32_t)) { - printf("check_encoded_data: crypto_footer incorrect size\n"); + (void) printf("check_encoded_data: crypto_footer incorrect size\n"); return false; } @@ -690,12 +690,12 @@ static bool check_reader_sign( if (key_id != keymat->receiver_specific_key_id) { - printf("check_reader_sign: key_id does not match\n"); + (void) printf("check_reader_sign: key_id does not match\n"); return false; } else if (!calculate_receiver_specific_key_test(&key, session_id, keymat->master_salt, keymat->master_receiver_specific_key, keymat->transformation_kind)) { - printf("check_reader_sign: calculate key failed\n"); + (void) printf("check_reader_sign: calculate key failed\n"); return false; } else if (!cipher_sign_data(key.data, key_size, init_vector, common_mac, CRYPTO_HMAC_SIZE, md)) @@ -704,7 +704,7 @@ static bool check_reader_sign( } else if (memcmp(hmac, md, CRYPTO_HMAC_SIZE) != 0) { - printf("check_reader_sign: hmac incorrect\n"); + (void) printf("check_reader_sign: hmac incorrect\n"); return false; } @@ -824,7 +824,7 @@ static void encode_datawriter_submessage_not_signed(DDS_Security_CryptoTransform if (!result) { - printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -854,7 +854,7 @@ static void encode_datawriter_submessage_not_signed(DDS_Security_CryptoTransform if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); @@ -869,7 +869,7 @@ static void encode_datawriter_submessage_not_signed(DDS_Security_CryptoTransform session_keys->master_key_material, &data, NULL, footer->common_mac); if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); @@ -989,7 +989,7 @@ static void encode_datawriter_submessage_sign(DDS_Security_CryptoTransformKind_E if (!result) { - printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -1019,7 +1019,7 @@ static void encode_datawriter_submessage_sign(DDS_Security_CryptoTransformKind_E session_keys->master_key_material, &data, &decoded_buffer, footer->common_mac); if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); @@ -1035,14 +1035,14 @@ static void encode_datawriter_submessage_sign(DDS_Security_CryptoTransformKind_E if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); CU_ASSERT(memcmp(plain_buffer._buffer, data._buffer, plain_buffer._length) == 0); } - printf("num hmacs = %u\n", footer->length); + (void) printf("num hmacs = %u\n", footer->length); CU_ASSERT(check_reader_signing(&reader_list, footer, session_id, header->session_id, session_keys->key_size)); @@ -1136,7 +1136,7 @@ CU_Test(ddssec_builtin_encode_datawriter_submessage, invalid_args, .init = suite if (!result) { - printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1158,7 +1158,7 @@ CU_Test(ddssec_builtin_encode_datawriter_submessage, invalid_args, .init = suite if (!result) { - printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1180,7 +1180,7 @@ CU_Test(ddssec_builtin_encode_datawriter_submessage, invalid_args, .init = suite if (!result) { - printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_datawriter_submessage: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); diff --git a/src/security/builtin_plugins/tests/encode_rtps_message/src/encode_rtps_message_utests.c b/src/security/builtin_plugins/tests/encode_rtps_message/src/encode_rtps_message_utests.c index 8d8196e97e..a18d9dda94 100644 --- a/src/security/builtin_plugins/tests/encode_rtps_message/src/encode_rtps_message_utests.c +++ b/src/security/builtin_plugins/tests/encode_rtps_message/src/encode_rtps_message_utests.c @@ -119,12 +119,12 @@ static void deallocate_shared_secret(void) static void print_octets(const char *msg, const unsigned char *data, uint32_t sz) { uint32_t i; - printf("%s: ", msg); + (void) printf("%s: ", msg); for (i = 0; i < sz; i++) { - printf("%02x", data[i]); + (void) printf("%02x", data[i]); } - printf("\n"); + (void) printf("\n"); } static int register_local_participant(DDS_Security_ParticipantSecurityAttributes *participant_security_attributes, DDS_Security_PropertySeq *participant_properties) @@ -143,7 +143,7 @@ static int register_local_participant(DDS_Security_ParticipantSecurityAttributes if (local_particpant_crypto == 0) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_particpant_crypto ? 0 : -1; @@ -180,7 +180,7 @@ static int register_remote_participants(void) if (remote_particpant_cryptos[i] == 0) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); result = 1; break; } @@ -216,20 +216,20 @@ static bool check_encoded_data(DDS_Security_OctetSeq *data, bool encrypted, stru if (remain < 20) { - printf("check_encoded_data: RTPS header missing\n"); + (void) printf("check_encoded_data: RTPS header missing\n"); goto fail_prefix; } /* rtps header first */ if (memcmp(ptr, RTPS_HEADER, strlen(RTPS_HEADER)) != 0) { - printf("check_encoded_data: RTPS header invalid\n"); + (void) printf("check_encoded_data: RTPS header invalid\n"); goto fail_prefix; } if (remain < sizeof(struct submsg_header)) { - printf("check_encoded_data: prefix missing\n"); + (void) printf("check_encoded_data: prefix missing\n"); goto fail_prefix; } @@ -240,7 +240,7 @@ static bool check_encoded_data(DDS_Security_OctetSeq *data, bool encrypted, stru if (prefix->id != SMID_SRTPS_PREFIX) { - printf("check_encoded_data: prefix incorrect smid 0x%x02\n", prefix->id); + (void) printf("check_encoded_data: prefix incorrect smid 0x%x02\n", prefix->id); goto fail_prefix; } @@ -255,7 +255,7 @@ static bool check_encoded_data(DDS_Security_OctetSeq *data, bool encrypted, stru if (hlen != sizeof(struct crypto_header)) { - printf("check_encoded_data: crypto_header missing\n"); + (void) printf("check_encoded_data: crypto_header missing\n"); goto fail_prefix; } @@ -264,7 +264,7 @@ static bool check_encoded_data(DDS_Security_OctetSeq *data, bool encrypted, stru if (remain < sizeof(struct crypto_header)) { - printf("check_encoded_data: crypto_header too short\n"); + (void) printf("check_encoded_data: crypto_header too short\n"); goto fail_prefix; } @@ -284,7 +284,7 @@ static bool check_encoded_data(DDS_Security_OctetSeq *data, bool encrypted, stru body = (struct submsg_header *)ptr; if (body->id != SMID_SEC_BODY) { - printf("check_encoded_data: submessage SEC_BODY missing\n"); + (void) printf("check_encoded_data: submessage SEC_BODY missing\n"); goto fail_body; } ptr += sizeof(struct submsg_header); @@ -295,7 +295,7 @@ static bool check_encoded_data(DDS_Security_OctetSeq *data, bool encrypted, stru clen = swap ? ddsrt_bswap2u(body->length) : body->length; if (dlen > clen) { - printf("check_encoded_data: encrypted body length incorrect\n"); + (void) printf("check_encoded_data: encrypted body length incorrect\n"); goto fail_body; } @@ -312,7 +312,7 @@ static bool check_encoded_data(DDS_Security_OctetSeq *data, bool encrypted, stru body = (struct submsg_header *)(ptr + 24); /* header after info_src */ if (body->id == SMID_SEC_BODY) { - printf("check_encoded_data: submessage SEC_BODY not expected\n"); + (void) printf("check_encoded_data: submessage SEC_BODY not expected\n"); goto fail_body; } clen = swap ? ddsrt_bswap2u(body->length) : body->length; @@ -326,7 +326,7 @@ static bool check_encoded_data(DDS_Security_OctetSeq *data, bool encrypted, stru if (clen > remain) { - printf("check_encoded_data: payload invalid size\n"); + (void) printf("check_encoded_data: payload invalid size\n"); goto fail_body; } @@ -334,7 +334,7 @@ static bool check_encoded_data(DDS_Security_OctetSeq *data, bool encrypted, stru if (remain < sizeof(struct submsg_header)) { - printf("check_encoded_data: postfix missing\n"); + (void) printf("check_encoded_data: postfix missing\n"); goto fail_postfix; } @@ -342,7 +342,7 @@ static bool check_encoded_data(DDS_Security_OctetSeq *data, bool encrypted, stru if (postfix->id != SMID_SRTPS_POSTFIX) { - printf("check_encoded_data: postfix invalid smid\n"); + (void) printf("check_encoded_data: postfix invalid smid\n"); goto fail_postfix; } @@ -351,7 +351,7 @@ static bool check_encoded_data(DDS_Security_OctetSeq *data, bool encrypted, stru if (remain < CRYPTO_HMAC_SIZE + sizeof(uint32_t)) { - printf("check_encoded_data: crypto_footer incorrect size\n"); + (void) printf("check_encoded_data: crypto_footer incorrect size\n"); goto fail_postfix; } @@ -471,7 +471,7 @@ crypto_decrypt_data( if (!crypto_calculate_session_key_test(&session_key, session_id, key_material->master_salt, key_material->master_sender_key, key_material->transformation_kind)) return false; - printf("SessionId: %08x\n", session_id); + (void) printf("SessionId: %08x\n", session_id); print_octets("SessionKey", (const unsigned char *)session_key.data, key_size >> 3); /* create the cipher context */ @@ -643,12 +643,12 @@ static bool check_sign(DDS_Security_ParticipantCryptoHandle participant_crypto, keymat = get_remote_participant_key_material(participant_crypto); if (key_id != keymat->receiver_specific_key_id) { - printf("check_sign: key_id(%d) does not match key_mat(%d)\n", (int)key_id, (int)keymat->receiver_specific_key_id); + (void) printf("check_sign: key_id(%d) does not match key_mat(%d)\n", (int)key_id, (int)keymat->receiver_specific_key_id); return false; } else if (!calculate_receiver_specific_key_test(&key, session_id, keymat->master_salt, keymat->master_receiver_specific_key, keymat->transformation_kind)) { - printf("check_sign: calculate key failed\n"); + (void) printf("check_sign: calculate key failed\n"); return false; } else if (!cipher_sign_data(key.data, key_size, init_vector, common_mac, CRYPTO_HMAC_SIZE, md)) @@ -657,7 +657,7 @@ static bool check_sign(DDS_Security_ParticipantCryptoHandle participant_crypto, } else if (memcmp(hmac, md, CRYPTO_HMAC_SIZE) != 0) { - printf("check_sign: hmac incorrect\n"); + (void) printf("check_sign: hmac incorrect\n"); //print_octets("Reader Specific Key:", key, CRYPTO_KEY_SIZE); //print_octets("Common:", common_mac, CRYPTO_HMAC_SIZE); @@ -823,7 +823,7 @@ static void encode_rtps_message_not_authenticated(DDS_Security_CryptoTransformKi if (!result) { - printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -852,7 +852,7 @@ static void encode_rtps_message_not_authenticated(DDS_Security_CryptoTransformKi if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); @@ -870,7 +870,7 @@ static void encode_rtps_message_not_authenticated(DDS_Security_CryptoTransformKi session_keys->master_key_material, &data, NULL, footer->common_mac); if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); @@ -975,7 +975,7 @@ static void encode_rtps_message_sign(DDS_Security_CryptoTransformKind_Enum trans if (!result) { - printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); @@ -1004,7 +1004,7 @@ static void encode_rtps_message_sign(DDS_Security_CryptoTransformKind_Enum trans session_keys->master_key_material, &data, &decoded_buffer, footer->common_mac); if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); @@ -1021,14 +1021,14 @@ static void encode_rtps_message_sign(DDS_Security_CryptoTransformKind_Enum trans if (!result) { - printf("Decode failed\n"); + (void) printf("Decode failed\n"); } CU_ASSERT_FATAL(result); CU_ASSERT(memcmp(plain_buffer._buffer + 4, data._buffer + 8, plain_buffer._length - 4) == 0); } - printf("num hmacs = %u\n", footer->length); + (void) printf("num hmacs = %u\n", footer->length); CU_ASSERT(check_signing(&reader_list, footer, session_id, header->session_id, session_keys->key_size)); @@ -1119,7 +1119,7 @@ CU_Test(ddssec_builtin_encode_rtps_message, invalid_args, .init = suite_encode_r if (!result) { - printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1140,7 +1140,7 @@ CU_Test(ddssec_builtin_encode_rtps_message, invalid_args, .init = suite_encode_r if (!result) { - printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1162,7 +1162,7 @@ CU_Test(ddssec_builtin_encode_rtps_message, invalid_args, .init = suite_encode_r if (!result) { - printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -1184,7 +1184,7 @@ CU_Test(ddssec_builtin_encode_rtps_message, invalid_args, .init = suite_encode_r if (!result) { - printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_rtps_message: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); diff --git a/src/security/builtin_plugins/tests/encode_serialized_payload/src/encode_serialized_payload_utests.c b/src/security/builtin_plugins/tests/encode_serialized_payload/src/encode_serialized_payload_utests.c index 01a0f7a242..3ca3aa0d52 100644 --- a/src/security/builtin_plugins/tests/encode_serialized_payload/src/encode_serialized_payload_utests.c +++ b/src/security/builtin_plugins/tests/encode_serialized_payload/src/encode_serialized_payload_utests.c @@ -132,7 +132,7 @@ static int register_local_participant(void) if (g_local_participant_crypto == 0) { - printf("[ERROR] register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("[ERROR] register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return g_local_participant_crypto ? 0 : -1; @@ -164,7 +164,7 @@ static int register_remote_participant(void) if (g_remote_participant_crypto == 0) { - printf("[ERROR] register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("[ERROR] register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return g_remote_participant_crypto ? 0 : -1; @@ -205,7 +205,7 @@ static DDS_Security_DatawriterCryptoHandle register_local_datawriter(bool encryp if (writer_crypto == 0) { - printf("[ERROR] register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("[ERROR] register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return writer_crypto; @@ -240,7 +240,7 @@ static DDS_Security_DatareaderCryptoHandle register_remote_datareader(DDS_Securi if (reader_crypto == 0) { - printf("[ERROR] register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("[ERROR] register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return reader_crypto; @@ -319,7 +319,7 @@ static bool crypto_decrypt_data(uint32_t session_id, unsigned char *iv, DDS_Secu if (!crypto_calculate_session_key_test(&session_key, session_id, key_material->master_salt, key_material->master_sender_key, key_material->transformation_kind)) { - printf("[ERROR] (%d) crypto_decrypt_data: could not calculate session key!\n", __LINE__); + (void) printf("[ERROR] (%d) crypto_decrypt_data: could not calculate session key!\n", __LINE__); return false; } @@ -331,7 +331,7 @@ static bool crypto_decrypt_data(uint32_t session_id, unsigned char *iv, DDS_Secu { if (!EVP_DecryptInit_ex(ctx, EVP_aes_128_gcm(), NULL, NULL, NULL)) { - printf("[ERROR] (%d) crypto_decrypt_data: could not get init CIPHER_CTX (128)\n", __LINE__); + (void) printf("[ERROR] (%d) crypto_decrypt_data: could not get init CIPHER_CTX (128)\n", __LINE__); ERR_print_errors_fp(stderr); result = false; } @@ -340,20 +340,20 @@ static bool crypto_decrypt_data(uint32_t session_id, unsigned char *iv, DDS_Secu { if (!EVP_DecryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, NULL, NULL)) { - printf("[ERROR] (%d) crypto_decrypt_data: could not get init CIPHER_CTX (256)\n", __LINE__); + (void) printf("[ERROR] (%d) crypto_decrypt_data: could not get init CIPHER_CTX (256)\n", __LINE__); ERR_print_errors_fp(stderr); result = false; } } else { - printf("[ERROR] (%d) crypto_decrypt_data: could not determine keysize\n", __LINE__); + (void) printf("[ERROR] (%d) crypto_decrypt_data: could not determine keysize\n", __LINE__); result = false; } } else { - printf("[ERROR] (%d) crypto_decrypt_data: could not get new CIPHER_CTX\n", __LINE__); + (void) printf("[ERROR] (%d) crypto_decrypt_data: could not get new CIPHER_CTX\n", __LINE__); result = false; } @@ -361,7 +361,7 @@ static bool crypto_decrypt_data(uint32_t session_id, unsigned char *iv, DDS_Secu { if (!EVP_DecryptInit_ex(ctx, NULL, NULL, session_key.data, iv)) { - printf("[ERROR] (%d) crypto_decrypt_data: could not init Decrypt\n", __LINE__); + (void) printf("[ERROR] (%d) crypto_decrypt_data: could not init Decrypt\n", __LINE__); ERR_print_errors_fp(stderr); result = false; } @@ -377,7 +377,7 @@ static bool crypto_decrypt_data(uint32_t session_id, unsigned char *iv, DDS_Secu } else { - printf("[ERROR] (%d) crypto_decrypt_data: could not update Decrypt (decoded)\n", __LINE__); + (void) printf("[ERROR] (%d) crypto_decrypt_data: could not update Decrypt (decoded)\n", __LINE__); ERR_print_errors_fp(stderr); result = false; } @@ -386,7 +386,7 @@ static bool crypto_decrypt_data(uint32_t session_id, unsigned char *iv, DDS_Secu { if (!EVP_DecryptUpdate(ctx, NULL, &len, encrypted->_buffer, (int) encrypted->_length)) { - printf("[ERROR] (%d) crypto_decrypt_data: could not update Decrypt (!decoded)\n", __LINE__); + (void) printf("[ERROR] (%d) crypto_decrypt_data: could not update Decrypt (!decoded)\n", __LINE__); ERR_print_errors_fp(stderr); result = false; } @@ -397,7 +397,7 @@ static bool crypto_decrypt_data(uint32_t session_id, unsigned char *iv, DDS_Secu { if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, CRYPTO_HMAC_SIZE, tag)) { - printf("[ERROR] (%d) crypto_decrypt_data: could not ctrl CIPHER_CTX\n", __LINE__); + (void) printf("[ERROR] (%d) crypto_decrypt_data: could not ctrl CIPHER_CTX\n", __LINE__); ERR_print_errors_fp(stderr); result = false; } @@ -413,7 +413,7 @@ static bool crypto_decrypt_data(uint32_t session_id, unsigned char *iv, DDS_Secu } else { - printf("[ERROR] (%d) crypto_decrypt_data: could not finalize Decrypt (decoded)\n", __LINE__); + (void) printf("[ERROR] (%d) crypto_decrypt_data: could not finalize Decrypt (decoded)\n", __LINE__); ERR_print_errors_fp(stderr); result = false; } @@ -423,7 +423,7 @@ static bool crypto_decrypt_data(uint32_t session_id, unsigned char *iv, DDS_Secu unsigned char temp[32]; if (!EVP_DecryptFinal_ex(ctx, temp, &len)) { - printf("[ERROR] (%d) crypto_decrypt_data: could not finalize Decrypt (!decoded)\n", __LINE__); + (void) printf("[ERROR] (%d) crypto_decrypt_data: could not finalize Decrypt (!decoded)\n", __LINE__); ERR_print_errors_fp(stderr); result = false; } @@ -583,7 +583,7 @@ static void encode_serialized_payload_check(uint32_t key_size, bool encrypted) if (!result) { - printf("[ERROR] encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("[ERROR] encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); assert(result); // for Clang's static analyzer @@ -607,7 +607,7 @@ static void encode_serialized_payload_check(uint32_t key_size, bool encrypted) result = crypto_decrypt_data(session_id, &header->session_id[0], header->transform_identifier.transformation_kind, session_keys->master_key_material, &encoded_payload, &decoded_buffer, footer->common_mac); if (!result) { - printf("[ERROR] Decryption failed\n"); + (void) printf("[ERROR] Decryption failed\n"); } CU_ASSERT_FATAL(result); CU_ASSERT(check_payload_decoded(&decoded_buffer, &plain_buffer)); @@ -618,7 +618,7 @@ static void encode_serialized_payload_check(uint32_t key_size, bool encrypted) result = crypto_decrypt_data(session_id, &header->session_id[0], header->transform_identifier.transformation_kind, session_keys->master_key_material, &encoded_payload, NULL, footer->common_mac); if (!result) { - printf("[ERROR] Signature check failed\n"); + (void) printf("[ERROR] Signature check failed\n"); } CU_ASSERT_FATAL(result); } @@ -693,7 +693,7 @@ CU_Test(ddssec_builtin_encode_serialized_payload, invalid_args, .init = suite_en if (!result) { - printf("encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); @@ -713,7 +713,7 @@ CU_Test(ddssec_builtin_encode_serialized_payload, invalid_args, .init = suite_en if (!result) { - printf("encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("encode_serialized_payload: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); diff --git a/src/security/builtin_plugins/tests/get_authenticated_peer_credential_token/src/get_authenticated_peer_credential_token_utests.c b/src/security/builtin_plugins/tests/get_authenticated_peer_credential_token/src/get_authenticated_peer_credential_token_utests.c index 77dd71d1f6..640928f601 100644 --- a/src/security/builtin_plugins/tests/get_authenticated_peer_credential_token/src/get_authenticated_peer_credential_token_utests.c +++ b/src/security/builtin_plugins/tests/get_authenticated_peer_credential_token/src/get_authenticated_peer_credential_token_utests.c @@ -437,7 +437,7 @@ validate_local_identity(void) if (result != DDS_SECURITY_VALIDATION_OK) { res = -1; - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } dds_security_property_deinit(&participant_qos.property.value); @@ -473,7 +473,7 @@ release_local_identity(void) if (g_local_identity_handle != DDS_SECURITY_HANDLE_NIL) { success = g_auth->return_identity_handle(g_auth, g_local_identity_handle, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -556,32 +556,32 @@ create_dh_key_modp_2048( if ((params = EVP_PKEY_new()) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate EVP_PKEY: %s", msg); + (void) printf("Failed to allocate EVP_PKEY: %s", msg); ddsrt_free(msg); r = -1; } else if ((dh = DH_get_2048_256()) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate DH parameter: %s", msg); + (void) printf("Failed to allocate DH parameter: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_set1_DH(params, dh) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to set DH parameter to MODP_2048_256: %s", msg); + (void) printf("Failed to set DH parameter to MODP_2048_256: %s", msg); ddsrt_free(msg); r = -1; } else if ((kctx = EVP_PKEY_CTX_new(params, NULL)) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate KEY context %s", msg); + (void) printf("Failed to allocate KEY context %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen_init(kctx) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to initialize KEY context: %s", msg); + (void) printf("Failed to initialize KEY context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen(kctx, pkey) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to generate :MODP_2048_256 keys %s", msg); + (void) printf("Failed to generate :MODP_2048_256 keys %s", msg); ddsrt_free(msg); r = -1; } @@ -607,7 +607,7 @@ get_dh_public_key_modp_2048( dhkey = EVP_PKEY_get1_DH(pkey); if (!dhkey) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get DH key from PKEY: %s", msg); + (void) printf("Failed to get DH key from PKEY: %s", msg); ddsrt_free(msg); r = -1; goto fail_get_dhkey; @@ -616,7 +616,7 @@ get_dh_public_key_modp_2048( asn1int = BN_to_ASN1_INTEGER( dh_get_public_key(dhkey) , NULL); if (!asn1int) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to convert DH key to ASN1 integer: %s", msg); + (void) printf("Failed to convert DH key to ASN1 integer: %s", msg); ddsrt_free(msg); r = -1; goto fail_get_pubkey; @@ -647,37 +647,37 @@ create_dh_key_ecdh( if ((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL)) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate DH parameter context: %s", msg); + (void) printf("Failed to allocate DH parameter context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_paramgen_init(pctx) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to initialize DH generation context: %s", msg); + (void) printf("Failed to initialize DH generation context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, NID_X9_62_prime256v1) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to set DH generation parameter generation method: %s", msg); + (void) printf("Failed to set DH generation parameter generation method: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_paramgen(pctx, ¶ms) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to generate DH parameters: %s", msg); + (void) printf("Failed to generate DH parameters: %s", msg); ddsrt_free(msg); r = -1; } else if ((kctx = EVP_PKEY_CTX_new(params, NULL)) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate KEY context %s", msg); + (void) printf("Failed to allocate KEY context %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen_init(kctx) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to initialize KEY context: %s", msg); + (void) printf("Failed to initialize KEY context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen(kctx, pkey) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to generate :MODP_2048_256 keys %s", msg); + (void) printf("Failed to generate :MODP_2048_256 keys %s", msg); ddsrt_free(msg); r = -1; } @@ -702,17 +702,17 @@ get_dh_public_key_ecdh( if (!(eckey = EVP_PKEY_get1_EC_KEY(pkey))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get EC key from PKEY: %s", msg); + (void) printf("Failed to get EC key from PKEY: %s", msg); ddsrt_free(msg); r = -1; } else if (!(point = EC_KEY_get0_public_key(eckey))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get public key from ECKEY: %s", msg); + (void) printf("Failed to get public key from ECKEY: %s", msg); ddsrt_free(msg); r = -1; } else if (!(group = EC_KEY_get0_group(eckey))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get group from ECKEY: %s", msg); + (void) printf("Failed to get group from ECKEY: %s", msg); ddsrt_free(msg); r = -1; } else if ((sz = EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, NULL, 0, NULL)) != 0) { @@ -720,14 +720,14 @@ get_dh_public_key_ecdh( pubkey->length = (uint32_t) EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, pubkey->data, sz, NULL); if (pubkey->length == 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to serialize public EC key: %s", msg); + (void) printf("Failed to serialize public EC key: %s", msg); ddsrt_free(msg); octet_seq_deinit(pubkey); r = -1; } } else { char *msg = get_openssl_error_message_for_test(); - printf("Failed to serialize public EC key: %s", msg); + (void) printf("Failed to serialize public EC key: %s", msg); ddsrt_free(msg); r = -1; } @@ -796,7 +796,7 @@ validate_remote_identities (const char *remote_id_certificate) if ((result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_REQUEST) && (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE)) { - printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -846,7 +846,7 @@ release_remote_identities(void) if (g_remote_identity_handle != DDS_SECURITY_HANDLE_NIL) { success = g_auth->return_identity_handle(g_auth, g_remote_identity_handle, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -1207,7 +1207,7 @@ fill_handshake_message_token( if (create_signature_for_test(private_key_x509, binary_properties, HANDSHAKE_SIGNATURE_SIZE , &sign, &signlen, &exception) != DDS_SECURITY_VALIDATION_OK) { - printf("Exception: %s\n", exception.message); + (void) printf("Exception: %s\n", exception.message); } set_binary_property_value(signature, DDS_AUTHTOKEN_PROP_SIGNATURE, sign, signlen); @@ -1239,7 +1239,7 @@ fill_handshake_message_token( set_binary_property_value(hash_c1, DDS_AUTHTOKEN_PROP_HASH_C1, hash1_from_request->value._buffer, hash1_from_request->value._length); set_binary_property_value(hash_c2, DDS_AUTHTOKEN_PROP_HASH_C2, hash2_from_reply->value._buffer, hash2_from_reply->value._length); - printf("process: %s\n", hash_c1->name); + (void) printf("process: %s\n", hash_c1->name); /* Set the challenge in challenge1 property */ if (challengeData) { @@ -1293,7 +1293,7 @@ fill_handshake_message_token( if (create_signature_for_test(private_key_x509, binary_properties, HANDSHAKE_SIGNATURE_SIZE, &sign, &signlen, &exception) != DDS_SECURITY_VALIDATION_OK) { - printf("Exception: %s\n", exception.message); + (void) printf("Exception: %s\n", exception.message); } set_binary_property_value(signature, DDS_AUTHTOKEN_PROP_SIGNATURE, sign, signlen); @@ -1419,14 +1419,14 @@ CU_Test(ddssec_builtin_get_authenticated_peer_credential,token_after_request ) assert(c_id); // for GCC's static analyzer CU_ASSERT_FATAL(c_id->value != NULL); assert(c_id && c_id->value); // for Clang's static analyzer - //printf("c_id->value: %s\n", c_id->value); + //(void) printf("c_id->value: %s\n", c_id->value); CU_ASSERT(strcmp(c_id->value, REMOTE_IDENTITY_CERTIFICATE) == 0); c_perm = find_property(&credential_token, DDS_AUTHTOKEN_PROP_C_PERM); CU_ASSERT_FATAL(c_perm != NULL); CU_ASSERT_FATAL(c_perm->value != NULL); assert(c_perm && c_perm->value); // for Clang's static analyzer - //printf("c_perm->value: %s\n", c_perm->value); + //(void) printf("c_perm->value: %s\n", c_perm->value); CU_ASSERT(strcmp(c_perm->value, PERMISSIONS_DOCUMENT) == 0); success = g_auth->return_authenticated_peer_credential_token(g_auth, &credential_token, &exception); @@ -1550,14 +1550,14 @@ CU_Test(ddssec_builtin_get_authenticated_peer_credential,token_after_reply ) assert(c_id); // for GCC's static analyzer CU_ASSERT_FATAL(c_id->value != NULL); assert(c_id && c_id->value); // for Clang's static analyzer - //printf("c_id->value: %s\n", c_id->value); + //(void) printf("c_id->value: %s\n", c_id->value); CU_ASSERT(strcmp(c_id->value, REMOTE_IDENTITY_CERTIFICATE) == 0); c_perm = find_property(&credential_token, DDS_AUTHTOKEN_PROP_C_PERM); CU_ASSERT_FATAL(c_perm != NULL); CU_ASSERT_FATAL(c_perm->value != NULL); assert(c_perm && c_perm->value); // for Clang's static analyzer - //printf("c_perm->value: %s\n", c_perm->value); + //(void) printf("c_perm->value: %s\n", c_perm->value); CU_ASSERT(strcmp(c_perm->value, PERMISSIONS_DOCUMENT) == 0); diff --git a/src/security/builtin_plugins/tests/get_permissions_credential_token/src/get_permissions_credential_token_utests.c b/src/security/builtin_plugins/tests/get_permissions_credential_token/src/get_permissions_credential_token_utests.c index c06cbe068b..68304c45fd 100644 --- a/src/security/builtin_plugins/tests/get_permissions_credential_token/src/get_permissions_credential_token_utests.c +++ b/src/security/builtin_plugins/tests/get_permissions_credential_token/src/get_permissions_credential_token_utests.c @@ -260,7 +260,7 @@ static int local_permissions_init(DDS_Security_DomainId domain_id) if (result != DDS_SECURITY_VALIDATION_OK) { res = -1; - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -278,7 +278,7 @@ static int local_permissions_init(DDS_Security_DomainId domain_id) if (local_permissions_handle == DDS_SECURITY_HANDLE_NIL) { res = -1; - printf("validate_local_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } } @@ -299,7 +299,7 @@ static void local_permissions_clean(void) success = access_control->return_permissions_handle(access_control, local_permissions_handle, &exception); if (!success) { - printf("return_permission_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_permission_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -309,7 +309,7 @@ static void local_permissions_clean(void) success = auth->return_identity_handle(auth, local_identity_handle, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -390,7 +390,7 @@ CU_Test(ddssec_builtin_get_permissions_credential_token, happy_day, .init = suit &exception); if (!result) { - printf("get_permissions_credential_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_credential_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); CU_ASSERT(exception.code == 0); @@ -426,7 +426,7 @@ CU_Test(ddssec_builtin_get_permissions_credential_token, invalid_args, .init = s &exception); if (!result) { - printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); CU_ASSERT(exception.code == DDS_SECURITY_ERR_INVALID_PARAMETER_CODE); @@ -440,7 +440,7 @@ CU_Test(ddssec_builtin_get_permissions_credential_token, invalid_args, .init = s &exception); if (!result) { - printf("get_permissions_credential_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_credential_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); CU_ASSERT(exception.code == DDS_SECURITY_ERR_INVALID_PARAMETER_CODE); @@ -454,7 +454,7 @@ CU_Test(ddssec_builtin_get_permissions_credential_token, invalid_args, .init = s &exception); if (!result) { - printf("get_permissions_credential_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_credential_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); CU_ASSERT(exception.code == DDS_SECURITY_ERR_INVALID_PARAMETER_CODE); @@ -468,7 +468,7 @@ CU_Test(ddssec_builtin_get_permissions_credential_token, invalid_args, .init = s NULL); if (!result) { - printf("get_permissions_credential_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_credential_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); CU_ASSERT(exception.code == 0); @@ -482,7 +482,7 @@ CU_Test(ddssec_builtin_get_permissions_credential_token, invalid_args, .init = s &exception); if (!result) { - printf("get_permissions_credential_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_credential_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); CU_ASSERT(exception.code == DDS_SECURITY_ERR_INVALID_PARAMETER_CODE); diff --git a/src/security/builtin_plugins/tests/get_permissions_token/src/get_permissions_token_utests.c b/src/security/builtin_plugins/tests/get_permissions_token/src/get_permissions_token_utests.c index 1c0c218c14..3655b302ee 100644 --- a/src/security/builtin_plugins/tests/get_permissions_token/src/get_permissions_token_utests.c +++ b/src/security/builtin_plugins/tests/get_permissions_token/src/get_permissions_token_utests.c @@ -258,7 +258,7 @@ static void local_permissions_clean(void) success = access_control->return_permissions_handle(access_control, local_permissions_handle, &exception); if (!success) { - printf("return_permission_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_permission_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -268,7 +268,7 @@ static void local_permissions_clean(void) success = auth->return_identity_handle(auth, local_identity_handle, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -305,9 +305,9 @@ static bool validate_permissions_token( /* Optional. */ if (find_property(token, DDS_ACTOKEN_PROP_PERM_CA_SN) == NULL) - printf("Optional PermissionsToken property '" DDS_ACTOKEN_PROP_PERM_CA_SN "' not found\n"); + (void) printf("Optional PermissionsToken property '" DDS_ACTOKEN_PROP_PERM_CA_SN "' not found\n"); if (find_property(token, DDS_ACTOKEN_PROP_PERM_CA_ALGO) == NULL) - printf("Optional PermissionsToken property '" DDS_ACTOKEN_PROP_PERM_CA_ALGO "' not found\n"); + (void) printf("Optional PermissionsToken property '" DDS_ACTOKEN_PROP_PERM_CA_ALGO "' not found\n"); return true; } @@ -333,7 +333,7 @@ CU_Test(ddssec_builtin_get_permissions_token, happy_day, .init = suite_get_permi &exception); if (!result) { - printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result); CU_ASSERT(exception.code == 0); @@ -369,7 +369,7 @@ CU_Test(ddssec_builtin_get_permissions_token, invalid_args, .init = suite_get_pe &exception); if (!result) { - printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); CU_ASSERT(exception.code == DDS_SECURITY_ERR_INVALID_PARAMETER_CODE); @@ -383,7 +383,7 @@ CU_Test(ddssec_builtin_get_permissions_token, invalid_args, .init = suite_get_pe &exception); if (!result) { - printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); CU_ASSERT(exception.code == DDS_SECURITY_ERR_INVALID_PARAMETER_CODE); @@ -397,7 +397,7 @@ CU_Test(ddssec_builtin_get_permissions_token, invalid_args, .init = suite_get_pe &exception); if (!result) { - printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); CU_ASSERT(exception.code == DDS_SECURITY_ERR_INVALID_PARAMETER_CODE); @@ -411,7 +411,7 @@ CU_Test(ddssec_builtin_get_permissions_token, invalid_args, .init = suite_get_pe NULL); if (!result) { - printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); CU_ASSERT(exception.code == 0); @@ -425,7 +425,7 @@ CU_Test(ddssec_builtin_get_permissions_token, invalid_args, .init = suite_get_pe &exception); if (!result) { - printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("get_permissions_token: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(!result); CU_ASSERT(exception.code == DDS_SECURITY_ERR_INVALID_PARAMETER_CODE); diff --git a/src/security/builtin_plugins/tests/get_xxx_sec_attributes/src/get_xxx_sec_attributes_utests.c b/src/security/builtin_plugins/tests/get_xxx_sec_attributes/src/get_xxx_sec_attributes_utests.c index 6d82582383..11f38b3e7f 100644 --- a/src/security/builtin_plugins/tests/get_xxx_sec_attributes/src/get_xxx_sec_attributes_utests.c +++ b/src/security/builtin_plugins/tests/get_xxx_sec_attributes/src/get_xxx_sec_attributes_utests.c @@ -256,7 +256,7 @@ static bool create_local_identity(DDS_Security_DomainId domain_id, const char *g if (result != DDS_SECURITY_VALIDATION_OK) { - printf("[ERROR] validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("[ERROR] validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); return false; } @@ -270,7 +270,7 @@ static bool create_local_identity(DDS_Security_DomainId domain_id, const char *g if (local_permissions_handle == DDS_SECURITY_HANDLE_NIL) { - printf("[ERROR] validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("[ERROR] validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); return false; } @@ -289,7 +289,7 @@ static void clear_local_identity(void) success = auth->return_identity_handle(auth, local_identity_handle, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -299,7 +299,7 @@ static void clear_local_identity(void) success = access_control->return_permissions_handle(access_control, local_permissions_handle, &exception); if (!success) { - printf("return_permissions_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_permissions_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -441,8 +441,8 @@ verify_endpoint_attributes(SEC_TOPIC_TYPE topic_type, DDS_Security_EndpointSecur if (!result) { - printf("Invalid attribute for Topic: %s\n", TOPIC_NAMES[topic_type]); - printf("is_read_protected: EXPECTED: %u ACTUAL: %u\n" + (void) printf("Invalid attribute for Topic: %s\n", TOPIC_NAMES[topic_type]); + (void) printf("is_read_protected: EXPECTED: %u ACTUAL: %u\n" "is_write_protected: EXPECTED: %u ACTUAL: %u\n" "is_discovery_protected: EXPECTED: %u ACTUAL: %u\n" "is_liveliness_protected: EXPECTED: %u ACTUAL: %u\n" @@ -474,8 +474,8 @@ static bool verify_topic_attributes(SEC_TOPIC_TYPE topic_type, DDS_Security_Topi if (!result) { - printf("Invalid attribute for Topic: %s\n", TOPIC_NAMES[topic_type]); - printf("is_read_protected: EXPECTED: %u ACTUAL: %u\n" + (void) printf("Invalid attribute for Topic: %s\n", TOPIC_NAMES[topic_type]); + (void) printf("is_read_protected: EXPECTED: %u ACTUAL: %u\n" "is_write_protected: EXPECTED: %u ACTUAL: %u\n" "is_discovery_protected: EXPECTED: %u ACTUAL: %u\n" "is_liveliness_protected: EXPECTED: %u ACTUAL: %u\n", diff --git a/src/security/builtin_plugins/tests/listeners_access_control/src/listeners_access_control_utests.c b/src/security/builtin_plugins/tests/listeners_access_control/src/listeners_access_control_utests.c index aad7382a14..a1f896c419 100644 --- a/src/security/builtin_plugins/tests/listeners_access_control/src/listeners_access_control_utests.c +++ b/src/security/builtin_plugins/tests/listeners_access_control/src/listeners_access_control_utests.c @@ -286,7 +286,7 @@ static int smime_sign(const char *certificate_file, const char *key_file, const err: if (ret) { - fprintf(stderr, "Error Signing Data\n"); + (void) fprintf(stderr, "Error Signing Data\n"); ERR_print_errors_fp(stderr); } if (p7) @@ -453,7 +453,7 @@ validate_local_identity_and_permissions(int32_t permission_expiry) if (result != DDS_SECURITY_VALIDATION_OK) { res = DDS_SECURITY_ERR_UNDEFINED_CODE; - printf("validate_local_identity_failed: (%d) %s\n", (int)exception.code, exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: (%d) %s\n", (int)exception.code, exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -470,7 +470,7 @@ validate_local_identity_and_permissions(int32_t permission_expiry) if (local_permissions_handle == DDS_SECURITY_HANDLE_NIL) { - printf("validate_local_permissions_failed: (%d) %s\n", (int)exception.code, exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_permissions_failed: (%d) %s\n", (int)exception.code, exception.message ? exception.message : "Error message missing"); if (exception.code == DDS_SECURITY_ERR_VALIDITY_PERIOD_EXPIRED_CODE) /* This can happen on very slow platforms or when doing a valgrind run. */ res = DDS_SECURITY_ERR_VALIDITY_PERIOD_EXPIRED_CODE; @@ -494,7 +494,7 @@ static void clear_local_identity_and_permissions(void) { success = access_control->return_permissions_handle(access_control, local_permissions_handle, &exception); if (!success) - printf("return_permission_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_permission_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); reset_exception(&exception); } @@ -502,7 +502,7 @@ static void clear_local_identity_and_permissions(void) { success = auth->return_identity_handle(auth, local_identity_handle, &exception); if (!success) - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); reset_exception(&exception); } } @@ -546,7 +546,7 @@ static DDS_Security_boolean on_revoke_permissions_cb(const dds_security_access_c permission_handle_for_callback1 = handle; else if (permission_handle_for_callback2 == DDS_SECURITY_HANDLE_NIL) permission_handle_for_callback2 = handle; - printf("Listener called for handle: %lld Local:%lld Remote:%lld\n", (long long)handle, (long long)local_permissions_handle, (long long)remote_permissions_handle); + (void) printf("Listener called for handle: %lld Local:%lld Remote:%lld\n", (long long)handle, (long long)local_permissions_handle, (long long)remote_permissions_handle); return true; } @@ -604,7 +604,7 @@ CU_Test(ddssec_builtin_listeners_access_control, local_2secs) if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); /* Expiry can happen on very slow platforms or when doing a valgrind run. * Just take our losses and quit, simulating a success. */ CU_ASSERT(exception.code == DDS_SECURITY_ERR_VALIDITY_PERIOD_EXPIRED_CODE); diff --git a/src/security/builtin_plugins/tests/listeners_authentication/src/listeners_authentication_utests.c b/src/security/builtin_plugins/tests/listeners_authentication/src/listeners_authentication_utests.c index 4b4891df45..60b03d7a9f 100644 --- a/src/security/builtin_plugins/tests/listeners_authentication/src/listeners_authentication_utests.c +++ b/src/security/builtin_plugins/tests/listeners_authentication/src/listeners_authentication_utests.c @@ -703,7 +703,7 @@ validate_local_identity_and_permissions( uint32_t identity_expiry_duration, dds_ if (result != DDS_SECURITY_VALIDATION_OK) { res = DDS_SECURITY_ERR_UNDEFINED_CODE; - printf("validate_local_identity_failed: (%d) %s\n", (int)exception.code, exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: (%d) %s\n", (int)exception.code, exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -718,7 +718,7 @@ validate_local_identity_and_permissions( uint32_t identity_expiry_duration, dds_ &exception); if (local_permissions_handle == DDS_SECURITY_HANDLE_NIL) { - printf("validate_local_permissions_failed: (%d) %s\n", (int)exception.code, exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_permissions_failed: (%d) %s\n", (int)exception.code, exception.message ? exception.message : "Error message missing"); if (exception.code == DDS_SECURITY_ERR_VALIDITY_PERIOD_EXPIRED_CODE) { /* This can happen on very slow platforms or when doing a valgrind run. */ res = DDS_SECURITY_ERR_VALIDITY_PERIOD_EXPIRED_CODE; @@ -765,7 +765,7 @@ clear_local_identity_and_permissions(void) if (local_permissions_handle != DDS_SECURITY_HANDLE_NIL) { success = access_control->return_permissions_handle(access_control, local_permissions_handle, &exception); if (!success) { - printf("return_permission_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_permission_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -773,7 +773,7 @@ clear_local_identity_and_permissions(void) if (local_identity_handle != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, local_identity_handle, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -789,7 +789,7 @@ set_path_to_etc_dir(void) len = 1024; path_to_etc_dir = ddsrt_malloc(len); - snprintf(path_to_etc_dir, 1024, "%s/listeners_authentication/etc/", CONFIG_ENV_TESTS_DIR); + (void) snprintf(path_to_etc_dir, 1024, "%s/listeners_authentication/etc/", CONFIG_ENV_TESTS_DIR); return res; } @@ -891,32 +891,32 @@ create_dh_key_modp_2048( if ((params = EVP_PKEY_new()) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate EVP_PKEY: %s", msg); + (void) printf("Failed to allocate EVP_PKEY: %s", msg); ddsrt_free(msg); r = -1; } else if ((dh = DH_get_2048_256()) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate DH parameter: %s", msg); + (void) printf("Failed to allocate DH parameter: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_set1_DH(params, dh) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to set DH parameter to MODP_2048_256: %s", msg); + (void) printf("Failed to set DH parameter to MODP_2048_256: %s", msg); ddsrt_free(msg); r = -1; } else if ((kctx = EVP_PKEY_CTX_new(params, NULL)) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate KEY context %s", msg); + (void) printf("Failed to allocate KEY context %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen_init(kctx) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to initialize KEY context: %s", msg); + (void) printf("Failed to initialize KEY context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen(kctx, pkey) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to generate :MODP_2048_256 keys %s", msg); + (void) printf("Failed to generate :MODP_2048_256 keys %s", msg); ddsrt_free(msg); r = -1; } @@ -942,7 +942,7 @@ get_dh_public_key_modp_2048( dhkey = EVP_PKEY_get1_DH(pkey); if (!dhkey) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get DH key from PKEY: %s", msg); + (void) printf("Failed to get DH key from PKEY: %s", msg); ddsrt_free(msg); r = -1; goto fail_get_dhkey; @@ -951,7 +951,7 @@ get_dh_public_key_modp_2048( asn1int = BN_to_ASN1_INTEGER( dh_get_public_key(dhkey) , NULL); if (!asn1int) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to convert DH key to ASN1 integer: %s", msg); + (void) printf("Failed to convert DH key to ASN1 integer: %s", msg); ddsrt_free(msg); r = -1; goto fail_get_pubkey; @@ -982,37 +982,37 @@ create_dh_key_ecdh( if ((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL)) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate DH parameter context: %s", msg); + (void) printf("Failed to allocate DH parameter context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_paramgen_init(pctx) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to initialize DH generation context: %s", msg); + (void) printf("Failed to initialize DH generation context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, NID_X9_62_prime256v1) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to set DH generation parameter generation method: %s", msg); + (void) printf("Failed to set DH generation parameter generation method: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_paramgen(pctx, ¶ms) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to generate DH parameters: %s", msg); + (void) printf("Failed to generate DH parameters: %s", msg); ddsrt_free(msg); r = -1; } else if ((kctx = EVP_PKEY_CTX_new(params, NULL)) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate KEY context %s", msg); + (void) printf("Failed to allocate KEY context %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen_init(kctx) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to initialize KEY context: %s", msg); + (void) printf("Failed to initialize KEY context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen(kctx, pkey) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to generate :MODP_2048_256 keys %s", msg); + (void) printf("Failed to generate :MODP_2048_256 keys %s", msg); ddsrt_free(msg); r = -1; } @@ -1037,17 +1037,17 @@ get_dh_public_key_ecdh( if (!(eckey = EVP_PKEY_get1_EC_KEY(pkey))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get EC key from PKEY: %s", msg); + (void) printf("Failed to get EC key from PKEY: %s", msg); ddsrt_free(msg); r = -1; } else if (!(point = EC_KEY_get0_public_key(eckey))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get public key from ECKEY: %s", msg); + (void) printf("Failed to get public key from ECKEY: %s", msg); ddsrt_free(msg); r = -1; } else if (!(group = EC_KEY_get0_group(eckey))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get group from ECKEY: %s", msg); + (void) printf("Failed to get group from ECKEY: %s", msg); ddsrt_free(msg); r = -1; } else if ((sz = EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, NULL, 0, NULL)) != 0) { @@ -1055,14 +1055,14 @@ get_dh_public_key_ecdh( pubkey->length = (uint32_t)EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, pubkey->data, sz, NULL); if (pubkey->length == 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to serialize public EC key: %s", msg); + (void) printf("Failed to serialize public EC key: %s", msg); ddsrt_free(msg); octet_seq_deinit(pubkey); r = -1; } } else { char *msg = get_openssl_error_message_for_test(); - printf("Failed to serialize public EC key: %s", msg); + (void) printf("Failed to serialize public EC key: %s", msg); ddsrt_free(msg); r = -1; } @@ -1414,7 +1414,7 @@ validate_remote_identity (const char *remote_id_certificate) if ((result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_REQUEST) && (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE)) { - printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -1432,7 +1432,7 @@ validate_remote_identity (const char *remote_id_certificate) if ((result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_REQUEST) && (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE)) { - printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -1487,7 +1487,7 @@ release_remote_identities(void) if (remote_identity_handle != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, remote_identity_handle, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -1495,7 +1495,7 @@ release_remote_identities(void) if (remote_identity_handle2 != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, remote_identity_handle2, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -1759,7 +1759,7 @@ fill_handshake_message_token( rc = create_signature_for_test(private_key_x509, binary_properties, HANDSHAKE_SIGNATURE_SIZE , &sign, &signlen, &exception); if (rc != DDS_SECURITY_VALIDATION_OK) { - printf("Exception: %s\n", exception.message); + (void) printf("Exception: %s\n", exception.message); } else { @@ -1794,7 +1794,7 @@ fill_handshake_message_token( set_binary_property_value(hash_c1, DDS_AUTHTOKEN_PROP_HASH_C1, hash1_from_request->value._buffer, hash1_from_request->value._length); set_binary_property_value(hash_c2, DDS_AUTHTOKEN_PROP_HASH_C2, hash2_from_reply->value._buffer, hash2_from_reply->value._length); - printf("process: %s\n", hash_c1->name); + (void) printf("process: %s\n", hash_c1->name); /* Set the challenge in challenge1 property */ if (challengeData) { @@ -1848,7 +1848,7 @@ fill_handshake_message_token( if (create_signature_for_test(private_key_x509, binary_properties, HANDSHAKE_SIGNATURE_SIZE, &sign, &signlen, &exception) != DDS_SECURITY_VALIDATION_OK) { - printf("Exception: %s\n", exception.message); + (void) printf("Exception: %s\n", exception.message); } else { @@ -1873,7 +1873,7 @@ static DDS_Security_boolean on_revoke_identity_cb(const dds_security_authenticat identity_handle_for_callback1 = handle; else if (identity_handle_for_callback2 == DDS_SECURITY_HANDLE_NIL) identity_handle_for_callback2 = handle; - printf( "Listener called for handle: %lld Local:%lld Remote:%lld\n", (long long) handle, (long long) local_identity_handle, (long long) remote_identity_handle2); + (void) printf( "Listener called for handle: %lld Local:%lld Remote:%lld\n", (long long) handle, (long long) local_identity_handle, (long long) remote_identity_handle2); return true; } @@ -1955,7 +1955,7 @@ CU_Test(ddssec_builtin_listeners_auth, local_remote_set_before_validation) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* get challenge 1 from the message */ @@ -2004,7 +2004,7 @@ CU_Test(ddssec_builtin_listeners_auth, local_remote_set_before_validation) &exception); if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); //TODO: Clean-up before failing CU_ASSERT_FATAL (exception.code == DDS_SECURITY_ERR_VALIDITY_PERIOD_EXPIRED_CODE); // goto end; diff --git a/src/security/builtin_plugins/tests/preprocess_secure_submsg/src/preprocess_secure_submsg_utests.c b/src/security/builtin_plugins/tests/preprocess_secure_submsg/src/preprocess_secure_submsg_utests.c index e785877660..8fc24a4bf3 100644 --- a/src/security/builtin_plugins/tests/preprocess_secure_submsg/src/preprocess_secure_submsg_utests.c +++ b/src/security/builtin_plugins/tests/preprocess_secure_submsg/src/preprocess_secure_submsg_utests.c @@ -112,7 +112,7 @@ static int register_local_participant(void) &exception); if (local_participant_handle == DDS_SECURITY_HANDLE_NIL) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_participant_handle ? 0 : -1; @@ -133,7 +133,7 @@ static int register_remote_participant(void) &exception); if (remote_participant_handle == DDS_SECURITY_HANDLE_NIL) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_participant_handle ? 0 : -1; @@ -167,7 +167,7 @@ static int register_local_datareader(void) if (local_reader_crypto == 0) - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); return local_reader_crypto ? 0 : -1; } @@ -188,7 +188,7 @@ static int register_remote_datareader(void) &exception); if (remote_reader_crypto == 0) - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); return remote_reader_crypto ? 0 : -1; } @@ -212,7 +212,7 @@ static int register_local_datawriter(void) if (local_writer_crypto == 0) - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); return local_writer_crypto ? 0 : -1; } @@ -230,7 +230,7 @@ static int register_remote_datawriter(void) &exception); if (remote_writer_crypto == 0) - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); return remote_writer_crypto ? 0 : -1; } @@ -477,7 +477,7 @@ CU_Test(ddssec_builtin_preprocess_secure_submsg, writer_happy_day, .init = suite &exception); if (!result) - printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT_FATAL(result); CU_ASSERT(exception.code == 0); @@ -503,7 +503,7 @@ CU_Test(ddssec_builtin_preprocess_secure_submsg, writer_happy_day, .init = suite &exception); if (!result) - printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT_FATAL(result); CU_ASSERT(exception.code == 0); @@ -546,7 +546,7 @@ CU_Test(ddssec_builtin_preprocess_secure_submsg, reader_happy_day, .init = suite &exception); if (!result) - printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT_FATAL(result); CU_ASSERT(exception.code == 0); @@ -569,7 +569,7 @@ CU_Test(ddssec_builtin_preprocess_secure_submsg, reader_happy_day, .init = suite &exception); if (!result) - printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT_FATAL(result); CU_ASSERT(exception.code == 0); @@ -613,7 +613,7 @@ CU_Test(ddssec_builtin_preprocess_secure_submsg, invalid_args, .init = suite_pre &exception); if (!result) - printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -632,7 +632,7 @@ CU_Test(ddssec_builtin_preprocess_secure_submsg, invalid_args, .init = suite_pre &exception); if (!result) - printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -671,7 +671,7 @@ CU_Test(ddssec_builtin_preprocess_secure_submsg, invalid_message, .init = suite_ &exception); if (!result) - printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -696,7 +696,7 @@ CU_Test(ddssec_builtin_preprocess_secure_submsg, invalid_message, .init = suite_ &exception); if (!result) - printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -720,7 +720,7 @@ CU_Test(ddssec_builtin_preprocess_secure_submsg, invalid_message, .init = suite_ &exception); if (!result) - printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -821,7 +821,7 @@ CU_Test(ddssec_builtin_preprocess_secure_submsg, volatile_secure, .init = suite_ &exception); if (!result) - printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("preprocess_secure_submsg: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT_FATAL(result); CU_ASSERT(exception.code == 0); diff --git a/src/security/builtin_plugins/tests/process_handshake/src/process_handshake_utests.c b/src/security/builtin_plugins/tests/process_handshake/src/process_handshake_utests.c index 40ce02ee9c..e47f039102 100644 --- a/src/security/builtin_plugins/tests/process_handshake/src/process_handshake_utests.c +++ b/src/security/builtin_plugins/tests/process_handshake/src/process_handshake_utests.c @@ -629,9 +629,9 @@ validate_local_identity(const char *ca_certificate, const char *public_cert, con if (trusted_ca_dir != NULL) { char trusted_ca_dir_path[1024]; #ifdef WIN32 - snprintf(trusted_ca_dir_path, 1024, "%s\\validate_begin_handshake_reply\\etc\\%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); + (void) snprintf(trusted_ca_dir_path, 1024, "%s\\validate_begin_handshake_reply\\etc\\%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); #else - snprintf(trusted_ca_dir_path, 1024, "%s/validate_begin_handshake_reply/etc/%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); + (void) snprintf(trusted_ca_dir_path, 1024, "%s/validate_begin_handshake_reply/etc/%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); #endif valbuf = &participant_qos.property.value._buffer[offset++]; valbuf->name = ddsrt_strdup(DDS_SEC_PROP_ACCESS_TRUSTED_CA_DIR); @@ -656,7 +656,7 @@ validate_local_identity(const char *ca_certificate, const char *public_cert, con if (result != DDS_SECURITY_VALIDATION_OK) { res = -1; - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } dds_security_property_deinit(&participant_qos.property.value); @@ -694,7 +694,7 @@ release_local_identity(void) if (local_identity_handle != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, local_identity_handle, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -773,32 +773,32 @@ create_dh_key_modp_2048( if ((params = EVP_PKEY_new()) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate EVP_PKEY: %s", msg); + (void) printf("Failed to allocate EVP_PKEY: %s", msg); ddsrt_free(msg); r = -1; } else if ((dh = DH_get_2048_256()) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate DH parameter: %s", msg); + (void) printf("Failed to allocate DH parameter: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_set1_DH(params, dh) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to set DH parameter to MODP_2048_256: %s", msg); + (void) printf("Failed to set DH parameter to MODP_2048_256: %s", msg); ddsrt_free(msg); r = -1; } else if ((kctx = EVP_PKEY_CTX_new(params, NULL)) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate KEY context %s", msg); + (void) printf("Failed to allocate KEY context %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen_init(kctx) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to initialize KEY context: %s", msg); + (void) printf("Failed to initialize KEY context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen(kctx, pkey) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to generate :MODP_2048_256 keys %s", msg); + (void) printf("Failed to generate :MODP_2048_256 keys %s", msg); ddsrt_free(msg); r = -1; } @@ -824,7 +824,7 @@ get_dh_public_key_modp_2048( dhkey = EVP_PKEY_get1_DH(pkey); if (!dhkey) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get DH key from PKEY: %s", msg); + (void) printf("Failed to get DH key from PKEY: %s", msg); ddsrt_free(msg); r = -1; goto fail_get_dhkey; @@ -833,7 +833,7 @@ get_dh_public_key_modp_2048( asn1int = BN_to_ASN1_INTEGER( dh_get_public_key(dhkey) , NULL); if (!asn1int) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to convert DH key to ASN1 integer: %s", msg); + (void) printf("Failed to convert DH key to ASN1 integer: %s", msg); ddsrt_free(msg); r = -1; goto fail_get_pubkey; @@ -864,37 +864,37 @@ create_dh_key_ecdh( if ((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL)) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate DH parameter context: %s", msg); + (void) printf("Failed to allocate DH parameter context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_paramgen_init(pctx) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to initialize DH generation context: %s", msg); + (void) printf("Failed to initialize DH generation context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, NID_X9_62_prime256v1) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to set DH generation parameter generation method: %s", msg); + (void) printf("Failed to set DH generation parameter generation method: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_paramgen(pctx, ¶ms) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to generate DH parameters: %s", msg); + (void) printf("Failed to generate DH parameters: %s", msg); ddsrt_free(msg); r = -1; } else if ((kctx = EVP_PKEY_CTX_new(params, NULL)) == NULL) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to allocate KEY context %s", msg); + (void) printf("Failed to allocate KEY context %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen_init(kctx) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to initialize KEY context: %s", msg); + (void) printf("Failed to initialize KEY context: %s", msg); ddsrt_free(msg); r = -1; } else if (EVP_PKEY_keygen(kctx, pkey) <= 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to generate :MODP_2048_256 keys %s", msg); + (void) printf("Failed to generate :MODP_2048_256 keys %s", msg); ddsrt_free(msg); r = -1; } @@ -919,17 +919,17 @@ get_dh_public_key_ecdh( if (!(eckey = EVP_PKEY_get1_EC_KEY(pkey))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get EC key from PKEY: %s", msg); + (void) printf("Failed to get EC key from PKEY: %s", msg); ddsrt_free(msg); r = -1; } else if (!(point = EC_KEY_get0_public_key(eckey))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get public key from ECKEY: %s", msg); + (void) printf("Failed to get public key from ECKEY: %s", msg); ddsrt_free(msg); r = -1; } else if (!(group = EC_KEY_get0_group(eckey))) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to get group from ECKEY: %s", msg); + (void) printf("Failed to get group from ECKEY: %s", msg); ddsrt_free(msg); r = -1; } else if ((sz = EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, NULL, 0, NULL)) != 0) { @@ -937,14 +937,14 @@ get_dh_public_key_ecdh( pubkey->length = (uint32_t) EC_POINT_point2oct(group, point, POINT_CONVERSION_COMPRESSED, pubkey->data, sz, NULL); if (pubkey->length == 0) { char *msg = get_openssl_error_message_for_test(); - printf("Failed to serialize public EC key: %s", msg); + (void) printf("Failed to serialize public EC key: %s", msg); ddsrt_free(msg); octet_seq_deinit(pubkey); r = -1; } } else { char *msg = get_openssl_error_message_for_test(); - printf("Failed to serialize public EC key: %s", msg); + (void) printf("Failed to serialize public EC key: %s", msg); ddsrt_free(msg); r = -1; } @@ -1009,7 +1009,7 @@ validate_remote_identities (const char *remote_id_certificate) if ((result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_REQUEST) && (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE)) { - printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -1028,7 +1028,7 @@ validate_remote_identities (const char *remote_id_certificate) if ((result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_REQUEST) && (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE)) { - printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -1084,14 +1084,14 @@ release_remote_identities(void) if (remote_identity_handle1 != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, remote_identity_handle1, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } if (remote_identity_handle2 != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, remote_identity_handle2, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -1487,7 +1487,7 @@ fill_handshake_message_token( if (create_signature_for_test(private_key_x509, binary_properties, HANDSHAKE_SIGNATURE_SIZE , &sign, &signlen, &exception) != DDS_SECURITY_VALIDATION_OK) { - printf("Exception: %s\n", exception.message); + (void) printf("Exception: %s\n", exception.message); } else { @@ -1520,7 +1520,7 @@ fill_handshake_message_token( set_binary_property_value(hash_c1, DDS_AUTHTOKEN_PROP_HASH_C1, hash1_from_request->value._buffer, hash1_from_request->value._length); set_binary_property_value(hash_c2, DDS_AUTHTOKEN_PROP_HASH_C2, hash2_from_reply->value._buffer, hash2_from_reply->value._length); - printf("process: %s\n", hash_c1->name); + (void) printf("process: %s\n", hash_c1->name); /* Set the challenge in challenge1 property */ if (challengeData) { @@ -1574,7 +1574,7 @@ fill_handshake_message_token( if (create_signature_for_test(private_key_x509, binary_properties, HANDSHAKE_SIGNATURE_SIZE, &sign, &signlen, &exception) != DDS_SECURITY_VALIDATION_OK) { - printf("Exception: %s\n", exception.message); + (void) printf("Exception: %s\n", exception.message); } else { @@ -1698,7 +1698,7 @@ CU_Test(ddssec_builtin_process_handshake,happy_day_after_request) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* get challenge 1 from the message */ @@ -1789,7 +1789,7 @@ CU_Test(ddssec_builtin_process_handshake,happy_day_after_reply) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -1833,7 +1833,7 @@ CU_Test(ddssec_builtin_process_handshake,happy_day_after_reply) CU_ASSERT_TRUE (success); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -1880,7 +1880,7 @@ CU_Test(ddssec_builtin_process_handshake,invalid_arguments) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -1990,7 +1990,7 @@ CU_Test(ddssec_builtin_process_handshake,invalid_certificate) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -2080,7 +2080,7 @@ CU_Test(ddssec_builtin_process_handshake,invalid_dsign_algo) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -2164,7 +2164,7 @@ CU_Test(ddssec_builtin_process_handshake,invalid_kagree_algo) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -2247,7 +2247,7 @@ CU_Test(ddssec_builtin_process_handshake,invalid_diffie_hellman) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -2324,7 +2324,7 @@ CU_Test(ddssec_builtin_process_handshake,return_handle) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL (result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -2336,7 +2336,7 @@ CU_Test(ddssec_builtin_process_handshake,return_handle) CU_ASSERT_TRUE (success); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -2346,7 +2346,7 @@ CU_Test(ddssec_builtin_process_handshake,return_handle) CU_ASSERT (exception.message != NULL); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -2396,7 +2396,7 @@ CU_Test(ddssec_builtin_process_handshake,extended_certificate_check) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); assert(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); // for Clang's static analyzer @@ -2477,7 +2477,7 @@ CU_Test(ddssec_builtin_process_handshake,extended_certificate_check) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* get challenge 1 from the message */ @@ -2551,7 +2551,7 @@ CU_Test(ddssec_builtin_process_handshake,extended_certificate_check) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* get challenge 1 from the message */ @@ -2641,7 +2641,7 @@ CU_Test(ddssec_builtin_process_handshake,crl) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); assert(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); // for Clang's static analyzer @@ -2680,7 +2680,7 @@ CU_Test(ddssec_builtin_process_handshake,crl) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("process_handshake failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("process_handshake failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_FAILED); diff --git a/src/security/builtin_plugins/tests/register_local_datareader/src/register_local_datareader_utests.c b/src/security/builtin_plugins/tests/register_local_datareader/src/register_local_datareader_utests.c index 920cc6ad12..2830de8279 100644 --- a/src/security/builtin_plugins/tests/register_local_datareader/src/register_local_datareader_utests.c +++ b/src/security/builtin_plugins/tests/register_local_datareader/src/register_local_datareader_utests.c @@ -228,7 +228,7 @@ CU_Test(ddssec_builtin_register_local_datareader, builtin_endpoint, .init = suit &exception); if (exception.code != 0) - printf("register_local_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datareader: %s\n", exception.message ? exception.message : "Error message missing"); /* A valid handle to be returned */ CU_ASSERT(result != 0); @@ -282,7 +282,7 @@ CU_Test(ddssec_builtin_register_local_datareader, special_endpoint_name, .init = &exception); if (exception.code != 0) - printf("register_local_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datareader: %s\n", exception.message ? exception.message : "Error message missing"); /* A valid handle to be returned */ CU_ASSERT_FATAL(result != 0); diff --git a/src/security/builtin_plugins/tests/register_local_datawriter/src/register_local_datawriter_utests.c b/src/security/builtin_plugins/tests/register_local_datawriter/src/register_local_datawriter_utests.c index ef4ba29d66..6b5eaa2f6a 100644 --- a/src/security/builtin_plugins/tests/register_local_datawriter/src/register_local_datawriter_utests.c +++ b/src/security/builtin_plugins/tests/register_local_datawriter/src/register_local_datawriter_utests.c @@ -177,7 +177,7 @@ CU_Test(ddssec_builtin_register_local_datawriter, happy_day, .init = suite_regis &exception); if (exception.code != 0) - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); /* A valid handle to be returned */ CU_ASSERT(result != 0); @@ -241,7 +241,7 @@ CU_Test(ddssec_builtin_register_local_datawriter, builtin_endpoint, .init = suit &exception); if (exception.code != 0) - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); /* A valid handle to be returned */ CU_ASSERT_FATAL(result != 0); @@ -304,7 +304,7 @@ CU_Test(ddssec_builtin_register_local_datawriter, special_endpoint_name, .init = &exception); if (exception.code != 0) - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); /* A valid handle to be returned */ CU_ASSERT_FATAL(result != 0); diff --git a/src/security/builtin_plugins/tests/register_local_participant/src/register_local_participant_utests.c b/src/security/builtin_plugins/tests/register_local_participant/src/register_local_participant_utests.c index 903b551827..48becc3e3f 100644 --- a/src/security/builtin_plugins/tests/register_local_participant/src/register_local_participant_utests.c +++ b/src/security/builtin_plugins/tests/register_local_participant/src/register_local_participant_utests.c @@ -100,7 +100,7 @@ CU_Test(ddssec_builtin_register_local_participant, happy_day, .init = suite_regi &exception); if (exception.code != 0) - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); /* A valid handle to be returned */ CU_ASSERT(hdl != DDS_SECURITY_HANDLE_NIL); @@ -148,7 +148,7 @@ CU_Test(ddssec_builtin_register_local_participant, empty_identity, .init = suite &participant_security_attributes, &exception); if (exception.code != 0) - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(exception.code == DDS_SECURITY_ERR_IDENTITY_EMPTY_CODE); CU_ASSERT_FATAL(exception.message != NULL); diff --git a/src/security/builtin_plugins/tests/register_matched_remote_datareader/src/register_matched_remote_datareader_utests.c b/src/security/builtin_plugins/tests/register_matched_remote_datareader/src/register_matched_remote_datareader_utests.c index 24289fba20..8fba0892a3 100644 --- a/src/security/builtin_plugins/tests/register_matched_remote_datareader/src/register_matched_remote_datareader_utests.c +++ b/src/security/builtin_plugins/tests/register_matched_remote_datareader/src/register_matched_remote_datareader_utests.c @@ -199,7 +199,7 @@ CU_Test(ddssec_builtin_register_remote_datareader, happy_day, .init = suite_regi &exception); if (exception.code != 0) - printf("register_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); /* A valid handle to be returned */ CU_ASSERT_FATAL(result != 0); @@ -311,7 +311,7 @@ CU_Test(ddssec_builtin_register_remote_datareader, with_origin_authentication, . &exception); if (exception.code != 0) - printf("register_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); /* A valid handle to be returned */ CU_ASSERT(result != 0); diff --git a/src/security/builtin_plugins/tests/register_matched_remote_datawriter/src/register_matched_remote_datawriter_utests.c b/src/security/builtin_plugins/tests/register_matched_remote_datawriter/src/register_matched_remote_datawriter_utests.c index 16522c65cb..29e3b7b8a0 100644 --- a/src/security/builtin_plugins/tests/register_matched_remote_datawriter/src/register_matched_remote_datawriter_utests.c +++ b/src/security/builtin_plugins/tests/register_matched_remote_datawriter/src/register_matched_remote_datawriter_utests.c @@ -297,7 +297,7 @@ CU_Test(ddssec_builtin_register_remote_datawriter, with_origin_authentication, . &exception); if (exception.code != 0) - printf("register_remote_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_remote_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); /* A valid handle to be returned */ CU_ASSERT_FATAL(result != 0); diff --git a/src/security/builtin_plugins/tests/register_matched_remote_participant/src/register_matched_remote_participant_utests.c b/src/security/builtin_plugins/tests/register_matched_remote_participant/src/register_matched_remote_participant_utests.c index ed470aed4c..49579bbb40 100644 --- a/src/security/builtin_plugins/tests/register_matched_remote_participant/src/register_matched_remote_participant_utests.c +++ b/src/security/builtin_plugins/tests/register_matched_remote_participant/src/register_matched_remote_participant_utests.c @@ -125,7 +125,7 @@ CU_Test(ddssec_builtin_register_remote_participant, happy_day, .init = suite_reg &exception); if (exception.code != 0) - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); /* A valid handle to be returned */ CU_ASSERT(remote_crypto_handle != DDS_SECURITY_HANDLE_NIL); @@ -207,7 +207,7 @@ CU_Test(ddssec_builtin_register_remote_participant, empty_identity, .init = suit &exception); if (exception.code != 0) - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(remote_crypto_handle == DDS_SECURITY_HANDLE_NIL); CU_ASSERT(exception.code == DDS_SECURITY_ERR_IDENTITY_EMPTY_CODE); diff --git a/src/security/builtin_plugins/tests/set_remote_datareader_crypto_tokens/src/set_remote_datareader_crypto_tokens_utests.c b/src/security/builtin_plugins/tests/set_remote_datareader_crypto_tokens/src/set_remote_datareader_crypto_tokens_utests.c index 2c2a128415..992fbf1a9b 100644 --- a/src/security/builtin_plugins/tests/set_remote_datareader_crypto_tokens/src/set_remote_datareader_crypto_tokens_utests.c +++ b/src/security/builtin_plugins/tests/set_remote_datareader_crypto_tokens/src/set_remote_datareader_crypto_tokens_utests.c @@ -103,7 +103,7 @@ register_local_participant(void) if (local_particpant_crypto == 0) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_particpant_crypto ? 0 : -1; @@ -126,7 +126,7 @@ register_remote_participant(void) if (remote_particpant_crypto == 0) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_particpant_crypto ? 0 : -1; @@ -155,7 +155,7 @@ register_local_datawriter(void) if (local_writer_crypto == 0) { - printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return local_writer_crypto ? 0 : -1; @@ -177,7 +177,7 @@ register_remote_datareader(void) if (remote_reader_crypto == 0) { - printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_reader_crypto ? 0 : -1; @@ -369,7 +369,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, happy_day, .init = s &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); DDS_Security_DataHolderSeq_deinit(&tokens); @@ -404,7 +404,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, single_token, .init &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); DDS_Security_DataHolderSeq_deinit(&tokens); @@ -442,7 +442,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_args, .init &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -459,7 +459,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_args, .init &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -475,7 +475,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_args, .init &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -491,7 +491,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_args, .init &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -507,7 +507,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_args, .init &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -545,7 +545,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -565,7 +565,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -586,7 +586,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -607,7 +607,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -629,7 +629,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -652,7 +652,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -693,7 +693,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -715,7 +715,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -742,7 +742,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -767,7 +767,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -792,7 +792,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -820,7 +820,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -845,7 +845,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -871,7 +871,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -899,7 +899,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -924,7 +924,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -950,7 +950,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -977,7 +977,7 @@ CU_Test(ddssec_builtin_set_remote_datareader_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datareader_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); diff --git a/src/security/builtin_plugins/tests/set_remote_datawriter_crypto_tokens/src/set_remote_datawriter_crypto_tokens_utests.c b/src/security/builtin_plugins/tests/set_remote_datawriter_crypto_tokens/src/set_remote_datawriter_crypto_tokens_utests.c index 4949b46037..b88e8f0775 100644 --- a/src/security/builtin_plugins/tests/set_remote_datawriter_crypto_tokens/src/set_remote_datawriter_crypto_tokens_utests.c +++ b/src/security/builtin_plugins/tests/set_remote_datawriter_crypto_tokens/src/set_remote_datawriter_crypto_tokens_utests.c @@ -98,7 +98,7 @@ static int register_local_participant(void) if (local_particpant_crypto == 0) { - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return local_particpant_crypto ? 0 : -1; @@ -120,7 +120,7 @@ static int register_remote_participant(void) if (remote_particpant_crypto == 0) { - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_particpant_crypto ? 0 : -1; @@ -147,7 +147,7 @@ static int register_local_datareader(void) if (local_reader_crypto == 0) { - printf("register_local_datareader: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_datareader: %s\n", exception.message ? exception.message : "Error message missing"); } return local_reader_crypto ? 0 : -1; @@ -167,7 +167,7 @@ static int register_remote_datawriter(void) if (remote_writer_crypto == 0) { - printf("register_matched_remote_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_datawriter: %s\n", exception.message ? exception.message : "Error message missing"); } return remote_writer_crypto ? 0 : -1; @@ -363,7 +363,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, happy_day, .init = s &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); DDS_Security_DataHolderSeq_deinit(&tokens); CU_ASSERT_FATAL(result); @@ -396,7 +396,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, single_token, .init &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); DDS_Security_DataHolderSeq_deinit(&tokens); CU_ASSERT_FATAL(result); @@ -430,7 +430,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_args, .init &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -446,7 +446,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_args, .init &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -462,7 +462,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_args, .init &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -478,7 +478,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_args, .init &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -494,7 +494,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_args, .init &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -531,7 +531,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -551,7 +551,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -572,7 +572,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -594,7 +594,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -615,7 +615,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -635,7 +635,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -657,7 +657,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -680,7 +680,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -703,7 +703,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_tokens, .ini &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -742,7 +742,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -764,7 +764,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -791,7 +791,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -816,7 +816,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -841,7 +841,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -869,7 +869,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -894,7 +894,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -920,7 +920,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -948,7 +948,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -973,7 +973,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -999,7 +999,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -1026,7 +1026,7 @@ CU_Test(ddssec_builtin_set_remote_datawriter_crypto_tokens, invalid_key_material &exception); if (!result) - printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_datawriter_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); diff --git a/src/security/builtin_plugins/tests/set_remote_participant_crypto_tokens/src/set_remote_participant_crypto_tokens_utests.c b/src/security/builtin_plugins/tests/set_remote_participant_crypto_tokens/src/set_remote_participant_crypto_tokens_utests.c index 16f02347e0..ec7aa42962 100644 --- a/src/security/builtin_plugins/tests/set_remote_participant_crypto_tokens/src/set_remote_participant_crypto_tokens_utests.c +++ b/src/security/builtin_plugins/tests/set_remote_participant_crypto_tokens/src/set_remote_participant_crypto_tokens_utests.c @@ -97,7 +97,7 @@ static int register_local_participant(void) &exception); if (local_crypto_handle == DDS_SECURITY_HANDLE_NIL) - printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_local_participant: %s\n", exception.message ? exception.message : "Error message missing"); return local_crypto_handle ? 0 : -1; } @@ -117,7 +117,7 @@ static int register_remote_participant(void) &exception); if (remote_crypto_handle == DDS_SECURITY_HANDLE_NIL) - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); return remote_crypto_handle ? 0 : -1; } @@ -133,7 +133,7 @@ static int create_crypto_tokens(void) remote_crypto_handle, &exception); if (!status) - printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("register_matched_remote_participant: %s\n", exception.message ? exception.message : "Error message missing"); return status ? 0 : -1; } @@ -147,21 +147,21 @@ static void unregister_participants(void) { status = crypto->crypto_key_exchange->return_crypto_tokens(crypto->crypto_key_exchange, &tokens, &exception); if (!status) - printf("return_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); } if (local_crypto_handle) { status = crypto->crypto_key_factory->unregister_participant(crypto->crypto_key_factory, local_crypto_handle, &exception); if (!status) - printf("unregister_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("unregister_participant: %s\n", exception.message ? exception.message : "Error message missing"); } if (remote_crypto_handle) { status = crypto->crypto_key_factory->unregister_participant(crypto->crypto_key_factory, remote_crypto_handle, &exception); if (!status) - printf("unregister_participant: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("unregister_participant: %s\n", exception.message ? exception.message : "Error message missing"); } } @@ -219,7 +219,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, happy_day, .init = &tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT_FATAL(result); CU_ASSERT(exception.code == 0); @@ -254,7 +254,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_args, .init NULL, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -269,7 +269,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_args, .init &tokens, &exception); if (!result) - printf("set_remote_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -284,7 +284,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_args, .init &tokens, &exception); if (!result) - printf("set_remote_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -299,7 +299,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_args, .init &tokens, &exception); if (!result) - printf("set_remote_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -314,7 +314,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_args, .init &tokens, &exception); if (!result) - printf("set_remote_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_remote_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -354,7 +354,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_tokens, .in &invalid_tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -371,7 +371,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_tokens, .in &invalid_tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -387,7 +387,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_tokens, .in &invalid_tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -404,7 +404,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_tokens, .in &invalid_tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -421,7 +421,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_tokens, .in &invalid_tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -437,7 +437,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_tokens, .in &invalid_tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -454,7 +454,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_tokens, .in &invalid_tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -472,7 +472,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_tokens, .in &invalid_tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -492,7 +492,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_tokens, .in &invalid_tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -514,7 +514,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_tokens, .in &invalid_tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); @@ -534,7 +534,7 @@ CU_Test(ddssec_builtin_set_remote_participant_crypto_tokens, invalid_tokens, .in &invalid_tokens, &exception); if (!result) - printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("set_local_participant_crypto_tokens: %s\n", exception.message ? exception.message : "Error message missing"); CU_ASSERT(!result); CU_ASSERT(exception.code != 0); diff --git a/src/security/builtin_plugins/tests/validate_begin_handshake_reply/src/validate_begin_handshake_reply_utests.c b/src/security/builtin_plugins/tests/validate_begin_handshake_reply/src/validate_begin_handshake_reply_utests.c index b411047b46..dc9fb7971c 100644 --- a/src/security/builtin_plugins/tests/validate_begin_handshake_reply/src/validate_begin_handshake_reply_utests.c +++ b/src/security/builtin_plugins/tests/validate_begin_handshake_reply/src/validate_begin_handshake_reply_utests.c @@ -552,9 +552,9 @@ validate_local_identity(const char *trusted_ca_dir, const char *crl_data) if (trusted_ca_dir != NULL) { char trusted_ca_dir_path[1024]; #ifdef WIN32 - snprintf(trusted_ca_dir_path, 1024, "%s\\validate_begin_handshake_reply\\etc\\%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); + (void) snprintf(trusted_ca_dir_path, 1024, "%s\\validate_begin_handshake_reply\\etc\\%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); #else - snprintf(trusted_ca_dir_path, 1024, "%s/validate_begin_handshake_reply/etc/%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); + (void) snprintf(trusted_ca_dir_path, 1024, "%s/validate_begin_handshake_reply/etc/%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); #endif valbuf = &participant_qos.property.value._buffer[offset++]; valbuf->name = ddsrt_strdup(DDS_SEC_PROP_ACCESS_TRUSTED_CA_DIR); @@ -579,7 +579,7 @@ validate_local_identity(const char *trusted_ca_dir, const char *crl_data) if (result != DDS_SECURITY_VALIDATION_OK) { res = -1; - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } dds_security_property_deinit(&participant_qos.property.value); @@ -617,7 +617,7 @@ release_local_identity(void) if (local_identity_handle != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, local_identity_handle, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); local_identity_handle = DDS_SECURITY_HANDLE_NIL; @@ -706,7 +706,7 @@ set_dh_public_key( if (!bio) { char *msg = get_openssl_error(); r = -1; - printf("BIO_new_mem_buf failed: %s", msg); + (void) printf("BIO_new_mem_buf failed: %s", msg); ddsrt_free(msg); goto fail_alloc_bio; } @@ -715,7 +715,7 @@ set_dh_public_key( if (!pkey) { char *msg = get_openssl_error(); r = -1; - printf("Failed to read public key: %s", msg); + (void) printf("Failed to read public key: %s", msg); ddsrt_free(msg); goto fail_key_read; } @@ -724,7 +724,7 @@ set_dh_public_key( if (!dhkey) { char *msg = get_openssl_error(); r = -1; - printf("Failed to get DH key from PKEY: %s", msg); + (void) printf("Failed to get DH key from PKEY: %s", msg); ddsrt_free(msg); goto fail_get_dhkey; } @@ -734,7 +734,7 @@ set_dh_public_key( if (!asn1int) { char *msg = get_openssl_error(); r = -1; - printf("Failed to convert DH key to ASN1 integer: %s", msg); + (void) printf("Failed to convert DH key to ASN1 integer: %s", msg); ddsrt_free(msg); goto fail_get_pubkey; } @@ -829,7 +829,7 @@ validate_remote_identities (const char *remote_id_certificate) if ((result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_REQUEST) && (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE)) { res = -1; - printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -849,7 +849,7 @@ validate_remote_identities (const char *remote_id_certificate) if ((result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_REQUEST) && (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE)) { res = -1; - printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -906,7 +906,7 @@ release_remote_identities(void) if (remote_identity_handle1 != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, remote_identity_handle1, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); remote_identity_handle1 = DDS_SECURITY_HANDLE_NIL; @@ -914,7 +914,7 @@ release_remote_identities(void) if (remote_identity_handle2 != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, remote_identity_handle2, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); remote_identity_handle2 = DDS_SECURITY_HANDLE_NIL; @@ -1272,7 +1272,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply, happy_day, .init = init_ &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -1285,7 +1285,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply, happy_day, .init = init_ CU_ASSERT_TRUE (success); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -1324,7 +1324,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,future_challenge, .init = &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -1337,7 +1337,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,future_challenge, .init = CU_ASSERT_TRUE (success); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -1378,7 +1378,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_arguments, .init &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -1396,7 +1396,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_arguments, .init &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -1414,7 +1414,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_arguments, .init &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -1432,7 +1432,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_arguments, .init &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -1450,7 +1450,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_arguments, .init &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -1468,7 +1468,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_arguments, .init &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -1486,7 +1486,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_arguments, .init &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -1529,7 +1529,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_certificate, .ini &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1555,7 +1555,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_certificate, .ini &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1600,7 +1600,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_participant_data , &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1634,7 +1634,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_participant_data , &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1679,7 +1679,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_dsign_algo , .ini &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1706,7 +1706,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_dsign_algo , .ini &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1750,7 +1750,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_kagree_algo , .in &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1777,7 +1777,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_kagree_algo , .in &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1821,7 +1821,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_diffie_hellman , &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1848,7 +1848,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_diffie_hellman , &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1909,7 +1909,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_challenge , .init &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1936,7 +1936,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,invalid_challenge , .init &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); @@ -1980,7 +1980,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,return_handle, .init = in &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL (result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -1992,7 +1992,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,return_handle, .init = in CU_ASSERT_TRUE (success); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -2002,7 +2002,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_reply,return_handle, .init = in CU_ASSERT (exception.message != NULL); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -2050,7 +2050,7 @@ CU_Test(validate_begin_handshake_reply,extended_certificate_check, .init = init &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -2063,7 +2063,7 @@ CU_Test(validate_begin_handshake_reply,extended_certificate_check, .init = init CU_ASSERT_TRUE (success); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -2189,7 +2189,7 @@ CU_Test(validate_begin_handshake_reply,crl, .init = init_testcase, .fini = fini &exception); if (result == DDS_SECURITY_VALIDATION_OK) { - printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_reply failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result != DDS_SECURITY_VALIDATION_OK); diff --git a/src/security/builtin_plugins/tests/validate_begin_handshake_request/src/validate_begin_handshake_request_utests.c b/src/security/builtin_plugins/tests/validate_begin_handshake_request/src/validate_begin_handshake_request_utests.c index 88db636114..54da59f1d7 100644 --- a/src/security/builtin_plugins/tests/validate_begin_handshake_request/src/validate_begin_handshake_request_utests.c +++ b/src/security/builtin_plugins/tests/validate_begin_handshake_request/src/validate_begin_handshake_request_utests.c @@ -295,7 +295,7 @@ validate_local_identity(void) if (result != DDS_SECURITY_VALIDATION_OK) { res = -1; - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } dds_security_property_deinit(&participant_qos.property.value); @@ -313,7 +313,7 @@ release_local_identity(void) if (local_identity_handle != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, local_identity_handle, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -356,7 +356,7 @@ validate_remote_identities (void) if ((result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_REQUEST) && (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE)) { - printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -375,7 +375,7 @@ validate_remote_identities (void) if ((result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_REQUEST) && (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE)) { - printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -398,14 +398,14 @@ release_remote_identities(void) if (remote_identity_handle1 != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, remote_identity_handle1, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } if (remote_identity_handle2 != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, remote_identity_handle2, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -586,7 +586,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,happy_day_challenge) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -601,7 +601,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,happy_day_challenge) CU_ASSERT_TRUE (success); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -637,7 +637,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,happy_day_future_challen &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL(result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -652,7 +652,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,happy_day_future_challen CU_ASSERT_TRUE (success); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -688,7 +688,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,invalid_arguments) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -705,7 +705,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,invalid_arguments) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -722,7 +722,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,invalid_arguments) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -739,7 +739,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,invalid_arguments) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -756,7 +756,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,invalid_arguments) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -795,7 +795,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,return_handle) &exception); if (result != DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE) { - printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("begin_handshake_request failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL (result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -809,7 +809,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,return_handle) CU_ASSERT_TRUE (success); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -819,7 +819,7 @@ CU_Test(ddssec_builtin_validate_begin_handshake_request,return_handle) CU_ASSERT (exception.message != NULL); if (!success) { - printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_handshake_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); diff --git a/src/security/builtin_plugins/tests/validate_local_identity/src/validate_local_identity_utests.c b/src/security/builtin_plugins/tests/validate_local_identity/src/validate_local_identity_utests.c index 3421796e9b..950c701f22 100644 --- a/src/security/builtin_plugins/tests/validate_local_identity/src/validate_local_identity_utests.c +++ b/src/security/builtin_plugins/tests/validate_local_identity/src/validate_local_identity_utests.c @@ -488,17 +488,17 @@ print_guid( { uint32_t i, j; - printf("%s=", msg); + (void) printf("%s=", msg); for (i = 0; i < 3; i++) { for (j = 0; j < 4; j++) { - printf("%02x", guid->prefix[i*4+j]); + (void) printf("%02x", guid->prefix[i*4+j]); } - printf(":"); + (void) printf(":"); } for (i = 0; i < 3; i++) { - printf("%02x", guid->entityId.entityKey[i]); + (void) printf("%02x", guid->entityId.entityKey[i]); } - printf(":%02x\n", guid->entityId.entityKind); + (void) printf(":%02x\n", guid->entityId.entityKind); } static void @@ -541,9 +541,9 @@ fill_participant_qos( valbuf->name = ddsrt_strdup(DDS_SEC_PROP_AUTH_IDENTITY_CERT); if (is_file_certificate) { #ifdef WIN32 - snprintf(identity_cert_path, 1024, "file:%s\\validate_local_identity\\etc\\%s", CONFIG_ENV_TESTS_DIR, certificate); + (void) snprintf(identity_cert_path, 1024, "file:%s\\validate_local_identity\\etc\\%s", CONFIG_ENV_TESTS_DIR, certificate); #else - snprintf(identity_cert_path, 1024, "file:%s/validate_local_identity/etc/%s", CONFIG_ENV_TESTS_DIR, certificate); + (void) snprintf(identity_cert_path, 1024, "file:%s/validate_local_identity/etc/%s", CONFIG_ENV_TESTS_DIR, certificate); #endif valbuf->value = ddsrt_strdup(identity_cert_path); } @@ -555,9 +555,9 @@ fill_participant_qos( valbuf->name = ddsrt_strdup(DDS_SEC_PROP_AUTH_IDENTITY_CA); if (is_file_ca) { #ifdef WIN32 - snprintf(identity_CA_path, 1024, "file:%s\\validate_local_identity\\etc\\%s", CONFIG_ENV_TESTS_DIR, ca); + (void) snprintf(identity_CA_path, 1024, "file:%s\\validate_local_identity\\etc\\%s", CONFIG_ENV_TESTS_DIR, ca); #else - snprintf(identity_CA_path, 1024, "file:%s/validate_local_identity/etc/%s", CONFIG_ENV_TESTS_DIR, ca); + (void) snprintf(identity_CA_path, 1024, "file:%s/validate_local_identity/etc/%s", CONFIG_ENV_TESTS_DIR, ca); #endif valbuf->value = ddsrt_strdup(identity_CA_path); } @@ -569,9 +569,9 @@ fill_participant_qos( valbuf->name = ddsrt_strdup(DDS_SEC_PROP_AUTH_PRIV_KEY); if (is_file_private_key) { #ifdef WIN32 - snprintf(private_key_path, 1024, "file:%s\\validate_local_identity\\etc\\%s", CONFIG_ENV_TESTS_DIR, private_key_data); + (void) snprintf(private_key_path, 1024, "file:%s\\validate_local_identity\\etc\\%s", CONFIG_ENV_TESTS_DIR, private_key_data); #else - snprintf(private_key_path, 1024, "file:%s/validate_local_identity/etc/%s", CONFIG_ENV_TESTS_DIR, private_key_data); + (void) snprintf(private_key_path, 1024, "file:%s/validate_local_identity/etc/%s", CONFIG_ENV_TESTS_DIR, private_key_data); #endif valbuf->value = ddsrt_strdup(private_key_path); } @@ -590,9 +590,9 @@ fill_participant_qos( valbuf->name = ddsrt_strdup(ORG_ECLIPSE_CYCLONEDDS_SEC_AUTH_CRL); if (is_file_crl) { #ifdef WIN32 - snprintf(crl_path, 1024, "file:%s\\validate_local_identity\\etc\\%s", CONFIG_ENV_TESTS_DIR, crl_data); + (void) snprintf(crl_path, 1024, "file:%s\\validate_local_identity\\etc\\%s", CONFIG_ENV_TESTS_DIR, crl_data); #else - snprintf(crl_path, 1024, "file:%s/validate_local_identity/etc/%s", CONFIG_ENV_TESTS_DIR, crl_data); + (void) snprintf(crl_path, 1024, "file:%s/validate_local_identity/etc/%s", CONFIG_ENV_TESTS_DIR, crl_data); #endif valbuf->value = ddsrt_strdup(crl_path); } @@ -604,9 +604,9 @@ fill_participant_qos( if (trusted_ca_dir) { valbuf = &participant_qos->property.value._buffer[offset++]; #ifdef WIN32 - snprintf(trusted_ca_dir_path, 1024, "%s\\validate_local_identity\\etc\\%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); + (void) snprintf(trusted_ca_dir_path, 1024, "%s\\validate_local_identity\\etc\\%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); #else - snprintf(trusted_ca_dir_path, 1024, "%s/validate_local_identity/etc/%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); + (void) snprintf(trusted_ca_dir_path, 1024, "%s/validate_local_identity/etc/%s", CONFIG_ENV_TESTS_DIR, trusted_ca_dir); #endif valbuf->name = ddsrt_strdup(DDS_SEC_PROP_ACCESS_TRUSTED_CA_DIR); valbuf->value = ddsrt_strdup(trusted_ca_dir_path); @@ -654,7 +654,7 @@ CU_Test(ddssec_builtin_validate_local_identity,happy_day) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have succeeded. */ @@ -671,7 +671,7 @@ CU_Test(ddssec_builtin_validate_local_identity,happy_day) CU_ASSERT_TRUE (success); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -698,7 +698,7 @@ CU_Test(ddssec_builtin_validate_local_identity,happy_day) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have succeeded. */ @@ -715,7 +715,7 @@ CU_Test(ddssec_builtin_validate_local_identity,happy_day) CU_ASSERT_TRUE (success); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -761,7 +761,7 @@ CU_Test(ddssec_builtin_validate_local_identity,invalid_certificate) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -796,7 +796,7 @@ CU_Test(ddssec_builtin_validate_local_identity,invalid_certificate) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -848,7 +848,7 @@ CU_Test(ddssec_builtin_validate_local_identity,invalid_root) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -881,7 +881,7 @@ CU_Test(ddssec_builtin_validate_local_identity,invalid_root) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -933,7 +933,7 @@ CU_Test(ddssec_builtin_validate_local_identity,invalid_chain) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -966,7 +966,7 @@ CU_Test(ddssec_builtin_validate_local_identity,invalid_chain) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1020,7 +1020,7 @@ CU_Test(ddssec_builtin_validate_local_identity,certificate_key_too_small) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1072,7 +1072,7 @@ CU_Test(ddssec_builtin_validate_local_identity,invalid_private_key) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1105,7 +1105,7 @@ CU_Test(ddssec_builtin_validate_local_identity,invalid_private_key) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1157,7 +1157,7 @@ CU_Test(ddssec_builtin_validate_local_identity,private_key_too_small) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1212,7 +1212,7 @@ CU_Test(ddssec_builtin_validate_local_identity,missing_certificate_property) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1271,7 +1271,7 @@ CU_Test(ddssec_builtin_validate_local_identity,missing_ca_property) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1325,7 +1325,7 @@ CU_Test(ddssec_builtin_validate_local_identity,missing_private_key_property) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1362,7 +1362,7 @@ CU_Test(ddssec_builtin_validate_local_identity,unsupported_certification_format) len = strlen("uri:") + strlen(&identity_certificate[6]) + 1; cert = ddsrt_malloc(len); - snprintf(cert, len, "uri:%s", &identity_certificate[6]); + (void) snprintf(cert, len, "uri:%s", &identity_certificate[6]); memset(&adjusted_participant_guid, 0, sizeof(adjusted_participant_guid)); memcpy(&candidate_participant_guid.prefix, &prefix, sizeof(prefix)); @@ -1385,7 +1385,7 @@ CU_Test(ddssec_builtin_validate_local_identity,unsupported_certification_format) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1438,7 +1438,7 @@ CU_Test(ddssec_builtin_validate_local_identity,encrypted_key) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have succeeded. */ @@ -1473,7 +1473,7 @@ CU_Test(ddssec_builtin_validate_local_identity,encrypted_key) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have succeeded. */ @@ -1603,7 +1603,7 @@ CU_Test(ddssec_builtin_validate_local_identity,encrypted_key_invalid_password) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1638,7 +1638,7 @@ CU_Test(ddssec_builtin_validate_local_identity,encrypted_key_invalid_password) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1690,7 +1690,7 @@ CU_Test(ddssec_builtin_validate_local_identity,happy_day_elliptic) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have succeeded. */ @@ -1707,7 +1707,7 @@ CU_Test(ddssec_builtin_validate_local_identity,happy_day_elliptic) CU_ASSERT_TRUE (success); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -1733,7 +1733,7 @@ CU_Test(ddssec_builtin_validate_local_identity,happy_day_elliptic) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have succeeded. */ @@ -1750,7 +1750,7 @@ CU_Test(ddssec_builtin_validate_local_identity,happy_day_elliptic) CU_ASSERT_TRUE (success); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -1795,7 +1795,7 @@ CU_Test(ddssec_builtin_validate_local_identity,encrypted_ec_key) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have succeeded. */ @@ -1830,7 +1830,7 @@ CU_Test(ddssec_builtin_validate_local_identity,encrypted_ec_key) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have succeeded. */ @@ -1883,7 +1883,7 @@ CU_Test(ddssec_builtin_validate_local_identity,elliptic_unsupported_certificate) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1935,7 +1935,7 @@ CU_Test(ddssec_builtin_validate_local_identity,elliptic_unsupported_private_key) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -1988,7 +1988,7 @@ CU_Test(ddssec_builtin_validate_local_identity,return_freed_handle) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have succeeded. */ @@ -2005,7 +2005,7 @@ CU_Test(ddssec_builtin_validate_local_identity,return_freed_handle) CU_ASSERT_FATAL (success); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -2015,7 +2015,7 @@ CU_Test(ddssec_builtin_validate_local_identity,return_freed_handle) CU_ASSERT (exception.message != NULL); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -2062,7 +2062,7 @@ CU_Test(ddssec_builtin_validate_local_identity,no_file) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -2094,7 +2094,7 @@ CU_Test(ddssec_builtin_validate_local_identity,no_file) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -2127,7 +2127,7 @@ CU_Test(ddssec_builtin_validate_local_identity,no_file) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -2178,7 +2178,7 @@ CU_Test(ddssec_builtin_validate_local_identity,with_extended_certificate_check) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have succeeded. */ @@ -2267,7 +2267,7 @@ CU_Test(ddssec_builtin_validate_local_identity,crl) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -2301,7 +2301,7 @@ CU_Test(ddssec_builtin_validate_local_identity,crl) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ @@ -2355,7 +2355,7 @@ CU_Test(ddssec_builtin_validate_local_identity,trusted_ca_dir_and_crl) &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } /* We expected the validation to have failed. */ diff --git a/src/security/builtin_plugins/tests/validate_local_permissions/src/validate_local_permissions_utests.c b/src/security/builtin_plugins/tests/validate_local_permissions/src/validate_local_permissions_utests.c index 3eb2802aaf..518174b011 100644 --- a/src/security/builtin_plugins/tests/validate_local_permissions/src/validate_local_permissions_utests.c +++ b/src/security/builtin_plugins/tests/validate_local_permissions/src/validate_local_permissions_utests.c @@ -272,7 +272,7 @@ static DDS_Security_IdentityHandle create_local_identity(DDS_Security_Qos *parti if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -292,7 +292,7 @@ static void clear_local_identity(DDS_Security_IdentityHandle local_id_hdl) success = g_auth->return_identity_handle(g_auth, local_id_hdl, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -487,7 +487,7 @@ static DDS_Security_long test_failure_scenario(DDS_Security_Qos *participant_qos { code = exception.code; CU_ASSERT(exception.message != NULL); - printf("validate_local_permissions failed: (%d) %s\n", (int)exception.code, exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_permissions failed: (%d) %s\n", (int)exception.code, exception.message ? exception.message : "Error message missing"); } else { @@ -651,7 +651,7 @@ CU_Test(ddssec_builtin_validate_local_permissions, valid_file, .init = suite_val CU_ASSERT(result != 0); if (result == 0) { - printf("validate_local_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } else { @@ -689,7 +689,7 @@ CU_Test(ddssec_builtin_validate_local_permissions, valid_data, .init = suite_val CU_ASSERT(result != 0); if (result == 0) { - printf("validate_local_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } else { diff --git a/src/security/builtin_plugins/tests/validate_remote_identity/src/validate_remote_identity_utests.c b/src/security/builtin_plugins/tests/validate_remote_identity/src/validate_remote_identity_utests.c index 799e570606..0a1978f7e6 100644 --- a/src/security/builtin_plugins/tests/validate_remote_identity/src/validate_remote_identity_utests.c +++ b/src/security/builtin_plugins/tests/validate_remote_identity/src/validate_remote_identity_utests.c @@ -267,7 +267,7 @@ create_local_identity(void) if (result != DDS_SECURITY_VALIDATION_OK) { res = -1; - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } dds_security_property_deinit(&participant_qos.property.value); @@ -285,7 +285,7 @@ clear_local_identity(void) if (local_identity_handle != DDS_SECURITY_HANDLE_NIL) { success = auth->return_identity_handle(auth, local_identity_handle, &exception); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -299,25 +299,25 @@ check_auth_request_token( if (notNil) { if (!token->class_id || (strcmp(token->class_id, DDS_SECURITY_AUTH_REQUEST_TOKEN_CLASS_ID) != 0)) { - printf("AuthRequestMessageToken has invalid class_id\n"); + (void) printf("AuthRequestMessageToken has invalid class_id\n"); return 0; } if (token->binary_properties._length != 1 || token->binary_properties._buffer == NULL) { - printf("AuthRequestMessageToken has binary_properties\n"); + (void) printf("AuthRequestMessageToken has binary_properties\n"); return 0; } if (!token->binary_properties._buffer[0].name || (strcmp(token->binary_properties._buffer[0].name, DDS_AUTHTOKEN_PROP_FUTURE_CHALLENGE) != 0)) { - printf("AuthRequestMessageToken has invalid property name\n"); + (void) printf("AuthRequestMessageToken has invalid property name\n"); return 0; } if (token->binary_properties._buffer[0].value._length != 32 || token->binary_properties._buffer[0].value._buffer == NULL) { - printf("AuthRequestMessageToken has invalid property value\n"); + (void) printf("AuthRequestMessageToken has invalid property value\n"); return 0; } } else { @@ -328,7 +328,7 @@ check_auth_request_token( (token->binary_properties._length != 0) || (token->binary_properties._maximum != 0) || (token->binary_properties._buffer != NULL) ) { - printf("AuthRequestMessageToken is not a TokenNil\n"); + (void) printf("AuthRequestMessageToken is not a TokenNil\n"); return 0; } } @@ -453,7 +453,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,happy_day_nil_auth_req ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_REQUEST); @@ -472,7 +472,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,happy_day_nil_auth_req ) CU_ASSERT_TRUE (success); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -512,7 +512,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,happy_day_with_auth_req ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL (result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -528,7 +528,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,happy_day_with_auth_req ) CU_ASSERT_TRUE (success); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -560,7 +560,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_parameters ) NULL, &remote_identity_handle, &local_auth_request_token, &remote_auth_request_token, local_identity_handle, &remote_identity_token, &remote_participant_guid, &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -571,7 +571,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_parameters ) auth, NULL, &local_auth_request_token, &remote_auth_request_token, local_identity_handle, &remote_identity_token, &remote_participant_guid, &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -582,7 +582,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_parameters ) auth, &remote_identity_handle, NULL, &remote_auth_request_token, local_identity_handle, &remote_identity_token, &remote_participant_guid, &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -593,7 +593,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_parameters ) auth, &remote_identity_handle, &local_auth_request_token, &remote_auth_request_token, local_identity_handle, NULL, &remote_participant_guid, &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -604,7 +604,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_parameters ) auth, &remote_identity_handle, &local_auth_request_token, &remote_auth_request_token, local_identity_handle, &remote_identity_token, NULL, &exception); if (result != DDS_SECURITY_VALIDATION_OK) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); CU_ASSERT (exception.minor_code != 0); @@ -649,7 +649,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,unknown_local_identity ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -698,7 +698,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_remote_identity_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -721,7 +721,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_remote_identity_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -773,7 +773,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_auth_req_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -797,7 +797,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_auth_req_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -820,7 +820,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_auth_req_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -846,7 +846,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_auth_req_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -870,7 +870,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_auth_req_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -894,7 +894,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_auth_req_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -922,7 +922,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_auth_req_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -947,7 +947,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_auth_req_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -972,7 +972,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,invalid_auth_req_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -1022,7 +1022,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,already_validated_same_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL (result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -1042,7 +1042,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,already_validated_same_token ) &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL (result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -1059,7 +1059,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,already_validated_same_token ) CU_ASSERT_TRUE (success); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } @@ -1100,7 +1100,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,already_validated_different_toke &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT_FATAL (result == DDS_SECURITY_VALIDATION_PENDING_HANDSHAKE_MESSAGE); @@ -1125,7 +1125,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,already_validated_different_toke &exception); if (result == DDS_SECURITY_VALIDATION_FAILED) { - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT (result == DDS_SECURITY_VALIDATION_FAILED); @@ -1143,7 +1143,7 @@ CU_Test(ddssec_builtin_validate_remote_identity,already_validated_different_toke CU_ASSERT_TRUE (success); if (!success) { - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); } diff --git a/src/security/builtin_plugins/tests/validate_remote_permissions/src/validate_remote_permissions_utests.c b/src/security/builtin_plugins/tests/validate_remote_permissions/src/validate_remote_permissions_utests.c index c1004cdfff..624a8e3541 100644 --- a/src/security/builtin_plugins/tests/validate_remote_permissions/src/validate_remote_permissions_utests.c +++ b/src/security/builtin_plugins/tests/validate_remote_permissions/src/validate_remote_permissions_utests.c @@ -306,7 +306,7 @@ static int validate_local_identity_and_permissions(void) if (result != DDS_SECURITY_VALIDATION_OK) { res = -1; - printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_identity_failed: %s\n", exception.message ? exception.message : "Error message missing"); } reset_exception(&exception); @@ -324,7 +324,7 @@ static int validate_local_identity_and_permissions(void) if (local_permissions_handle == DDS_SECURITY_HANDLE_NIL) { res = -1; - printf("validate_local_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_local_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } } @@ -342,7 +342,7 @@ static void clear_local_identity_and_permissions(void) { success = access_control->return_permissions_handle(access_control, local_permissions_handle, &exception); if (!success) - printf("return_permission_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_permission_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); reset_exception(&exception); } @@ -350,7 +350,7 @@ static void clear_local_identity_and_permissions(void) { success = auth->return_identity_handle(auth, local_identity_handle, &exception); if (!success) - printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("return_identity_handle failed: %s\n", exception.message ? exception.message : "Error message missing"); reset_exception(&exception); } } @@ -408,7 +408,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, valid_permissions, .init = s &exception); if (result == 0) - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); reset_exception(&exception); CU_ASSERT_FATAL(result != 0); access_control->return_permissions_handle(access_control, result, &exception); @@ -451,7 +451,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, permissions_unknown_ca, .ini if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(result == 0); @@ -506,7 +506,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, permissions_not_signed, .ini if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(result == 0); @@ -561,7 +561,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, invalid_credential_token, .i if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(result == 0); @@ -592,7 +592,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, invalid_credential_token, .i if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(result == 0); @@ -623,7 +623,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, invalid_credential_token, .i if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(result == 0); @@ -655,7 +655,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, invalid_credential_token, .i if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(result == 0); @@ -686,7 +686,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, invalid_credential_token, .i if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(result == 0); @@ -717,7 +717,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, invalid_credential_token, .i if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(result == 0); @@ -748,7 +748,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, invalid_credential_token, .i if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(result == 0); @@ -779,7 +779,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, invalid_credential_token, .i if (result == 0) { - printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); + (void) printf("validate_remote_permissions_failed: %s\n", exception.message ? exception.message : "Error message missing"); } CU_ASSERT(result == 0); @@ -838,7 +838,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, invalid_xml, .init = suite_v CU_ASSERT(exception.message != NULL); if (exception.message) { - printf("(%d) %s\n", (int)exception.code, exception.message); + (void) printf("(%d) %s\n", (int)exception.code, exception.message); } reset_exception(&exception); @@ -1075,7 +1075,7 @@ CU_Test(ddssec_builtin_validate_remote_permissions, corrupted_signature, .init = CU_ASSERT(exception.message != NULL); if (exception.message) { - printf("(%d) %s\n", (int)exception.code, exception.message); + (void) printf("(%d) %s\n", (int)exception.code, exception.message); } reset_exception(&exception); diff --git a/src/security/core/src/dds_security_utils.c b/src/security/core/src/dds_security_utils.c index d859b21197..f3c0299069 100644 --- a/src/security/core/src/dds_security_utils.c +++ b/src/security/core/src/dds_security_utils.c @@ -930,12 +930,12 @@ print_binary_debug( uint32_t size) { uint32_t i; - printf("%s: ",name ); + (void) printf("%s: ",name ); for( i=0; i< size; i++) { - printf("%x",value[i]); + (void) printf("%x",value[i]); } - printf("\n"); + (void) printf("\n"); } void diff --git a/src/security/core/tests/access_control.c b/src/security/core/tests/access_control.c index 0c42f9a204..53ddea7795 100644 --- a/src/security/core/tests/access_control.c +++ b/src/security/core/tests/access_control.c @@ -991,16 +991,16 @@ CU_Test(ddssec_access_control, partition) // then the deny rule and finally a default of allow for (size_t i = 0; i < sizeof (parts) / sizeof (parts[0]); i++) { - printf ("======== ALLOW:{"); + (void) printf ("======== ALLOW:{"); for (int j = 0; parts[i].allow && parts[i].allow[j]; j++) - printf (" \"%s\"", parts[i].allow[j]); - printf (" } DENY:{"); + (void) printf (" \"%s\"", parts[i].allow[j]); + (void) printf (" } DENY:{"); for (int j = 0; parts[i].deny && parts[i].deny[j]; j++) - printf (" \"%s\"", parts[i].deny[j]); - printf (" } USE:{"); + (void) printf (" \"%s\"", parts[i].deny[j]); + (void) printf (" } USE:{"); for (int j = 0; parts[i].use && parts[i].use[j]; j++) - printf (" \"%s\"", parts[i].use[j]); - printf (" } EXP_DENY: %s\n", parts[i].exp_deny ? "true" : "false"); + (void) printf (" \"%s\"", parts[i].use[j]); + (void) printf (" } EXP_DENY: %s\n", parts[i].exp_deny ? "true" : "false"); partition_test (parts[i].allow, parts[i].deny, parts[i].use, parts[i].exp_deny); } } diff --git a/src/security/core/tests/builtintopic.c b/src/security/core/tests/builtintopic.c index 9287f0b5cf..a1bdcb5162 100644 --- a/src/security/core/tests/builtintopic.c +++ b/src/security/core/tests/builtintopic.c @@ -112,5 +112,5 @@ CU_Test(ddssec_builtintopic, participant_iid) CU_ASSERT_FATAL (n == 0); } - dds_delete (domain); + (void) dds_delete (domain); } diff --git a/src/security/core/tests/common/access_control_wrapper.c b/src/security/core/tests/common/access_control_wrapper.c index a8bfb7afba..3a92cca462 100644 --- a/src/security/core/tests/common/access_control_wrapper.c +++ b/src/security/core/tests/common/access_control_wrapper.c @@ -138,7 +138,7 @@ static void unregister_return_obj (struct dds_security_access_control_impl * imp else { impl->invalid_return = true; - printf ("invalid return %p\n", obj); + (void) printf ("invalid return %p\n", obj); } ddsrt_mutex_unlock (&impl->returns_log_lock); } @@ -932,7 +932,7 @@ int finalize_test_access_control_wrapped(void *context) assert (impl->mode == PLUGIN_MODE_WRAPPED); bool returns_valid = all_returns_valid (impl); fini_returns_log (impl); - printf("returns result (impl %p): %s\n", impl, returns_valid ? "all valid" : "invalid"); + (void) printf("returns result (impl %p): %s\n", impl, returns_valid ? "all valid" : "invalid"); CU_ASSERT_FATAL (returns_valid); return finalize_test_access_control_common (impl, true); } diff --git a/src/security/core/tests/common/authentication_wrapper.c b/src/security/core/tests/common/authentication_wrapper.c index bda3566cb1..b18e8c7b78 100644 --- a/src/security/core/tests/common/authentication_wrapper.c +++ b/src/security/core/tests/common/authentication_wrapper.c @@ -65,7 +65,7 @@ static DDS_Security_ValidationResult_t test_validate_local_identity_all_ok( memcpy(adjusted_participant_guid, candidate_participant_guid, sizeof(*adjusted_participant_guid)); for (unsigned i = 0; i < participant_qos->property.value._length; i++) { - printf("%s\n", participant_qos->property.value._buffer[i].name); + (void) printf("%s\n", participant_qos->property.value._buffer[i].name); if (!strcmp(participant_qos->property.value._buffer[i].name, DDS_SEC_PROP_AUTH_PRIV_KEY)) private_key = participant_qos->property.value._buffer[i].value; else if (!strcmp(participant_qos->property.value._buffer[i].name, DDS_SEC_PROP_AUTH_IDENTITY_CA)) @@ -80,25 +80,25 @@ static DDS_Security_ValidationResult_t test_validate_local_identity_all_ok( if (strcmp(identity_certificate, test_identity_certificate)) { - printf("identity received=%s\n", identity_certificate); - printf("identity expected=%s\n", test_identity_certificate); + (void) printf("identity received=%s\n", identity_certificate); + (void) printf("identity expected=%s\n", test_identity_certificate); result = DDS_SECURITY_VALIDATION_FAILED; - printf("FAILED: Could not get identity_certificate value properly\n"); + (void) printf("FAILED: Could not get identity_certificate value properly\n"); } else if (strcmp(identity_ca, test_ca_certificate)) { - printf("ca received=%s\n", identity_ca); - printf("ca expected=%s\n", test_ca_certificate); - printf("FAILED: Could not get identity_ca value properly\n"); + (void) printf("ca received=%s\n", identity_ca); + (void) printf("ca expected=%s\n", test_ca_certificate); + (void) printf("FAILED: Could not get identity_ca value properly\n"); result = DDS_SECURITY_VALIDATION_FAILED; } else if (strcmp(private_key, test_private_key)) { - printf("FAILED: Could not get private_key value properly\n"); + (void) printf("FAILED: Could not get private_key value properly\n"); result = DDS_SECURITY_VALIDATION_FAILED; } if (result == DDS_SECURITY_VALIDATION_OK) - printf("DDS_SECURITY_VALIDATION_OK\n"); + (void) printf("DDS_SECURITY_VALIDATION_OK\n"); return result; } diff --git a/src/security/core/tests/common/cert_utils.c b/src/security/core/tests/common/cert_utils.c index 4bbf609314..473f9fba3c 100644 --- a/src/security/core/tests/common/cert_utils.c +++ b/src/security/core/tests/common/cert_utils.c @@ -43,7 +43,7 @@ static char * get_x509_data(X509 * cert) // Create BIO for writing output BIO *output_bio = BIO_new (BIO_s_mem ()); if (!PEM_write_bio_X509 (output_bio, cert)) { - printf ("Error writing certificate\n"); + (void) printf ("Error writing certificate\n"); CU_ASSERT_FATAL (false); } @@ -81,7 +81,7 @@ char * generate_ca(const char *ca_name, const char * ca_priv_key_str, int not_va EVP_PKEY *ca_priv_key = get_priv_key (ca_priv_key_str); char * email = malloc (MAX_EMAIL); - snprintf(email, MAX_EMAIL, "%s@%s" , ca_name, EMAIL_HOST); + (void) snprintf(email, MAX_EMAIL, "%s@%s" , ca_name, EMAIL_HOST); X509 * ca_cert = get_x509 (not_valid_before, not_valid_after, ca_name, email); ddsrt_free (email); @@ -107,7 +107,7 @@ char * generate_identity(const char * ca_cert_str, const char * ca_priv_key_str, X509_REQ_sign (csr, id_pkey, EVP_sha256 ()); char * email = malloc (MAX_EMAIL); - snprintf(email, MAX_EMAIL, "%s@%s" , name, EMAIL_HOST); + (void) snprintf(email, MAX_EMAIL, "%s@%s" , name, EMAIL_HOST); X509 * cert = get_x509 (not_valid_before, not_valid_after, name, email); ddsrt_free (email); diff --git a/src/security/core/tests/common/cryptography_wrapper.c b/src/security/core/tests/common/cryptography_wrapper.c index e5fef61fc6..9218bc904a 100644 --- a/src/security/core/tests/common/cryptography_wrapper.c +++ b/src/security/core/tests/common/cryptography_wrapper.c @@ -172,15 +172,15 @@ static void print_tokens (enum crypto_tokens_type type, const DDS_Security_Parti const DDS_Security_ParticipantCryptoTokenSeq *tokens) { ddsrt_mutex_lock (&g_print_token_lock); - printf ("Token type %s, local %"PRIx64" / remote %"PRIx64", count: %u\n", get_crypto_token_type_str (type), lch, rch, tokens->_length); + (void) printf ("Token type %s, local %"PRIx64" / remote %"PRIx64", count: %u\n", get_crypto_token_type_str (type), lch, rch, tokens->_length); for (uint32_t i = 0; i < tokens->_length; i++) { - printf ("- token: "); + (void) printf ("- token: "); for (uint32_t j = 0; j < tokens->_buffer[i].binary_properties._buffer[0].value._length && j < 32; j++) - printf ("%02x", tokens->_buffer[i].binary_properties._buffer[0].value._buffer[j]); - printf ("\n"); + (void) printf ("%02x", tokens->_buffer[i].binary_properties._buffer[0].value._buffer[j]); + (void) printf ("\n"); } - printf ("\n"); + (void) printf ("\n"); ddsrt_mutex_unlock (&g_print_token_lock); } @@ -209,7 +209,7 @@ static void store_tokens (struct dds_security_crypto_key_exchange_impl *impl, en { if (!check_crypto_tokens ((const DDS_Security_DataHolderSeq *) tokens)) { - printf ("%d ERROR\n", type); + (void) printf ("%d ERROR\n", type); return; } diff --git a/src/security/core/tests/common/security_config_test_utils.c b/src/security/core/tests/common/security_config_test_utils.c index 0390adf22b..c497ba60a4 100644 --- a/src/security/core/tests/common/security_config_test_utils.c +++ b/src/security/core/tests/common/security_config_test_utils.c @@ -160,7 +160,7 @@ static char * smime_sign(char * ca_cert_path, char * ca_priv_key_path, const cha BIO *ca_cert_bio = BIO_new (BIO_s_file ()); if (BIO_read_filename (ca_cert_bio, ca_cert_path) <= 0) { - printf ("Error reading CA certificate file %s\n", ca_cert_path); + (void) printf ("Error reading CA certificate file %s\n", ca_cert_path); CU_ASSERT_FATAL (false); } @@ -168,7 +168,7 @@ static char * smime_sign(char * ca_cert_path, char * ca_priv_key_path, const cha BIO *ca_priv_key_bio = BIO_new (BIO_s_file ()); if (BIO_read_filename (ca_priv_key_bio, ca_priv_key_path) <= 0) { - printf ("Error reading CA private key file %s\n", ca_priv_key_path); + (void) printf ("Error reading CA private key file %s\n", ca_priv_key_path); CU_ASSERT_FATAL (false); } @@ -179,21 +179,21 @@ static char * smime_sign(char * ca_cert_path, char * ca_priv_key_path, const cha // Read the data BIO *data_bio = BIO_new (BIO_s_mem ()); if (BIO_puts (data_bio, data) <= 0) { - printf ("Error getting configuration data for signing\n"); + (void) printf ("Error getting configuration data for signing\n"); CU_ASSERT_FATAL (false); } // Create the data signing object PKCS7 *signed_data = PKCS7_sign (ca_cert, ca_priv_key, NULL, data_bio, PKCS7_DETACHED | PKCS7_STREAM | PKCS7_TEXT); if (!signed_data) { - printf ("Error signing configuration data\n"); + (void) printf ("Error signing configuration data\n"); CU_ASSERT_FATAL (false); } // Create BIO for writing output BIO *output_bio = BIO_new (BIO_s_mem ()); if (!SMIME_write_PKCS7 (output_bio, signed_data, data_bio, PKCS7_DETACHED | PKCS7_STREAM | PKCS7_TEXT)) { - printf ("Error writing signed XML configuration\n"); + (void) printf ("Error writing signed XML configuration\n"); CU_ASSERT_FATAL (false); } @@ -237,7 +237,7 @@ static char * prefix_data (char * config_signed, bool add_prefix) static void print_config_vars(struct kvp *vars) { for (uint32_t i = 0; vars[i].key != NULL; i++) - printf("%s=%s; ", vars[i].key, vars[i].value); + (void) printf("%s=%s; ", vars[i].key, vars[i].value); } char * get_governance_topic_rule(const char * topic_expr, bool discovery_protection, bool liveliness_protection, @@ -274,7 +274,7 @@ char * get_governance_config (bool allow_unauth_pp, bool enable_join_ac, DDS_Sec print_test_msg ("governance configuration: "); print_config_vars (vars); - printf("\n"); + (void) printf("\n"); return prefix_data (config_signed, add_prefix); } diff --git a/src/security/core/tests/common/test_utils.c b/src/security/core/tests/common/test_utils.c index fde3333322..5fb85e441e 100644 --- a/src/security/core/tests/common/test_utils.c +++ b/src/security/core/tests/common/test_utils.c @@ -74,7 +74,7 @@ void print_test_msg (const char *msg, ...) { va_list args; dds_time_t t = dds_time (); - printf ("%d.%06d ", (int32_t) (t / DDS_NSECS_IN_SEC), (int32_t) (t % DDS_NSECS_IN_SEC) / 1000); + (void) printf ("%d.%06d ", (int32_t) (t / DDS_NSECS_IN_SEC), (int32_t) (t % DDS_NSECS_IN_SEC) / 1000); va_start (args, msg); vprintf (msg, args); va_end (args); @@ -408,7 +408,7 @@ void sync_writer_to_readers (dds_entity_t pp_wr, dds_entity_t wr, uint32_t exp_c if (pub_matched.total_count >= exp_count) break; }; - dds_delete (ws); + (void) dds_delete (ws); CU_ASSERT_EQUAL_FATAL (pub_matched.total_count, exp_count); } @@ -432,7 +432,7 @@ void sync_reader_to_writers (dds_entity_t pp_rd, dds_entity_t rd, uint32_t exp_c if (sub_matched.total_count >= exp_count) break; }; - dds_delete (ws); + (void) dds_delete (ws); CU_ASSERT_EQUAL_FATAL (sub_matched.total_count, exp_count); } @@ -454,7 +454,7 @@ bool reader_wait_for_data (dds_entity_t pp, dds_entity_t rd, dds_duration_t dur) ret = dds_waitset_wait (ws, &triggered, 1, dur); if (ret > 0) CU_ASSERT_EQUAL_FATAL (rd, (dds_entity_t)(intptr_t)triggered); - dds_delete (ws); + (void) dds_delete (ws); return ret > 0; } diff --git a/src/security/core/tests/config.c b/src/security/core/tests/config.c index 535b09d1af..ad6eb7b9dd 100644 --- a/src/security/core/tests/config.c +++ b/src/security/core/tests/config.c @@ -92,7 +92,7 @@ static char * extracted_line; static void logger(void *ptr, const dds_log_data_t *data) { char **expected = (char**)ptr; - fputs (data->message, stdout); + (void) fputs (data->message, stdout); for (uint32_t i = 0; expected[i] != NULL; i++) { if (ddsi2_patmatch(expected[i], data->message)) { found |= (uint32_t)(1 << i); @@ -167,7 +167,7 @@ CU_Test(ddssec_config, non, .init = ddsrt_init, .fini = ddsrt_fini) set_logger_exp(log_expected, NULL); domain = dds_create_domain(0, default_config); CU_ASSERT_FATAL(domain > 0); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); /* No security traces should have been provided. */ @@ -281,8 +281,8 @@ CU_Test(ddssec_config, all, .init = ddsrt_init, .fini = ddsrt_fini) CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, NULL, NULL); CU_ASSERT_FATAL(participant > 0); - dds_delete(participant); - dds_delete(domain); + (void) dds_delete(participant); + (void) dds_delete(domain); CU_ASSERT_FATAL(extracted_line != NULL); @@ -292,7 +292,7 @@ CU_Test(ddssec_config, all, .init = ddsrt_init, .fini = ddsrt_fini) } /* All traces should have been provided. */ - printf("found: %x\n", found); + (void) printf("found: %x\n", found); CU_ASSERT_FATAL(found == 0x1fffff); reset_logger(); @@ -365,8 +365,8 @@ CU_Test(ddssec_config, security, .init = ddsrt_init, .fini = ddsrt_fini) CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, NULL, NULL); CU_ASSERT_FATAL(participant > 0); - dds_delete(participant); - dds_delete(domain); + (void) dds_delete(participant); + (void) dds_delete(domain); CU_ASSERT_FATAL(extracted_line != NULL); @@ -450,8 +450,8 @@ CU_Test(ddssec_config, deprecated, .init = ddsrt_init, .fini = ddsrt_fini) CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, NULL, NULL); CU_ASSERT_FATAL(participant > 0); - dds_delete(participant); - dds_delete(domain); + (void) dds_delete(participant); + (void) dds_delete(domain); CU_ASSERT_FATAL(extracted_line != NULL); @@ -503,9 +503,9 @@ CU_Test(ddssec_config, qos, .init = ddsrt_init, .fini = ddsrt_fini) CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, qos, NULL); CU_ASSERT_FATAL(participant > 0); - dds_delete(participant); + (void) dds_delete(participant); dds_delete_qos(qos); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); /* All traces should have been provided. */ @@ -554,9 +554,9 @@ CU_Test(ddssec_config, qos_props, .init = ddsrt_init, .fini = ddsrt_fini) CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, qos, NULL); CU_ASSERT_FATAL(participant > 0); - dds_delete(participant); + (void) dds_delete(participant); dds_delete_qos(qos); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); /* All traces should have been provided. */ @@ -621,9 +621,9 @@ CU_Test(ddssec_config, config_qos, .init = ddsrt_init, .fini = ddsrt_fini) CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, qos, NULL); CU_ASSERT_FATAL (participant > 0); - dds_delete(participant); + (void) dds_delete(participant); dds_delete_qos(qos); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); /* All traces should have been provided. */ @@ -678,9 +678,9 @@ CU_Test(ddssec_config, other_prop, .init = ddsrt_init, .fini = ddsrt_fini) CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, qos, NULL); CU_ASSERT_FATAL (participant > 0); - dds_delete(participant); + (void) dds_delete(participant); dds_delete_qos(qos); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); /* All traces should have been provided. */ @@ -744,7 +744,7 @@ CU_Test(ddssec_config, qos_invalid, .init = ddsrt_init, .fini = ddsrt_fini) participant = dds_create_participant(0, qos, NULL); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_ERROR); dds_delete_qos(qos); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); /* All traces should have been provided. */ @@ -808,7 +808,7 @@ CU_Test(ddssec_config, qos_invalid_proprietary, .init = ddsrt_init, .fini = ddsr participant = dds_create_participant(0, qos, NULL); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_ERROR); dds_delete_qos(qos); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); /* All traces should have been provided. */ @@ -870,7 +870,7 @@ CU_Test(ddssec_config, config_qos_missing_crl, .init = ddsrt_init, .fini = ddsrt participant = dds_create_participant(0, qos, NULL); CU_ASSERT_FATAL (participant < 0); dds_delete_qos(qos); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); /* All traces should have been provided. */ @@ -962,9 +962,9 @@ CU_Test(ddssec_config, config_qos_override_crl, .init = ddsrt_init, .fini = ddsr CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, qos, NULL); CU_ASSERT_FATAL(participant > 0); - dds_delete(participant); + (void) dds_delete(participant); dds_delete_qos(qos); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); /* All traces should have been provided. */ diff --git a/src/security/core/tests/fsm.c b/src/security/core/tests/fsm.c index 6790d29a58..c3bb63e9ae 100644 --- a/src/security/core/tests/fsm.c +++ b/src/security/core/tests/fsm.c @@ -32,7 +32,7 @@ static struct dds_security_fsm_control *g_fsm_control = NULL; #define DO_SIMPLE(name, var, bit) static void name(struct dds_security_fsm *fsm, void *arg) { \ DDSRT_UNUSED_ARG(fsm); \ DDSRT_UNUSED_ARG(arg); \ - printf("Transition %s\n", __FUNCTION__); \ + (void) printf("Transition %s\n", __FUNCTION__); \ ddsrt_mutex_lock(&g_lock); \ visited_##var |= 1u << (bit); \ ddsrt_cond_broadcast(&g_cond); \ @@ -97,12 +97,12 @@ static void fsm_control_fini (void) dds_security_fsm_control_free (g_fsm_control); ddsrt_mutex_destroy (&g_lock); ddsrt_cond_destroy (&g_cond); - dds_delete (g_participant); + (void) dds_delete (g_participant); } static void a (struct dds_security_fsm *fsm, void *arg) { - printf ("[%p] Transition %s\n", fsm, __FUNCTION__); + (void) printf ("[%p] Transition %s\n", fsm, __FUNCTION__); ddsrt_mutex_lock (&g_lock); if (arg != NULL) correct_arg = *((int *) arg) == FSM_AUTH_ARG ? 1 : 0; @@ -133,7 +133,7 @@ typedef enum { static plugin_ret validate_remote_identity (void) { - printf ("validate_remote_identity - %d\n", validate_remote_identity_first); + (void) printf ("validate_remote_identity - %d\n", validate_remote_identity_first); if (validate_remote_identity_first) { validate_remote_identity_first = 0; @@ -144,7 +144,7 @@ static plugin_ret validate_remote_identity (void) static plugin_ret begin_handshake_reply (void) { - printf ("begin_handshake_reply - %d\n", begin_handshake_reply_first); + (void) printf ("begin_handshake_reply - %d\n", begin_handshake_reply_first); if (begin_handshake_reply_first) { begin_handshake_reply_first = 0; @@ -163,7 +163,7 @@ static void fsm_validate_remote_identity (struct dds_security_fsm *fsm, void *ar { DDSRT_UNUSED_ARG(arg); plugin_ret ret = validate_remote_identity (); - printf ("[%p] State %s (ret %d)\n", fsm, __FUNCTION__, (int) ret); + (void) printf ("[%p] State %s (ret %d)\n", fsm, __FUNCTION__, (int) ret); dds_security_fsm_dispatch (fsm, (int32_t) ret, false); } @@ -173,7 +173,7 @@ static void fsm_begin_handshake_reply (struct dds_security_fsm *fsm, void *arg) plugin_ret ret = begin_handshake_reply (); if (ret == VALIDATION_OK_FINAL_MESSAGE) ret = get_shared_secret (); - printf ("[%p] State %s (ret %d)\n", fsm, __FUNCTION__, (int) ret); + (void) printf ("[%p] State %s (ret %d)\n", fsm, __FUNCTION__, (int) ret); dds_security_fsm_dispatch (fsm, (int32_t) ret, false); } @@ -250,7 +250,7 @@ static void do_stuff (struct dds_security_fsm *fsm, void *arg) { DDSRT_UNUSED_ARG (fsm); DDSRT_UNUSED_ARG (arg); - printf ("Transition %s - %d\n", __FUNCTION__, do_stuff_counter); + (void) printf ("Transition %s - %d\n", __FUNCTION__, do_stuff_counter); ddsrt_mutex_lock (&g_lock); visited_test |= 1u << 2; ddsrt_cond_broadcast (&g_cond); @@ -266,7 +266,7 @@ static void do_other_stuff (struct dds_security_fsm *fsm, void *arg) { DDSRT_UNUSED_ARG (fsm); DDSRT_UNUSED_ARG (arg); - printf ("Transition %s - %d\n", __FUNCTION__, do_other_stuff_counter); + (void) printf ("Transition %s - %d\n", __FUNCTION__, do_other_stuff_counter); ddsrt_mutex_lock (&g_lock); visited_test |= 1u << 3; ddsrt_cond_broadcast (&g_cond); @@ -313,19 +313,19 @@ DO_SIMPLE (timeout_cb2, timeout, 3) static void do_timeout (struct dds_security_fsm *fsm, void *arg) { DDSRT_UNUSED_ARG (arg); - printf ("Transition >>>> %s\n", __FUNCTION__); + (void) printf ("Transition >>>> %s\n", __FUNCTION__); ddsrt_mutex_lock (&g_lock); visited_timeout |= 1u << 1; ddsrt_cond_broadcast (&g_cond); ddsrt_mutex_unlock (&g_lock); - printf ("Transition <<<< %s\n", __FUNCTION__); + (void) printf ("Transition <<<< %s\n", __FUNCTION__); dds_security_fsm_dispatch (fsm, event_to_timeout, false); } static void timeout_cb (struct dds_security_fsm *fsm, void *arg) { struct fsm_timeout_arg *farg = arg; - printf ("timeout_cb\n"); + (void) printf ("timeout_cb\n"); ddsrt_mutex_lock (&g_lock); visited_timeout |= 1u << 2; if (farg != NULL) @@ -413,7 +413,7 @@ CU_Test(ddssec_fsm, create, .init = fsm_control_init, .fini = fsm_control_fini) ddsrt_mutex_lock (&g_lock); while (!in_handshake_init_message_wait) { - printf ("waiting until handshake_init_message_wait state reached\n"); + (void) printf ("waiting until handshake_init_message_wait state reached\n"); ddsrt_cond_wait (&g_cond, &g_lock); } ddsrt_mutex_unlock (&g_lock); @@ -421,7 +421,7 @@ CU_Test(ddssec_fsm, create, .init = fsm_control_init, .fini = fsm_control_fini) while (dds_security_fsm_running (fsm_auth)) dds_sleepfor (DDS_MSECS (10)); ddsrt_mutex_lock (&g_lock); - printf ("visited_auth == 0x%x\n", visited_auth); + (void) printf ("visited_auth == 0x%x\n", visited_auth); CU_ASSERT (visited_auth == 0xff); ddsrt_mutex_unlock (&g_lock); @@ -454,7 +454,7 @@ CU_Test(ddssec_fsm, multiple, .init = fsm_control_init, .fini = fsm_control_fini ddsrt_mutex_lock (&g_lock); while (!in_handshake_init_message_wait) { - printf ("waiting until handshake_init_message_wait state reached\n"); + (void) printf ("waiting until handshake_init_message_wait state reached\n"); ddsrt_cond_wait (&g_cond, &g_lock); } ddsrt_mutex_unlock (&g_lock); @@ -462,7 +462,7 @@ CU_Test(ddssec_fsm, multiple, .init = fsm_control_init, .fini = fsm_control_fini while (dds_security_fsm_running (fsm_auth)) dds_sleepfor (DDS_MSECS (10)); ddsrt_mutex_lock (&g_lock); - printf ("visited_auth == 0x%x\n", visited_auth); + (void) printf ("visited_auth == 0x%x\n", visited_auth); CU_ASSERT (visited_auth == 0x55); ddsrt_mutex_unlock (&g_lock); @@ -470,7 +470,7 @@ CU_Test(ddssec_fsm, multiple, .init = fsm_control_init, .fini = fsm_control_fini while (dds_security_fsm_running (fsm_auth)) dds_sleepfor (DDS_MSECS (10)); ddsrt_mutex_lock (&g_lock); - printf ("visited_test == 0x%x\n", visited_test); + (void) printf ("visited_test == 0x%x\n", visited_test); CU_ASSERT (visited_test == 0x1f); ddsrt_mutex_unlock (&g_lock); @@ -540,10 +540,10 @@ CU_Test(ddssec_fsm, parallel_timeout, .init = fsm_control_init, .fini = fsm_cont dds_duration_t delta1 = time1 - time0; dds_duration_t delta2 = time2 - time0; dds_duration_t delta3 = time3 - time0; - printf ("time0 %"PRId64"\n", time0); - printf ("time1 %"PRId64", delta1 %"PRId64"\n", time1, delta1); - printf ("time2 %"PRId64", delta2 %"PRId64"\n", time2, delta2); - printf ("time3 %"PRId64", delta3 %"PRId64"\n", time3, delta3); + (void) printf ("time0 %"PRId64"\n", time0); + (void) printf ("time1 %"PRId64", delta1 %"PRId64"\n", time1, delta1); + (void) printf ("time2 %"PRId64", delta2 %"PRId64"\n", time2, delta2); + (void) printf ("time3 %"PRId64", delta3 %"PRId64"\n", time3, delta3); CU_ASSERT (delta1 > DDS_MSECS (750)); CU_ASSERT (delta1 < DDS_MSECS (1250)); CU_ASSERT (delta2 > DDS_MSECS (1750)); diff --git a/src/security/core/tests/handshake.c b/src/security/core/tests/handshake.c index 7cdc99e332..6f7365a475 100644 --- a/src/security/core/tests/handshake.c +++ b/src/security/core/tests/handshake.c @@ -179,7 +179,7 @@ CU_Test(ddssec_handshake, check_tokens) case REMOTE_READER_TOKENS: exp_type = LOCAL_READER_TOKENS; break; default: CU_FAIL ("Unexpected token type"); } - printf("- find token %s #%"PRIuSIZE", len %"PRIuSIZE"\n", get_crypto_token_type_str (token_data->type), n, token_data->data_len[n]); + (void) printf("- find token %s #%"PRIuSIZE", len %"PRIuSIZE"\n", get_crypto_token_type_str (token_data->type), n, token_data->data_len[n]); struct crypto_token_data *st = find_crypto_token (crypto_context_sub, exp_type, token_data->data[n], token_data->data_len[n]); CU_ASSERT_FATAL (st != NULL); } diff --git a/src/security/core/tests/plugin_loading.c b/src/security/core/tests/plugin_loading.c index 81b04cb920..9d2e4aa406 100644 --- a/src/security/core/tests/plugin_loading.c +++ b/src/security/core/tests/plugin_loading.c @@ -33,7 +33,7 @@ static const char *default_config = static void logger(void *ptr, const dds_log_data_t *data) { char **expected = (char **)ptr; - fputs(data->message, stdout); + (void) fputs(data->message, stdout); for (uint32_t i = 0; expected[i] != NULL; i++) { if (ddsi2_patmatch(expected[i], data->message)) @@ -96,8 +96,8 @@ CU_Test(ddssec_security_plugin_loading, all_ok, .init = ddsrt_init, .fini = ddsr CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, NULL, NULL); CU_ASSERT_FATAL(participant > 0); - dds_delete(participant); - dds_delete(domain); + (void) dds_delete(participant); + (void) dds_delete(domain); reset_logger(); CU_ASSERT_FATAL(found == 0x1); @@ -143,7 +143,7 @@ CU_Test(ddssec_security_plugin_loading, missing_finalize, .init = ddsrt_init, .f CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, NULL, NULL); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_ERROR); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); CU_ASSERT_FATAL(found == 0x3); @@ -189,7 +189,7 @@ CU_Test(ddssec_security_plugin_loading, authentication_missing_function, .init = CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, NULL, NULL); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_ERROR); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); CU_ASSERT_FATAL(found == 0x3); @@ -235,7 +235,7 @@ CU_Test(ddssec_security_plugin_loading, access_control_missing_function, .init = CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, NULL, NULL); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_ERROR); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); CU_ASSERT_FATAL(found == 0x3); @@ -281,7 +281,7 @@ CU_Test(ddssec_security_plugin_loading, cryptography_missing_function, .init = d CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, NULL, NULL); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_ERROR); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); CU_ASSERT_FATAL(found == 0x3); @@ -330,7 +330,7 @@ CU_Test(ddssec_security_plugin_loading, no_library_in_path, .init = ddsrt_init, CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, NULL, NULL); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_ERROR); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); CU_ASSERT_FATAL(found == 0x19 || found == 0x1a || found == 0x1c); @@ -377,7 +377,7 @@ CU_Test(ddssec_security_plugin_loading, init_error, .init = ddsrt_init, .fini = CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, NULL, NULL); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_ERROR); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); CU_ASSERT_FATAL(found == 0x7); @@ -422,8 +422,8 @@ CU_Test(ddssec_security_plugin_loading, all_ok_with_props, .init = ddsrt_init, . CU_ASSERT_FATAL(domain > 0); participant = dds_create_participant(0, qos, NULL); CU_ASSERT_FATAL(participant > 0); - dds_delete(participant); - dds_delete(domain); + (void) dds_delete(participant); + (void) dds_delete(domain); dds_delete_qos(qos); reset_logger(); @@ -471,7 +471,7 @@ CU_Test(ddssec_security_plugin_loading, missing_plugin_property_with_props, .ini participant = dds_create_participant(0, qos, NULL); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_ERROR); dds_delete_qos(qos); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); CU_ASSERT_FATAL(found == 0x3); @@ -518,7 +518,7 @@ CU_Test(ddssec_security_plugin_loading, empty_plugin_property_with_props, .init participant = dds_create_participant(DDS_DOMAIN_DEFAULT, qos, NULL); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_ERROR); dds_delete_qos(qos); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); CU_ASSERT_FATAL(found == 0x3); @@ -565,7 +565,7 @@ CU_Test(ddssec_security_plugin_loading, missing_security_property_with_props, .i participant = dds_create_participant(DDS_DOMAIN_DEFAULT, qos, NULL); CU_ASSERT_EQUAL_FATAL(participant, DDS_RETCODE_ERROR); dds_delete_qos(qos); - dds_delete(domain); + (void) dds_delete(domain); reset_logger(); CU_ASSERT_FATAL(found == 0x3); @@ -670,8 +670,8 @@ CU_Test(ddssec_security_plugin_loading, multiple_domains_different_config, .init CU_ASSERT_FATAL(participant2 > 0); CU_ASSERT_FATAL(participant3 > 0); dds_delete_qos(qos); - dds_delete(domain1); - dds_delete(domain2); + (void) dds_delete(domain1); + (void) dds_delete(domain2); reset_logger(); CU_ASSERT_FATAL(found == 0xf); diff --git a/src/security/core/tests/secure_communication.c b/src/security/core/tests/secure_communication.c index e006353f6a..9a51679f9d 100644 --- a/src/security/core/tests/secure_communication.c +++ b/src/security/core/tests/secure_communication.c @@ -194,7 +194,7 @@ static void test_fini(size_t n_sub_domain, size_t n_pub_domain) ret = dds_delete (g_sub_domains[d]); CU_ASSERT_EQUAL_FATAL (ret, DDS_RETCODE_OK); } - printf("Test finished\n"); + (void) printf("Test finished\n"); } static void create_eps (dds_entity_t **endpoints, dds_entity_t **topics, size_t n_dom, size_t n_pp, size_t n_eps, const char * topic_name, const dds_topic_descriptor_t *topic_descriptor, @@ -241,7 +241,7 @@ static void test_write_read(struct domain_sec_config *domain_config, dds_return_t ret; char name[100]; - printf("Testing: %"PRIuSIZE" subscriber domains, %"PRIuSIZE" pp per domain, %"PRIuSIZE" rd per pp; %"PRIuSIZE" publishing domains, %"PRIuSIZE" pp per domain, %"PRIuSIZE" wr per pp\n", + (void) printf("Testing: %"PRIuSIZE" subscriber domains, %"PRIuSIZE" pp per domain, %"PRIuSIZE" rd per pp; %"PRIuSIZE" publishing domains, %"PRIuSIZE" pp per domain, %"PRIuSIZE" wr per pp\n", n_sub_domains, n_sub_participants, n_readers, n_pub_domains, n_pub_participants, n_writers); test_init(domain_config, n_sub_domains, n_sub_participants, n_pub_domains, n_pub_participants, set_crypto_params); @@ -262,7 +262,7 @@ static void test_write_read(struct domain_sec_config *domain_config, size_t wr_index = pp_index * n_writers + w; sync_writer_to_readers (g_pub_participants[pp_index], writers[wr_index], (uint32_t)(n_sub_domains * n_sub_participants * n_readers), sync_abstimeout); sample.id = (int32_t) wr_index; - printf("writer %"PRId32" writing sample %d\n", writers[wr_index], sample.id); + (void) printf("writer %"PRId32" writing sample %d\n", writers[wr_index], sample.id); ret = dds_write (writers[wr_index], &sample); CU_ASSERT_EQUAL_FATAL (ret, DDS_RETCODE_OK); } @@ -286,7 +286,7 @@ static void test_write_read(struct domain_sec_config *domain_config, reader_wait_for_data (g_sub_participants[pp_index], readers[rd_index], DDS_SECS(5)); continue; } - printf("reader %"PRId32" received sample %d\n", readers[rd_index], rd_sample.id); + (void) printf("reader %"PRId32" received sample %d\n", readers[rd_index], rd_sample.id); CU_ASSERT_EQUAL_FATAL (ret, 1); CU_ASSERT_EQUAL_FATAL (rd_sample.value, 1); n_samples--; diff --git a/src/security/core/tests/timed_cb.c b/src/security/core/tests/timed_cb.c index d68e878142..ba95972059 100644 --- a/src/security/core/tests/timed_cb.c +++ b/src/security/core/tests/timed_cb.c @@ -78,7 +78,7 @@ static void setup(void) static void teardown(void) { - dds_delete(pp); + (void) dds_delete(pp); } static void simple_callback(dds_security_time_event_handle_t timer, dds_time_t trigger_time, dds_security_timed_cb_kind_t kind, void *arg) @@ -106,7 +106,7 @@ static void test_callback(dds_security_time_event_handle_t timer, dds_time_t tri DDSRT_UNUSED_ARG(timer); - printf("event %"PRIu64" triggered\n", timer); + (void) printf("event %"PRIu64" triggered\n", timer); if (test_seq->index < test_seq->size) { @@ -242,7 +242,7 @@ CU_Test(ddssec_timed_cb, test_create_dispatcher, .init = setup, .fini = teardown } /* The sleeps are added to get the timing between 'present' and 'past' callbacks right. */ - printf("before enable\n"); + (void) printf("before enable\n"); dds_sleepfor(DDS_MSECS(300)); dds_security_timed_dispatcher_enable(d); dds_sleepfor(DDS_MSECS(900)); @@ -250,7 +250,7 @@ CU_Test(ddssec_timed_cb, test_create_dispatcher, .init = setup, .fini = teardown if (test_seq_data.index >= test_seq_data.size) { - printf("Unexpected number of triggers: %u vs %u\n", test_seq_data.index, test_seq_data.size); + (void) printf("Unexpected number of triggers: %u vs %u\n", test_seq_data.index, test_seq_data.size); CU_FAIL_FATAL("Unexpected number of triggers"); } @@ -258,25 +258,25 @@ CU_Test(ddssec_timed_cb, test_create_dispatcher, .init = setup, .fini = teardown { if (expected[i].kind != received[i].kind) { - printf("Unexpected kind at %u: %d vs %d\n", i, received[i].kind, expected[i].kind); + (void) printf("Unexpected kind at %u: %d vs %d\n", i, received[i].kind, expected[i].kind); CU_FAIL_FATAL("Unexpected kind"); } if (expected[i].kind == EVENT_TRIGGERED) { if (expected[i].timer != received[i].timer) { - printf("Unexpected ordering at %u: %"PRIu64" vs %"PRIu64"\n", i, received[i].timer, expected[i].timer); + (void) printf("Unexpected ordering at %u: %"PRIu64" vs %"PRIu64"\n", i, received[i].timer, expected[i].timer); CU_FAIL_FATAL("Unexpected ordering"); } if (expected[i].trigger_time != received[i].trigger_time) { - printf("Unexpected trigger_time at %u: %"PRId64" vs %"PRId64"\n", i, received[i].trigger_time, expected[i].trigger_time); + (void) printf("Unexpected trigger_time at %u: %"PRId64" vs %"PRId64"\n", i, received[i].trigger_time, expected[i].trigger_time); CU_FAIL_FATAL("Unexpected trigger_time"); } } } - printf("before disable\n"); + (void) printf("before disable\n"); dds_security_timed_dispatcher_free(d); dds_sleepfor(DDS_MSECS(200)); @@ -285,19 +285,19 @@ CU_Test(ddssec_timed_cb, test_create_dispatcher, .init = setup, .fini = teardown if (expected[i].kind != received[i].kind) { - printf("Unexpected kind at %u: %d vs %d\n", i, received[i].kind, expected[i].kind); + (void) printf("Unexpected kind at %u: %d vs %d\n", i, received[i].kind, expected[i].kind); CU_FAIL_FATAL("Unexpected kind"); } if (expected[i].kind == EVENT_DELETED) { if (expected[i].timer != received[i].timer) { - printf("Unexpected ordering at %u: %"PRIu64" vs %"PRIu64"\n", i, received[i].timer, expected[i].timer); + (void) printf("Unexpected ordering at %u: %"PRIu64" vs %"PRIu64"\n", i, received[i].timer, expected[i].timer); CU_FAIL_FATAL("Unexpected ordering"); } if (expected[i].trigger_time != received[i].trigger_time) { - printf("Unexpected trigger_time at %u: %"PRId64" vs %"PRId64"\n", i, received[i].trigger_time, expected[i].trigger_time); + (void) printf("Unexpected trigger_time at %u: %"PRId64" vs %"PRId64"\n", i, received[i].trigger_time, expected[i].trigger_time); CU_FAIL_FATAL("Unexpected trigger_time"); } } @@ -351,19 +351,19 @@ CU_Test(ddssec_timed_cb, test_remove_timer, .init = setup, .fini = teardown) { if (expected[i].kind != received[i].kind) { - printf("Unexpected kind at %u: %d vs %d\n", i, received[i].kind, expected[i].kind); + (void) printf("Unexpected kind at %u: %d vs %d\n", i, received[i].kind, expected[i].kind); CU_FAIL_FATAL("Unexpected kind"); } if (expected[i].kind == EVENT_TRIGGERED) { if (expected[i].timer != received[i].timer) { - printf("Unexpected ordering at %u: %"PRIu64" vs %"PRIu64"\n", i, received[i].timer, expected[i].timer); + (void) printf("Unexpected ordering at %u: %"PRIu64" vs %"PRIu64"\n", i, received[i].timer, expected[i].timer); CU_FAIL_FATAL("Unexpected ordering"); } if (expected[i].trigger_time != received[i].trigger_time) { - printf("Unexpected trigger_time at %u: %"PRId64" vs %"PRId64"\n", i, received[i].trigger_time, expected[i].trigger_time); + (void) printf("Unexpected trigger_time at %u: %"PRId64" vs %"PRId64"\n", i, received[i].trigger_time, expected[i].trigger_time); CU_FAIL_FATAL("Unexpected trigger_time"); } } diff --git a/src/tools/_confgen/_confgen.c b/src/tools/_confgen/_confgen.c index c5649ca47e..19853c2eb8 100644 --- a/src/tools/_confgen/_confgen.c +++ b/src/tools/_confgen/_confgen.c @@ -136,7 +136,7 @@ void printspc(FILE *out, unsigned int cols, const char *fmt, ...) va_list ap; assert((size_t)cols < sizeof(spaces)); spaces[cols] = '\0'; - fprintf(out, "%s", spaces); + (void) fprintf(out, "%s", spaces); spaces[cols] = ' '; va_start(ap, fmt); vfprintf(out, fmt, ap); @@ -146,7 +146,7 @@ void printspc(FILE *out, unsigned int cols, const char *fmt, ...) static void usage(const char *prog) { static const char fmt[] = "usage: %s [OPTIONS] -f FORMAT\n"; - fprintf(stderr, fmt, prog); + (void) fprintf(stderr, fmt, prog); } static void help(const char *prog) @@ -160,7 +160,7 @@ OPTIONS:\n\ -o FILENAME output file. specify - to use stdout\n\ "; - fprintf(stdout, fmt, prog); + (void) fprintf(stdout, fmt, prog); } struct cfgelem *nextelem(const struct cfgelem *list, const struct cfgelem *elem) @@ -549,13 +549,13 @@ int makedescription( size_t srcsz = 3 + strlen(DFLTFMT) + strlen(elem->description) + strlen(unit->description) + strlen(dflt); if ((src = malloc (srcsz)) == NULL) return -1; - snprintf( + (void) snprintf( src, srcsz, "%s\n%s\n"DFLTFMT, elem->description, unit->description, dflt); } else { size_t srcsz = 2 + strlen(DFLTFMT) + strlen(elem->description) + strlen(dflt); if ((src = malloc (srcsz)) == NULL) return -1; - snprintf( + (void) snprintf( src, srcsz, "%s\n"DFLTFMT, elem->description, dflt); } } @@ -630,7 +630,7 @@ int main(int argc, char *argv[]) } else if (strcmp(optarg, "defconfig") == 0) { format = defconfig; } else { - fprintf(stderr, "illegal output format: %s\n", optarg); + (void) fprintf(stderr, "illegal output format: %s\n", optarg); usage(argv[0]); exit(EXIT_FAILURE); } @@ -649,7 +649,7 @@ int main(int argc, char *argv[]) } if (init(cyclonedds_root_cfgelems) == -1) { - fprintf(stderr, "out of memory\n"); + (void) fprintf(stderr, "out of memory\n"); goto exit_failure; } @@ -657,7 +657,7 @@ int main(int argc, char *argv[]) if (strcmp(file, "-") == 0) { out = stdout; } else if ((out = fopen(file, "wb")) == NULL) { - fprintf(stderr, "cannot open %s for writing\n", file); + (void) fprintf(stderr, "cannot open %s for writing\n", file); goto exit_failure; } DDSRT_WARNING_MSVC_ON(4996) diff --git a/src/tools/_confgen/generate_defconfig.c b/src/tools/_confgen/generate_defconfig.c index be888cca49..750500825d 100644 --- a/src/tools/_confgen/generate_defconfig.c +++ b/src/tools/_confgen/generate_defconfig.c @@ -32,51 +32,51 @@ void gendef_pf_uint16 (FILE *out, void *parent, struct cfgelem const * const cfg { const uint16_t *p = cfg_address (parent, cfgelem); if (*p != 0) - fprintf (out, " cfg->%s = UINT16_C (%"PRIu16");\n", cfgelem->membername, *p); + (void) fprintf (out, " cfg->%s = UINT16_C (%"PRIu16");\n", cfgelem->membername, *p); } void gendef_pf_int32 (FILE *out, void *parent, struct cfgelem const * const cfgelem) { const int32_t *p = cfg_address (parent, cfgelem); if (*p != 0) - fprintf (out, " cfg->%s = INT32_C (%"PRId32");\n", cfgelem->membername, *p); + (void) fprintf (out, " cfg->%s = INT32_C (%"PRId32");\n", cfgelem->membername, *p); } void gendef_pf_uint32 (FILE *out, void *parent, struct cfgelem const * const cfgelem) { const uint32_t *p = cfg_address (parent, cfgelem); if (*p != 0) - fprintf (out, " cfg->%s = UINT32_C (%"PRIu32");\n", cfgelem->membername, *p); + (void) fprintf (out, " cfg->%s = UINT32_C (%"PRIu32");\n", cfgelem->membername, *p); } void gendef_pf_int64 (FILE *out, void *parent, struct cfgelem const * const cfgelem) { const int64_t *p = cfg_address (parent, cfgelem); if (*p != 0) - fprintf (out, " cfg->%s = INT64_C (%"PRId64");\n", cfgelem->membername, *p); + (void) fprintf (out, " cfg->%s = INT64_C (%"PRId64");\n", cfgelem->membername, *p); } void gendef_pf_maybe_int32 (FILE *out, void *parent, struct cfgelem const * const cfgelem) { struct ddsi_config_maybe_int32 const * const p = cfg_address (parent, cfgelem); - fprintf (out, " cfg->%s.isdefault = %d;\n", cfgelem->membername, p->isdefault); + (void) fprintf (out, " cfg->%s.isdefault = %d;\n", cfgelem->membername, p->isdefault); if (!p->isdefault) - fprintf (out, " cfg->%s.value = INT32_C (%"PRId32");\n", cfgelem->membername, p->value); + (void) fprintf (out, " cfg->%s.value = INT32_C (%"PRId32");\n", cfgelem->membername, p->value); } void gendef_pf_maybe_uint32 (FILE *out, void *parent, struct cfgelem const * const cfgelem) { struct ddsi_config_maybe_uint32 const * const p = cfg_address (parent, cfgelem); - fprintf (out, " cfg->%s.isdefault = %d;\n", cfgelem->membername, p->isdefault); + (void) fprintf (out, " cfg->%s.isdefault = %d;\n", cfgelem->membername, p->isdefault); if (!p->isdefault) - fprintf (out, " cfg->%s.value = UINT32_C (%"PRIu32");\n", cfgelem->membername, p->value); + (void) fprintf (out, " cfg->%s.value = UINT32_C (%"PRIu32");\n", cfgelem->membername, p->value); } void gendef_pf_min_tls_version (FILE *out, void *parent, struct cfgelem const * const cfgelem) { struct ddsi_config_ssl_min_version * const p = cfg_address (parent, cfgelem); if (p->major != 0 || p->minor != 0) - fprintf (out, "\ + (void) fprintf (out, "\ cfg->%s.major = %d;\n\ cfg->%s.minor = %d;\n", cfgelem->membername, p->major, cfgelem->membername, p->minor); @@ -86,7 +86,7 @@ void gendef_pf_string (FILE *out, void *parent, struct cfgelem const * const cfg { const char **p = cfg_address (parent, cfgelem); if (*p != 0) - fprintf (out, " cfg->%s = \"%s\";\n", cfgelem->membername, *p); + (void) fprintf (out, " cfg->%s = \"%s\";\n", cfgelem->membername, *p); } void gendef_pf_networkAddresses (FILE *out, void *parent, struct cfgelem const * const cfgelem) @@ -97,11 +97,11 @@ void gendef_pf_networkAddresses (FILE *out, void *parent, struct cfgelem const * int n = 0; for (int i = 0; (*p)[i] != NULL; i++) n++; - fprintf (out, " static char *%s_init_[] = {\n", cfgelem->membername); + (void) fprintf (out, " static char *%s_init_[] = {\n", cfgelem->membername); for (int i = 0; (*p)[i] != NULL; i++) - fprintf (out, " \"%s\",\n", (*p)[i]); - fprintf (out, " NULL\n };\n"); - fprintf (out, " cfg->%s = %s_init_;\n", cfgelem->membername, cfgelem->membername); + (void) fprintf (out, " \"%s\",\n", (*p)[i]); + (void) fprintf (out, " NULL\n };\n"); + (void) fprintf (out, " cfg->%s = %s_init_;\n", cfgelem->membername, cfgelem->membername); } } @@ -114,7 +114,7 @@ void gendef_pf_tracemask (FILE *out, void *parent, struct cfgelem const * const (void) cfgelem; const struct ddsi_config *cfg = parent; if (cfg->tracemask != 0) - fprintf (out, " cfg->tracemask = UINT32_C (%"PRIu32");\n", cfg->tracemask); + (void) fprintf (out, " cfg->tracemask = UINT32_C (%"PRIu32");\n", cfg->tracemask); } void gendef_pf_xcheck (FILE *out, void *parent, struct cfgelem const * const cfgelem) { @@ -199,7 +199,7 @@ static void gen_defaults (FILE *out, void *parent, struct cfgelem const * const continue; if (ce->meta.flag) - fprintf(out, "#ifdef %s\n", ce->meta.flag); + (void) fprintf(out, "#ifdef %s\n", ce->meta.flag); if (ce->multiplicity <= 1) { @@ -230,7 +230,7 @@ static void gen_defaults (FILE *out, void *parent, struct cfgelem const * const #endif } if (ce->meta.flag) - fprintf(out, "#endif /* %s */\n", ce->meta.flag); + (void) fprintf(out, "#endif /* %s */\n", ce->meta.flag); } } @@ -241,11 +241,11 @@ int printdefconfig (FILE *out, struct cfgelem *elem) if ((cfgst = ddsi_config_init ("", &cfg, 0)) == NULL) { - fprintf (stderr, "Failed to initialize default configuration\n"); + (void) fprintf (stderr, "Failed to initialize default configuration\n"); return -1; } - fprintf (out, "\ + (void) fprintf (out, "\ #include \n\ #include \n\ #include \n\ @@ -255,7 +255,7 @@ void ddsi_config_init_default (struct ddsi_config *cfg)\n\ {\n\ memset (cfg, 0, sizeof (*cfg));\n"); gen_defaults (out, &cfg, elem); - fprintf (out, "}\n"); + (void) fprintf (out, "}\n"); ddsi_config_fini (cfgst); return 0; diff --git a/src/tools/_confgen/generate_md.c b/src/tools/_confgen/generate_md.c index 61f2834d82..94a42c3879 100644 --- a/src/tools/_confgen/generate_md.c +++ b/src/tools/_confgen/generate_md.c @@ -65,7 +65,7 @@ static void printhead( (void)units; assert(level < (sizeof(hashes) - 1)); hashes[level+1] = '\0'; - fprintf(out, "%s %s\n", hashes, elem->meta.title); + (void) fprintf(out, "%s %s\n", hashes, elem->meta.title); hashes[level+1] = '#'; } @@ -103,32 +103,32 @@ static void printtype( (void)units; assert(!isgroup(elem)); if (isbool(elem)) { - fputs("Boolean\n", out); + (void) fputs("Boolean\n", out); } else if (islist(elem)) { assert(elem->meta.values); - fputs("One of:\n", out); + (void) fputs("One of:\n", out); if (elem->value && strlen(elem->value)) - fprintf(out, "* Keyword: %s\n", elem->value); - fputs("* Comma-separated list of: ", out); + (void) fprintf(out, "* Keyword: %s\n", elem->value); + (void) fputs("* Comma-separated list of: ", out); for (const char **v = elem->meta.values; *v; v++) { - fprintf(out, "%s%s", v == elem->meta.values ? "" : ", ", *v); + (void) fprintf(out, "%s%s", v == elem->meta.values ? "" : ", ", *v); } - fputs("\n", out); + (void) fputs("\n", out); if (!elem->value || !strlen(elem->value)) - fputs("* Or empty\n", out); + (void) fputs("* Or empty\n", out); } else if (isenum(elem)) { assert(elem->meta.values); - fputs("One of: ", out); + (void) fputs("One of: ", out); for (const char **v = elem->meta.values; *v; v++) { - fprintf(out, "%s%s", v == elem->meta.values ? "" : ", ", *v); + (void) fprintf(out, "%s%s", v == elem->meta.values ? "" : ", ", *v); } - fputs("\n", out); + (void) fputs("\n", out); } else if (isint(elem)) { - fputs("Integer\n", out); + (void) fputs("Integer\n", out); } else if (elem->meta.unit) { - fputs("Number-with-unit\n", out); + (void) fputs("Number-with-unit\n", out); } else if (isstring(elem)) { - fputs("Text\n", out); + (void) fputs("Text\n", out); } } @@ -142,13 +142,13 @@ static void printattr( const struct cfgunit *units) { if (flags & FLAG_LF) - fputs("\n\n", out); + (void) fputs("\n\n", out); printhead(out, level, flags, elem, units); printtype(out, level, flags, elem, units); - fputs("\n", out); + (void) fputs("\n", out); if (elem->description) { - fputs(elem->meta.description, out); - fputs("\n", out); + (void) fputs(elem->meta.description, out); + (void) fputs("\n", out); } } @@ -160,7 +160,7 @@ static void printelem( const struct cfgunit *units) { if (flags & FLAG_LF) - fputs("\n\n", out); + (void) fputs("\n\n", out); printhead(out, level, flags, elem, units); flags &= ~FLAG_LF; if (hasattributes(elem)) { @@ -169,16 +169,16 @@ static void printelem( struct cfgelem *ce = firstelem(elem->attributes); while (ce) { if (!isnop(ce)) { - fprintf(out, "%s[%s](", sep, name(ce)); + (void) fprintf(out, "%s[%s](", sep, name(ce)); printlink(out, level, flags, ce, units); - fprintf(out, ")"); + (void) fprintf(out, ")"); sep = ", "; cnt++; } ce = nextelem(elem->attributes, ce); } if (cnt != 0) { - fputs("\n", out); + (void) fputs("\n", out); flags |= FLAG_LF; } } @@ -186,25 +186,25 @@ static void printelem( const char *sep = "Children: "; struct cfgelem *ce = firstelem(elem->children); while (ce) { - fprintf(out, "%s[%s](", sep, name(ce)); + (void) fprintf(out, "%s[%s](", sep, name(ce)); printlink(out, level, flags, ce, units); - fprintf(out, ")"); + (void) fprintf(out, ")"); sep = ", "; ce = nextelem(elem->children, ce); } - fputs("\n", out); + (void) fputs("\n", out); flags |= FLAG_LF; } else if (!isgroup(elem)) { if (flags & FLAG_LF) - fputs("\n", out); + (void) fputs("\n", out); printtype(out, level+1, flags, elem, units); flags |= FLAG_LF; } if (elem->description) { if (flags & FLAG_LF) - fputs("\n", out); - fputs(elem->meta.description, out); - fputs("\n", out); + (void) fputs("\n", out); + (void) fputs(elem->meta.description, out); + (void) fputs("\n", out); } if (hasattributes(elem)) { struct cfgelem *ce = firstelem(elem->attributes); diff --git a/src/tools/_confgen/generate_rnc.c b/src/tools/_confgen/generate_rnc.c index 5a6c3d1c26..74fda010b8 100644 --- a/src/tools/_confgen/generate_rnc.c +++ b/src/tools/_confgen/generate_rnc.c @@ -75,7 +75,7 @@ printattr( assert(!ismoved(elem) && !isdeprecated(elem)); if (elem->description != NULL) { printspc(out, cols, docfmt, amp[(flags & FLAG_AMP)]); - fputs(elem->meta.description, out); + (void) fputs(elem->meta.description, out); printspc(out, 0, "\"\"\" ] ]\n"); flags &= ~FLAG_AMP; } @@ -97,7 +97,7 @@ static void printelem( if (elem->description != NULL) { printspc(out, cols, docfmt, amp[(flags & FLAG_AMP)]); - fputs(elem->meta.description, out); + (void) fputs(elem->meta.description, out); printspc(out, 0, "\"\"\" ] ]\n"); flags &= ~FLAG_AMP; } diff --git a/src/tools/_confgen/generate_rst.c b/src/tools/_confgen/generate_rst.c index e933763c78..f0efa291ce 100644 --- a/src/tools/_confgen/generate_rst.c +++ b/src/tools/_confgen/generate_rst.c @@ -64,10 +64,10 @@ static void printhead( (void)flags; (void)units; assert(level < (sizeof(headerchars) - 1)); - fprintf(out, ".. _`%s`:\n\n%s\n", elem->meta.title, elem->meta.title); + (void) fprintf(out, ".. _`%s`:\n\n%s\n", elem->meta.title, elem->meta.title); for(size_t i = strlen(elem->meta.title); i > 0; --i) fputc(headerchars[level], out); - fputs("\n\n", out); + (void) fputs("\n\n", out); } static void printlink( @@ -81,7 +81,7 @@ static void printlink( (void)flags; (void)units; assert(elem->meta.title); - fprintf(out, "`%s`_", elem->meta.title); + (void) fprintf(out, "`%s`_", elem->meta.title); } static void printtype( @@ -96,32 +96,32 @@ static void printtype( (void)units; assert(!isgroup(elem)); if (isbool(elem)) { - fputs("Boolean\n", out); + (void) fputs("Boolean\n", out); } else if (islist(elem)) { assert(elem->meta.values); - fputs("One of:\n", out); + (void) fputs("One of:\n", out); if (elem->value && strlen(elem->value)) - fprintf(out, "* Keyword: %s\n", elem->value); - fputs("* Comma-separated list of: ", out); + (void) fprintf(out, "* Keyword: %s\n", elem->value); + (void) fputs("* Comma-separated list of: ", out); for (const char **v = elem->meta.values; *v; v++) { - fprintf(out, "%s%s", v == elem->meta.values ? "" : ", ", *v); + (void) fprintf(out, "%s%s", v == elem->meta.values ? "" : ", ", *v); } - fputs("\n", out); + (void) fputs("\n", out); if (!elem->value || !strlen(elem->value)) - fputs("* Or empty\n", out); + (void) fputs("* Or empty\n", out); } else if (isenum(elem)) { assert(elem->meta.values); - fputs("One of: ", out); + (void) fputs("One of: ", out); for (const char **v = elem->meta.values; *v; v++) { - fprintf(out, "%s%s", v == elem->meta.values ? "" : ", ", *v); + (void) fprintf(out, "%s%s", v == elem->meta.values ? "" : ", ", *v); } - fputs("\n", out); + (void) fputs("\n", out); } else if (isint(elem)) { - fputs("Integer\n", out); + (void) fputs("Integer\n", out); } else if (elem->meta.unit) { - fputs("Number-with-unit\n", out); + (void) fputs("Number-with-unit\n", out); } else if (isstring(elem)) { - fputs("Text\n", out); + (void) fputs("Text\n", out); } } @@ -135,13 +135,13 @@ static void printattr( const struct cfgunit *units) { if (flags & FLAG_LF) - fputs("\n\n", out); + (void) fputs("\n\n", out); printhead(out, level, flags, elem, units); printtype(out, level, flags, elem, units); - fputs("\n", out); + (void) fputs("\n", out); if (elem->description) { - fputs(elem->meta.description, out); - fputs("\n", out); + (void) fputs(elem->meta.description, out); + (void) fputs("\n", out); } } @@ -153,7 +153,7 @@ static void printelem( const struct cfgunit *units) { if (flags & FLAG_LF) - fputs("\n\n", out); + (void) fputs("\n\n", out); printhead(out, level, flags, elem, units); flags &= ~FLAG_LF; if (hasattributes(elem)) { @@ -162,16 +162,16 @@ static void printelem( struct cfgelem *ce = firstelem(elem->attributes); while (ce) { if (!isnop(ce)) { - fprintf(out, "%s[%s](", sep, name(ce)); + (void) fprintf(out, "%s[%s](", sep, name(ce)); printlink(out, level, flags, ce, units); - fprintf(out, ")"); + (void) fprintf(out, ")"); sep = ", "; cnt++; } ce = nextelem(elem->attributes, ce); } if (cnt != 0) { - fputs("\n", out); + (void) fputs("\n", out); flags |= FLAG_LF; } } @@ -179,24 +179,24 @@ static void printelem( const char *sep = "Children: "; struct cfgelem *ce = firstelem(elem->children); while (ce) { - fputs(sep, out); + (void) fputs(sep, out); printlink(out, level, flags, ce, units); sep = ", "; ce = nextelem(elem->children, ce); } - fputs("\n", out); + (void) fputs("\n", out); flags |= FLAG_LF; } else if (!isgroup(elem)) { if (flags & FLAG_LF) - fputs("\n", out); + (void) fputs("\n", out); printtype(out, level+1, flags, elem, units); flags |= FLAG_LF; } if (elem->description) { if (flags & FLAG_LF) - fputs("\n", out); - fputs(elem->meta.description, out); - fputs("\n", out); + (void) fputs("\n", out); + (void) fputs(elem->meta.description, out); + (void) fputs("\n", out); } if (hasattributes(elem)) { struct cfgelem *ce = firstelem(elem->attributes); @@ -279,13 +279,14 @@ int printrst(FILE *out, struct cfgelem *elem, const struct cfgunit *units) return -1; if (maketitles(elem, 0, "/", 1) == -1) return -1; - fputs( + if (fputs( ".. _`configuration_reference`:\n\n" "****************************\n" "Configuration File Reference\n" "****************************\n\n" "Below is the full (generated) reference of XML you can use to configure |var-project|. " - "The title of each section is the XML XPath notation to the relevant option.\n\n", out); + "The title of each section is the XML XPath notation to the relevant option.\n\n", out) < 0) + return -1; printelem(out, 0u, 0u, elem, units); return 0; } diff --git a/src/tools/_confgen/generate_xsd.c b/src/tools/_confgen/generate_xsd.c index 2ebda1c6b6..5f973a5aeb 100644 --- a/src/tools/_confgen/generate_xsd.c +++ b/src/tools/_confgen/generate_xsd.c @@ -66,8 +66,8 @@ printdesc( assert(elem->meta.description); printspc(out, cols+0, "\n"); printspc(out, cols+2, "\n"); - fputs(elem->meta.description, out); - fputs("\n", out); + (void) fputs(elem->meta.description, out); + (void) fputs("\n", out); printspc(out, cols+0, "\n"); } @@ -127,13 +127,13 @@ printattr( type[0] = '\0'; if (elem->meta.unit) - snprintf(type, sizeof(type), " type=\"config:%s\"", elem->meta.unit); + (void) snprintf(type, sizeof(type), " type=\"config:%s\"", elem->meta.unit); else if (!isstring(elem)) - snprintf(type, sizeof(type), " type=\"xs:%s\"", isbuiltintopic(elem)); + (void) snprintf(type, sizeof(type), " type=\"xs:%s\"", isbuiltintopic(elem)); required[0] = '\0'; if (minimum(elem)) - snprintf(type, sizeof(type), " use=\"required\""); + (void) snprintf(type, sizeof(type), " use=\"required\""); printspc(out, cols, fmt, name(elem), type, required); printdesc(out, cols+2, flags, elem, units); @@ -162,11 +162,11 @@ printref( char maxattr[32] = ""; const char fmt[] = "\n"; if (!(flags & FLAG_NOMIN) && minimum(elem) != 1) - snprintf(minattr, sizeof(minattr), "minOccurs=\"%d\" ", minimum(elem)); + (void) snprintf(minattr, sizeof(minattr), "minOccurs=\"%d\" ", minimum(elem)); if (!(flags & FLAG_NOMAX) && maximum(elem) == 0) - snprintf(maxattr, sizeof(maxattr), "maxOccurs=\"unbounded\" "); + (void) snprintf(maxattr, sizeof(maxattr), "maxOccurs=\"unbounded\" "); else if (!(flags & FLAG_NOMAX) && maximum(elem) != 1) - snprintf(maxattr, sizeof(maxattr), "maxOccurs=\"%d\" ", maximum(elem)); + (void) snprintf(maxattr, sizeof(maxattr), "maxOccurs=\"%d\" ", maximum(elem)); printspc(out, cols, fmt, minattr, maxattr, schema(), name(elem)); } } @@ -186,11 +186,11 @@ printcomplextype( if (flags & FLAG_REFERENCE) { if (!(flags & FLAG_NOMIN) && minimum(elem) != 1) - snprintf(minattr, sizeof(minattr), "minOccurs=\"%d\" ", minimum(elem)); + (void) snprintf(minattr, sizeof(minattr), "minOccurs=\"%d\" ", minimum(elem)); if (!(flags & FLAG_NOMAX) && maximum(elem) == 0) - snprintf(maxattr, sizeof(maxattr), "maxOccurs=\"unbounded\" "); + (void) snprintf(maxattr, sizeof(maxattr), "maxOccurs=\"unbounded\" "); else if (!(flags & FLAG_NOMAX) && maximum(elem) != 1) - snprintf(maxattr, sizeof(maxattr), "maxOccurs=\"%d\" ", maximum(elem)); + (void) snprintf(maxattr, sizeof(maxattr), "maxOccurs=\"%d\" ", maximum(elem)); } printspc(out, cols, "\n", minattr, maxattr, name(elem)); @@ -255,13 +255,13 @@ printcomplextype( } else { cont = "choice"; if (min[0] == 0) - snprintf(minattr, sizeof(minattr), " minOccurs=\"0\""); + (void) snprintf(minattr, sizeof(minattr), " minOccurs=\"0\""); else if (min[0] != 1) /* incorrect, but make the most of it */ - snprintf(minattr, sizeof(minattr), " minOccurs=\"%d\"", min[2]); + (void) snprintf(minattr, sizeof(minattr), " minOccurs=\"%d\"", min[2]); if (max[0] == 0) - snprintf(maxattr, sizeof(maxattr), " maxOccurs=\"unbounded\""); + (void) snprintf(maxattr, sizeof(maxattr), " maxOccurs=\"unbounded\""); else if (max[0] != 1) - snprintf(maxattr, sizeof(maxattr), " maxOccurs=\"%d\"", max[2]); + (void) snprintf(maxattr, sizeof(maxattr), " maxOccurs=\"%d\"", max[2]); if (mineq) flags |= FLAG_NOMIN; if (maxeq) @@ -332,11 +332,11 @@ printsimpletype( if (flags & FLAG_REFERENCE) { if (minimum(elem) != 1) - snprintf(min, sizeof(min), "minOccurs=\"%d\" ", minimum(elem)); + (void) snprintf(min, sizeof(min), "minOccurs=\"%d\" ", minimum(elem)); if (maximum(elem) == 0) - snprintf(max, sizeof(max), "maxOccurs=\"unbounded\" "); + (void) snprintf(max, sizeof(max), "maxOccurs=\"unbounded\" "); else if (maximum(elem) != 1) - snprintf(max, sizeof(max), "maxOccurs=\"%d\" ", maximum(elem)); + (void) snprintf(max, sizeof(max), "maxOccurs=\"%d\" ", maximum(elem)); } if (!(type = isbuiltintopic(elem))) diff --git a/src/tools/ddsperf/cputime.c b/src/tools/ddsperf/cputime.c index fb4e798221..e958c12816 100644 --- a/src/tools/ddsperf/cputime.c +++ b/src/tools/ddsperf/cputime.c @@ -197,7 +197,7 @@ struct record_cputime_state *record_cputime_new (dds_entity_t wr) return NULL; else if (n > (dds_return_t) (sizeof (tids) / sizeof (tids[0]))) { - fprintf (stderr, "way more threads than expected\n"); + (void) fprintf (stderr, "way more threads than expected\n"); return NULL; } diff --git a/src/tools/ddsperf/ddsperf.c b/src/tools/ddsperf/ddsperf.c index f52b7f31dc..8218dddbf7 100644 --- a/src/tools/ddsperf/ddsperf.c +++ b/src/tools/ddsperf/ddsperf.c @@ -398,7 +398,7 @@ static void error3 (const char *fmt, ...) static char *make_guidstr (struct guidstr *buf, const dds_guid_t *guid) { - snprintf (buf->str, sizeof (buf->str), "%02x%02x%02x%02x_%02x%02x%02x%02x_%02x%02x%02x%02x_%02x%02x%02x%02x", + (void) snprintf (buf->str, sizeof (buf->str), "%02x%02x%02x%02x_%02x%02x%02x%02x_%02x%02x%02x%02x_%02x%02x%02x%02x", guid->v[0], guid->v[1], guid->v[2], guid->v[3], guid->v[4], guid->v[5], guid->v[6], guid->v[7], guid->v[8], guid->v[9], guid->v[10], guid->v[11], @@ -648,7 +648,7 @@ static uint32_t pubthread (void *varg) *keyvalptr = k; if ((result = dds_register_instance (wr_data, &ihs[k], &data)) != DDS_RETCODE_OK) { - printf ("dds_register_instance failed: %d\n", result); + (void) printf ("dds_register_instance failed: %d\n", result); fflush (stdout); exit (2); } @@ -668,7 +668,7 @@ static uint32_t pubthread (void *varg) bool reqresp = (ping_frac == 0) ? 0 : (ping_frac == UINT32_MAX) ? 1 : (ddsrt_random () <= ping_frac); if ((result = dds_write_ts (wr_data, &data, (t_write & ~1) | reqresp)) != DDS_RETCODE_OK) { - printf ("write error: %d\n", result); + (void) printf ("write error: %d\n", result); fflush (stdout); if (result != DDS_RETCODE_TIMEOUT) exit (2); @@ -791,13 +791,13 @@ static int64_t *latencystat_print (struct latencystat *y, const char *prefix, co struct ppant *pp; ddsrt_mutex_lock (&disc_lock); if ((pp = ddsrt_avl_lookup (&ppants_td, &ppants, &pphandle)) == NULL) - snprintf (ppinfo, sizeof (ppinfo), "%"PRIx64, pubhandle); + (void) snprintf (ppinfo, sizeof (ppinfo), "%"PRIx64, pubhandle); else - snprintf (ppinfo, sizeof (ppinfo), "%s:%"PRIu32, pp->hostname, pp->pid); + (void) snprintf (ppinfo, sizeof (ppinfo), "%s:%"PRIu32, pp->hostname, pp->pid); ddsrt_mutex_unlock (&disc_lock); qsort (y->raw, rawcnt, sizeof (*y->raw), cmp_int64); - printf ("%s%s %s size %"PRIu32" mean %.3fus min %.3fus 50%% %.3fus 90%% %.3fus 99%% %.3fus max %.3fus cnt %"PRIu32"\n", + (void) printf ("%s%s %s size %"PRIu32" mean %.3fus min %.3fus 50%% %.3fus 90%% %.3fus 99%% %.3fus max %.3fus cnt %"PRIu32"\n", prefix, subprefix, ppinfo, size, (double) y->sum / (double) y->cnt / 1e3, (double) y->min / 1e3, @@ -859,7 +859,7 @@ static dds_instance_handle_t get_pphandle_for_pubhandle (dds_instance_handle_t p error2 ("dds_read_instance(rd_publications, %"PRIx64") failed: %d\n", pubhandle, (int) n); if (n == 0 || !info.valid_data) { - printf ("get_pong_writer: publication handle %"PRIx64" not found\n", pubhandle); + (void) printf ("get_pong_writer: publication handle %"PRIx64" not found\n", pubhandle); fflush (stdout); return 0; } @@ -878,7 +878,7 @@ static int check_eseq (struct eseq_admin *ea, uint32_t seq, uint32_t keyval, uin uint32_t *eseq; if (keyval >= ea->nkeys) { - printf ("received key %"PRIu32" >= nkeys %u\n", keyval, ea->nkeys); + (void) printf ("received key %"PRIu32" >= nkeys %u\n", keyval, ea->nkeys); exit (3); } ddsrt_mutex_lock (&ea->lock); @@ -1001,7 +1001,7 @@ static dds_entity_t get_pong_writer_locked (dds_instance_handle_t pubhandle) } } } - printf ("get_pong_writer: participant handle %"PRIx64" not found\n", pphandle); + (void) printf ("get_pong_writer: participant handle %"PRIx64" not found\n", pphandle); fflush (stdout); return 0; } @@ -1146,7 +1146,7 @@ static void maybe_send_new_ping (dds_time_t tnow, dds_time_t *tnextping) ping_timeouts++; if (tnow > twarn_ping_timeout) { - printf ("[%"PRIdPID"] ping timed out (total %"PRIu32" times) ... sending new ping\n", ddsrt_getpid (), ping_timeouts); + (void) printf ("[%"PRIdPID"] ping timed out (total %"PRIu32" times) ... sending new ping\n", ddsrt_getpid (), ping_timeouts); twarn_ping_timeout = tnow + DDS_SECS (1); fflush (stdout); } @@ -1271,7 +1271,7 @@ static dds_entity_t create_pong_writer (dds_instance_handle_t pphandle, const st dds_entity_t pongpub; dds_entity_t wr_pong; - //printf ("[%"PRIdPID"] create_pong_writer: creating writer in partition %s pubhandle %"PRIx64"\n", ddsrt_getpid (), guidstr->str, pphandle); + //(void) printf ("[%"PRIdPID"] create_pong_writer: creating writer in partition %s pubhandle %"PRIx64"\n", ddsrt_getpid (), guidstr->str, pphandle); //fflush (stdout); qos = dds_create_qos (); @@ -1348,7 +1348,7 @@ static void async_participant_data_listener (dds_entity_t rd, void *arg) ddsrt_mutex_lock (&disc_lock); if ((pp = ddsrt_avl_lookup_dpath (&ppants_td, &ppants, &info.instance_handle, &dpath)) != NULL) { - printf ("[%"PRIdPID"] participant %s:%"PRIu32": gone\n", ddsrt_getpid (), pp->hostname, pp->pid); + (void) printf ("[%"PRIdPID"] participant %s:%"PRIu32": gone\n", ddsrt_getpid (), pp->hostname, pp->pid); fflush (stdout); if (pp->handle != dp_handle || ignorelocal == DDS_IGNORELOCAL_NONE) @@ -1363,7 +1363,7 @@ static void async_participant_data_listener (dds_entity_t rd, void *arg) free_ppant (pp); } ddsrt_mutex_unlock (&disc_lock); - dds_delete (pong_wr_to_del); + (void) dds_delete (pong_wr_to_del); } else { @@ -1389,7 +1389,7 @@ static void async_participant_data_listener (dds_entity_t rd, void *arg) free (hostname); else { - printf ("[%"PRIdPID"] participant %s:%"PRIu32": new%s\n", ddsrt_getpid (), hostname, (uint32_t) pid, (info.instance_handle == dp_handle) ? " (self)" : ""); + (void) printf ("[%"PRIdPID"] participant %s:%"PRIu32": new%s\n", ddsrt_getpid (), hostname, (uint32_t) pid, (info.instance_handle == dp_handle) ? " (self)" : ""); pp = malloc (sizeof (*pp)); assert(pp); pp->handle = info.instance_handle; @@ -1433,7 +1433,7 @@ static void async_participant_data_listener (dds_entity_t rd, void *arg) the expected number of responses, so allow for a few attempts before starting to warn about timeouts */ twarn_ping_timeout = dds_time () + DDS_MSECS (3333); - //printf ("[%"PRIdPID"] n_pong_expected = %u\n", ddsrt_getpid (), n_pong_expected); + //(void) printf ("[%"PRIdPID"] n_pong_expected = %u\n", ddsrt_getpid (), n_pong_expected); ddsrt_mutex_unlock (&pongwr_lock); } } @@ -1452,7 +1452,7 @@ static void async_endpoint_matched_listener (uint32_t match_mask, dds_entity_t r if ((n = dds_read_instance (rd_epinfo, &msg, &info, 1, 1, remote_endpoint)) < 0) error2 ("dds_read_instance(rd_epinfo, %"PRIx64") failed: %d\n", remote_endpoint, (int) n); else if (n == 0) - printf ("[%"PRIdPID"] endpoint %"PRIx64" not found\n", ddsrt_getpid (), remote_endpoint); + (void) printf ("[%"PRIdPID"] endpoint %"PRIx64" not found\n", ddsrt_getpid (), remote_endpoint); else { if (info.valid_data) @@ -1461,7 +1461,7 @@ static void async_endpoint_matched_listener (uint32_t match_mask, dds_entity_t r struct ppant *pp; ddsrt_mutex_lock (&disc_lock); if ((pp = ddsrt_avl_lookup (&ppants_td, &ppants, &sample->participant_instance_handle)) == NULL) - printf ("[%"PRIdPID"] participant %"PRIx64" no longer exists\n", ddsrt_getpid (), sample->participant_instance_handle); + (void) printf ("[%"PRIdPID"] participant %"PRIx64" no longer exists\n", ddsrt_getpid (), sample->participant_instance_handle); else { pp->unmatched &= ~match_mask; @@ -1512,7 +1512,7 @@ static void async_subscription_matched_listener (dds_entity_t rd, const dds_subs if (status.current_count_change > 0) { uint32_t mask = (uint32_t) (uintptr_t) arg; - //printf ("[%"PRIdPID"] subscription match: %s\n", ddsrt_getpid (), match_mask1_to_string (mask)); + //(void) printf ("[%"PRIdPID"] subscription match: %s\n", ddsrt_getpid (), match_mask1_to_string (mask)); async_endpoint_matched_listener (mask, rd_publications, status.last_publication_handle); } } @@ -1526,7 +1526,7 @@ static void async_publication_matched_listener (dds_entity_t wr, const dds_publi if (status.current_count_change > 0) { uint32_t mask = (uint32_t) (uintptr_t) arg; - //printf ("[%"PRIdPID"] publication match: %s\n", ddsrt_getpid (), match_mask1_to_string (mask)); + //(void) printf ("[%"PRIdPID"] publication match: %s\n", ddsrt_getpid (), match_mask1_to_string (mask)); async_endpoint_matched_listener (mask, rd_subscriptions, status.last_subscription_handle); } } @@ -1574,7 +1574,7 @@ static bool print_stats (dds_time_t tref, dds_time_t tnow, dds_time_t tprev, str char prefix[128]; const double ts = (double) (tnow - tref) / 1e9; bool output = false; - snprintf (prefix, sizeof (prefix), "[%"PRIdPID"] %.3f ", ddsrt_getpid (), ts); + (void) snprintf (prefix, sizeof (prefix), "[%"PRIdPID"] %.3f ", ddsrt_getpid (), ts); if (pub_rate > 0) { @@ -1617,7 +1617,7 @@ static bool print_stats (dds_time_t tref, dds_time_t tnow, dds_time_t tprev, str if (nrecv > 0 || substat_every_second) { const double dt = (double) (tnow - tprev); - printf ("%s size %"PRIu32" total %"PRIu64" lost %"PRIu64" delta %"PRIu64" lost %"PRIu64" rate %.2f kS/s %.2f Mb/s (%.2f kS/s %.2f Mb/s)\n", + (void) printf ("%s size %"PRIu32" total %"PRIu64" lost %"PRIu64" delta %"PRIu64" lost %"PRIu64" rate %.2f kS/s %.2f Mb/s (%.2f kS/s %.2f Mb/s)\n", prefix, last_size, tot_nrecv, tot_nlost, nrecv, nlost, (double) nrecv * 1e6 / dt, (double) nrecv_bytes * 8 * 1e3 / dt, (double) nrecv10s * 1e6 / (10 * dt), (double) nrecv10s_bytes * 8 * 1e3 / (10 * dt)); @@ -1701,7 +1701,7 @@ static bool print_stats (dds_time_t tref, dds_time_t tnow, dds_time_t tprev, str { (void) dds_refresh_statistics (stats->substat); (void) dds_refresh_statistics (stats->pubstat); - printf ("%s discarded %"PRIu64" rexmit %"PRIu64" Trexmit %"PRIu64" Tthrottle %"PRIu64" Nthrottle %"PRIu32"\n", prefix, stats->discarded_bytes->u.u64, stats->rexmit_bytes->u.u64, stats->time_rexmit->u.u64, stats->time_throttle->u.u64, stats->throttle_count->u.u32); + (void) printf ("%s discarded %"PRIu64" rexmit %"PRIu64" Trexmit %"PRIu64" Tthrottle %"PRIu64" Nthrottle %"PRIu32"\n", prefix, stats->discarded_bytes->u.u64, stats->rexmit_bytes->u.u64, stats->time_rexmit->u.u64, stats->time_throttle->u.u64, stats->throttle_count->u.u32); } fflush (stdout); @@ -1774,7 +1774,7 @@ static void sigxfsz_handler (int sig __attribute__ ((unused))) static void usage (void) { - printf ("\ + (void) printf ("\ %s help (this text)\n\ %s sanity (ping 1Hz)\n\ %s [OPTIONS] MODE...\n\ @@ -2295,9 +2295,9 @@ int main (int argc, char *argv[]) case S4k: tp_suf = "S4k"; tp_desc = &Struct4k_desc; break; case S32k: tp_suf = "S32k"; tp_desc = &Struct32k_desc; break; } - snprintf (tpname_data, sizeof (tpname_data), "DDSPerf%cData%s", reliable ? 'R' : 'U', tp_suf); - snprintf (tpname_ping, sizeof (tpname_ping), "DDSPerf%cPing%s", reliable ? 'R' : 'U', tp_suf); - snprintf (tpname_pong, sizeof (tpname_pong), "DDSPerf%cPong%s", reliable ? 'R' : 'U', tp_suf); + (void) snprintf (tpname_data, sizeof (tpname_data), "DDSPerf%cData%s", reliable ? 'R' : 'U', tp_suf); + (void) snprintf (tpname_ping, sizeof (tpname_ping), "DDSPerf%cPing%s", reliable ? 'R' : 'U', tp_suf); + (void) snprintf (tpname_pong, sizeof (tpname_pong), "DDSPerf%cPong%s", reliable ? 'R' : 'U', tp_suf); qos = dds_create_qos (); dds_qset_reliability (qos, reliable ? DDS_RELIABILITY_RELIABLE : DDS_RELIABILITY_BEST_EFFORT, DDS_SECS (10)); if ((tp_data = dds_create_topic (dp, tp_desc, tpname_data, qos, NULL)) < 0) @@ -2585,7 +2585,7 @@ int main (int argc, char *argv[]) (void) ddsrt_fibheap_extract_min (&ppants_to_match_fhd, &ppants_to_match); if (pp->unmatched != 0) { - printf ("[%"PRIdPID"] participant %s:%"PRIu32": failed to match in %.3fs\n", ddsrt_getpid (), pp->hostname, pp->pid, (double) (pp->tdeadline - pp->tdisc) / 1e9); + (void) printf ("[%"PRIdPID"] participant %s:%"PRIu32": failed to match in %.3fs\n", ddsrt_getpid (), pp->hostname, pp->pid, (double) (pp->tdeadline - pp->tdisc) / 1e9); fflush (stdout); matchtimeout++; } @@ -2695,7 +2695,7 @@ int main (int argc, char *argv[]) The fix is to eliminate the waiting and retrying, and instead flip the reader's state to out-of-sync and rely on retransmits to let it make progress once room is available again. */ - dds_delete (rd_data); + (void) dds_delete (rd_data); uint64_t nlost = 0; bool received_ok = true; @@ -2709,7 +2709,7 @@ int main (int argc, char *argv[]) subthread_arg_fini (&subarg_data); subthread_arg_fini (&subarg_ping); subthread_arg_fini (&subarg_pong); - dds_delete (dp); + (void) dds_delete (dp); // only shutdown async listener once the participant is gone: that's // how we get rid of the dynamically created pong writers, and those @@ -2741,7 +2741,7 @@ int main (int argc, char *argv[]) if (pp->unmatched != 0) { char buf[256]; - printf ("[%"PRIdPID"] error: %s:%"PRIu32" failed to match %s\n", ddsrt_getpid (), pp->hostname, pp->pid, match_mask_to_string (buf, sizeof (buf), pp->unmatched)); + (void) printf ("[%"PRIdPID"] error: %s:%"PRIu32" failed to match %s\n", ddsrt_getpid (), pp->hostname, pp->pid, match_mask_to_string (buf, sizeof (buf), pp->unmatched)); ok = false; } } @@ -2750,27 +2750,27 @@ int main (int argc, char *argv[]) if (matchcount < minmatch) { - printf ("[%"PRIdPID"] error: too few matching participants (%"PRIu32")\n", ddsrt_getpid (), matchcount); + (void) printf ("[%"PRIdPID"] error: too few matching participants (%"PRIu32")\n", ddsrt_getpid (), matchcount); ok = false; } if (nlost > 0 && (reliable && histdepth == 0)) { - printf ("[%"PRIdPID"] error: %"PRIu64" samples lost\n", ddsrt_getpid (), nlost); + (void) printf ("[%"PRIdPID"] error: %"PRIu64" samples lost\n", ddsrt_getpid (), nlost); ok = false; } if (!roundtrips_ok) { - printf ("[%"PRIdPID"] error: too few roundtrips for some peers\n", ddsrt_getpid ()); + (void) printf ("[%"PRIdPID"] error: too few roundtrips for some peers\n", ddsrt_getpid ()); ok = false; } if (!received_ok) { - printf ("[%"PRIdPID"] error: too few samples received from some peers\n", ddsrt_getpid ()); + (void) printf ("[%"PRIdPID"] error: too few samples received from some peers\n", ddsrt_getpid ()); ok = false; } if (rss_check && rss_final >= rss_init * rss_factor + rss_term) { - printf ("[%"PRIdPID"] error: RSS grew too much (%f -> %f)\n", ddsrt_getpid (), rss_init, rss_final); + (void) printf ("[%"PRIdPID"] error: RSS grew too much (%f -> %f)\n", ddsrt_getpid (), rss_init, rss_final); ok = false; } return ok ? 0 : 1; diff --git a/src/tools/ddsperf/netload.c b/src/tools/ddsperf/netload.c index 5b2273dab7..b2ce7f95e2 100644 --- a/src/tools/ddsperf/netload.c +++ b/src/tools/ddsperf/netload.c @@ -57,13 +57,13 @@ void record_netload (struct record_netload_state *st, const char *prefix, dds_ti const double drpct = 100.0 * dr / st->bw; if (dxpct >= 0.5 || drpct >= 0.5) { - printf ("%s %s: xmit %.0f%% recv %.0f%% [%"PRIu64" %"PRIu64"]\n", + (void) printf ("%s %s: xmit %.0f%% recv %.0f%% [%"PRIu64" %"PRIu64"]\n", prefix, st->name, dxpct, drpct, x.obytes, x.ibytes); } } else if (dx >= 1e5 || dr >= 1e5) // 100kb/s is arbitrary { - printf ("%s %s: xmit %.2f Mb/s recv %.2f Mb/s [%"PRIu64" %"PRIu64"]\n", + (void) printf ("%s %s: xmit %.2f Mb/s recv %.2f Mb/s [%"PRIu64" %"PRIu64"]\n", prefix, st->name, dx / 1e6, dr / 1e6, x.obytes, x.ibytes); } } diff --git a/src/tools/decode-trace b/src/tools/decode-trace index 631024a9c4..82f6432f02 100755 --- a/src/tools/decode-trace +++ b/src/tools/decode-trace @@ -119,7 +119,7 @@ my (%psgid, %psguid, %rwgid, %rwguid); my %isbuiltin_entitykind = (0xc2 => 1, 0xc3 => 1, 0xc4 => 1, 0xc7 => 1, 0x42 => 1, 0x43 => 1, 0x44 => 1, 0x47 => 1); my $prevline = ""; while(<>) { - #printf $_; + #(void) printf $_; s/[\r\n]+$//; # chomp; if (defined $t0sec && /\(anon\): config: Domain\/General\/MulticastRecvNetworkInterfaceAddresses/) { @@ -146,17 +146,17 @@ while(<>) { last unless /^(?:\d+-\d+-\d+T\d+:\d+:\d+[+-]\d+\s+)?(\d+)\.(\d+)(\/| \[(\d+)\]) *([^:]+)/; unless (defined $t0sec) { ($t0sec, $t0usec) = ($1, $2); - printf "T0 = %d.%06d\n", $t0sec, $t0usec; + (void) printf "T0 = %d.%06d\n", $t0sec, $t0usec; } $ts = ($1 - $t0sec) + ($2 - $t0usec) / 1e6; my $dom = $4; my $tid = $5; $prevts{$tid} = $ts unless exists $prevts{$tid}; if ($ts < $prevts{$tid}) { - printf "%9.3f %35s $topfmt TJMP time jumped %.3fs (thread %s line $.)\n", $ts, "", "", $ts - $prevts{$tid}, $tid if $ts - $prevtjump > 1; + (void) printf "%9.3f %35s $topfmt TJMP time jumped %.3fs (thread %s line $.)\n", $ts, "", "", $ts - $prevts{$tid}, $tid if $ts - $prevtjump > 1; $prevtjump = $ts; } elsif ($tid eq "lease" && $ts > $prevts{$tid} + 3) { - printf "%9.3f %35s $topfmt TJMP possible time jump %.3fs (thread %s line $.)\n", $ts, "", "", $ts - $prevts{$tid}, $tid if $ts - $prevtjump > 1; + (void) printf "%9.3f %35s $topfmt TJMP possible time jump %.3fs (thread %s line $.)\n", $ts, "", "", $ts - $prevts{$tid}, $tid if $ts - $prevtjump > 1; } $prevts{$tid} = $ts; @@ -168,7 +168,7 @@ while(<>) { my @stat = ($recv_packet, $xmit_packet, $recv_bytes, $xmit_bytes, $recv_appdata, $xmit_appdata, $rexmit_count_req, $rexmit_frags); if ($ts >= $next_stat_print) { if ($statintv > 0) { - printf "%9.3f %35s $topfmt STAT recv/xmit: pkt %u %u bytes %u %u app %u %u rexmit: req %u frags %u\n", $ts, "", "", @stat; + (void) printf "%9.3f %35s $topfmt STAT recv/xmit: pkt %u %u bytes %u %u app %u %u rexmit: req %u frags %u\n", $ts, "", "", @stat; } else { my $dt = $ts - ($next_stat_print + $statintv); for (my $i = 0; $i < @stat; $i++) { @@ -176,7 +176,7 @@ while(<>) { $stat[$i] = ($x - $stat_deltas[$i]) / $dt; $stat_deltas[$i] = $x; } - printf "%9.3f %35s $topfmt STAT recv/xmit: pkt %f %f bytes %f %f app %f %f rexmit: req %f frags %f\n", $ts, "", "", @stat; + (void) printf "%9.3f %35s $topfmt STAT recv/xmit: pkt %f %f bytes %f %f app %f %f rexmit: req %f frags %f\n", $ts, "", "", @stat; } $next_stat_print = $ts + abs($statintv); } @@ -188,7 +188,7 @@ while(<>) { if ($nsamp > 0) { # note: sample count is against check reqt, not current position # of the writer - printf "%9.3f %35s $topfmt ACK lagging by %d samples (last seq from writer: %d)\n", + (void) printf "%9.3f %35s $topfmt ACK lagging by %d samples (last seq from writer: %d)\n", $x->{ts}, fmtguid($x->{wrguid}), $wr{$x->{wrguid}}->{stopic}, $nsamp, $wr{$x->{wrguid}}->{seq} unless $wr{$x->{wrguid}}->{acklate} || !$shows{ack} || !show_topic($wr{$x->{wrguid}}->{topic}); $wr{$x->{wrguid}}->{acklate} = $x->{tswrite}; @@ -201,7 +201,7 @@ while(<>) { if ($ts - $tlast_non_spdp_check >= 1.0) { while (my ($k, $v) = each %proxypp) { if (!defined $v->{tdel} && $ts - $v->{tcreate} > 5.0 && $v->{non_spdp_seen} == 0) { - printf "%9.3f %35s $topfmt CONN nothing other than SPDP received for %3.fs, possible connectivity issue\n", $ts, fmtguid($k), "", $ts - $v->{tcreate}; + (void) printf "%9.3f %35s $topfmt CONN nothing other than SPDP received for %3.fs, possible connectivity issue\n", $ts, fmtguid($k), "", $ts - $v->{tcreate}; $v->{non_spdp_seen} = -1; # flagging it so we don't keep repeating it } } @@ -210,7 +210,7 @@ while(<>) { if ($hexmode) { while (my ($k, $v) = each %proxypp) { if (!defined $v->{tdel} && $ts - $v->{tcreate} > 5.0 && !$v->{disccompleteflag} && !$v->{disccompletewarned}) { - printf "%9.3f %35s $topfmt DISC discovery not complete yet after %.3fs (%s)\n", $ts, fmtguid($k), "", $ts - $v->{tcreate}, disccomplete_diagstr ($v); + (void) printf "%9.3f %35s $topfmt DISC discovery not complete yet after %.3fs (%s)\n", $ts, fmtguid($k), "", $ts - $v->{tcreate}, disccomplete_diagstr ($v); $v->{disccompletewarned} = 1; } } @@ -221,12 +221,12 @@ while(<>) { for my $t (keys %txblock) { if ($shows{block} && defined $txblock{$t} && $ts > $txblock{$t} + 1.0 && $txblock{$t} > $tlast_txblock{$t}) { my $stopic = (exists $wr{$txblockwr{$t}}) ? $wr{$txblockwr{$t}}->{stopic} : ""; - printf "%9.3f %35s $topfmt BLCK already blocked for %.3fs\n", $ts, fmtguid($txblockwr{$t}), $stopic, $ts - $txblock{$t}; + (void) printf "%9.3f %35s $topfmt BLCK already blocked for %.3fs\n", $ts, fmtguid($txblockwr{$t}), $stopic, $ts - $txblock{$t}; if (exists $wr{$txblockwr{$t}}) { my @lates = acklate(1e100, $txblockwr{$t}); for (@lates) { my $cause = ($_->{haveack} ? sprintf "%d behind", $_->{nsamp} : "no ack yet"); - printf "%9.3f %35s $topfmt BLCK %s (%s)\n", $ts, fmtguid($txblockwr{$t}), $stopic, fmtguid($_->{guid}), $cause; + (void) printf "%9.3f %35s $topfmt BLCK %s (%s)\n", $ts, fmtguid($txblockwr{$t}), $stopic, fmtguid($_->{guid}), $cause; } } $tlast_txblock{$t} = $txblock{$t}; @@ -295,7 +295,7 @@ while(<>) { if ($proxypp{$ppguid}->{disccompleteflag} && $ts > $proxypp{$ppguid}->{tasymdisc} + 5) { my $sysid = $proxypp{$ppguid}->{sysid}; my $sx = decimal_sysid($sysid); - printf "%9.3f %35s $topfmt ASYM %s (%s; %s; %s) likely asymmetrical disconnect\n", $ts, $sysid, "", $sysid{$sysid}->{ip}, $sx, $sysid{$sysid}->{name}, vendorstr($spdp_info{$ppguid}->{vendor}); + (void) printf "%9.3f %35s $topfmt ASYM %s (%s; %s; %s) likely asymmetrical disconnect\n", $ts, $sysid, "", $sysid{$sysid}->{ip}, $sx, $sysid{$sysid}->{name}, vendorstr($spdp_info{$ppguid}->{vendor}); $proxypp{$ppguid}->{tasymdisc} = $ts; } } @@ -310,7 +310,7 @@ while(<>) { if (exists $proxypp{$ppguid} && $proxypp{$ppguid}->{disccompleteflag} && $ts > $proxypp{$ppguid}->{tasymdisc} + 1) { my $sysid = $proxypp{$ppguid}->{sysid}; my $sx = decimal_sysid($sysid); - printf "%9.3f %35s $topfmt ASYM %s (%s; %s; %s) likely asymmetrical disconnect\n", $ts, $sysid, "", $sysid{$sysid}->{ip}, $sx, $sysid{$sysid}->{name}, vendorstr($spdp_info{$ppguid}->{vendor}); + (void) printf "%9.3f %35s $topfmt ASYM %s (%s; %s; %s) likely asymmetrical disconnect\n", $ts, $sysid, "", $sysid{$sysid}->{ip}, $sx, $sysid{$sysid}->{name}, vendorstr($spdp_info{$ppguid}->{vendor}); $proxypp{$ppguid}->{tasymdisc} = $ts; } } @@ -342,13 +342,13 @@ while(<>) { $self_seen = 1; $sysid{$sysid} = { self => 1, ip => $ownip, name => $name, sname => $sname }; my $sx = decimal_sysid($sysid); - printf "%9.3f %35s $topfmt SELF node %s (%s; %s) alive\n", $ts, $sysid, "", $ownip, $sx, $sysid{$sysid}->{name}; + (void) printf "%9.3f %35s $topfmt SELF node %s (%s; %s) alive\n", $ts, $sysid, "", $ownip, $sx, $sysid{$sysid}->{name}; } - printf "%9.3f LOCAL PARTICIPANT %s (%s)\n", $ts, fmtguid($guid), $gid if $shows{localdisc}; + (void) printf "%9.3f LOCAL PARTICIPANT %s (%s)\n", $ts, fmtguid($guid), $gid if $shows{localdisc}; } elsif (/: ddsi_unref_participant\(($guidre) .*user 0 builtin 0/o) { my $guid = hexify($1); (my $gid = $guid) =~ s/:[^:]+$//; - printf "%9.3f DELETE LOCAL PARTICIPANT %s (%s)\n", $ts, fmtguid($guid), $gid if $shows{localdisc}; + (void) printf "%9.3f DELETE LOCAL PARTICIPANT %s (%s)\n", $ts, fmtguid($guid), $gid if $shows{localdisc}; } elsif (/: map group ($gidre) -> ($guidre)/o) { $psgid{$tid} = hexify($1); $psguid{$tid} = hexify($2); @@ -423,7 +423,7 @@ while(<>) { } else { $gidstr = sprintf "gid %s ${gk}gid %s", $rwgid{$tid}, $psgid{$tid}; } - printf "%9.3f LOCAL $kind %s %s {%s} (%s)\n", $ts, fmtguid($rwguid{$tid}), $topic, $partitions, $gidstr if $shows{localdisc} && $topic =~ /$topic_filter/o && $topic !~ /$topic_xfilter/o; + (void) printf "%9.3f LOCAL $kind %s %s {%s} (%s)\n", $ts, fmtguid($rwguid{$tid}), $topic, $partitions, $gidstr if $shows{localdisc} && $topic =~ /$topic_filter/o && $topic !~ /$topic_xfilter/o; check_qos($ts, $kind, fmtguid($rwguid{$tid}), $topic, $partitions, $qos, $g->{$psguid{$tid}}); $psgid{$tid} = $psguid{$tid} = $rwgid{$tid} = $rwguid{$tid} = undef; $ftrflag{$tid} = 0; @@ -439,7 +439,7 @@ while(<>) { die if defined $wr->{cs}; if ($pub->{txn} == 0) { $pub->{txn} = keys %{$pub->{es}}; - printf "%9.3f %35s $topfmt %16s XMT BEGIN [%d writers]\n", $ts, fmtguid($pub->{guid}), "", "", $pub->{txn} + (void) printf "%9.3f %35s $topfmt %16s XMT BEGIN [%d writers]\n", $ts, fmtguid($pub->{guid}), "", "", $pub->{txn} if $shows{out}; } $wr->{cs} = { seq => undef, ktxn => $ktxnid, kseq => $kseq }; # seq will be filled in with the first sample @@ -449,7 +449,7 @@ while(<>) { my $nd = defined $wr->{cs}->{seq} ? $wr->{seq} - $wr->{cs}->{seq} + 1 : 0; if ($nk != $nd) { my $keeplastmsg = $wr->{keepall} ? " (weird)" : " - change writer to use a keep-all history"; - printf "%9.3f %35s $topfmt %s #%-4d %-6s EOTX kernel has %d but DDSI %d samples in txn%s\n", $ts, fmtguid($wrguid), $wr->{stopic}, "", $wr->{seq}, "", $nk, $nd, $keeplastmsg; + (void) printf "%9.3f %35s $topfmt %s #%-4d %-6s EOTX kernel has %d but DDSI %d samples in txn%s\n", $ts, fmtguid($wrguid), $wr->{stopic}, "", $wr->{seq}, "", $nk, $nd, $keeplastmsg; } } else { # assume empty transaction @@ -489,7 +489,7 @@ while(<>) { $print = show_topic($wr->{topic}) && $shows{out}; $print = 0 unless $data =~ /$data_filter/o; my $sdata = $printlim ? (sprintf "%-100.100s", $data) : (sprintf "%-100s", $data); - printf "%9.3f %35s $topfmt %s #%-4d %-6s XMT %s -> %s\n", $ts, fmtguid($wrguid), $wr->{stopic}, $op, $seq, $cseq, $sdata, $dest if $print; + (void) printf "%9.3f %35s $topfmt %s #%-4d %-6s XMT %s -> %s\n", $ts, fmtguid($wrguid), $wr->{stopic}, $op, $seq, $cseq, $sdata, $dest if $print; if ($data =~ /^:e:/ && defined $wr->{cs}) { # assume empty transaction if no $wr->{cs} my $pub = $pub{$wr->{psguid}}; @@ -498,10 +498,10 @@ while(<>) { if ($pub->{txn} == 0) { # presumably an empty transaction $pub->{txn} = keys %{$pub->{es}}; - printf "%9.3f %35s $topfmt %16s XMT BEGIN [empty, %d writers]\n", $ts, fmtguid($pub->{guid}), "", "", $pub->{txn} if $shows{out}; + (void) printf "%9.3f %35s $topfmt %16s XMT BEGIN [empty, %d writers]\n", $ts, fmtguid($pub->{guid}), "", "", $pub->{txn} if $shows{out}; } if (--$pub->{txn} == 0) { - printf "%9.3f %35s $topfmt %16s XMT COMMIT\n", $ts, fmtguid($pub->{guid}), "", "" + (void) printf "%9.3f %35s $topfmt %16s XMT COMMIT\n", $ts, fmtguid($pub->{guid}), "", "" if $shows{out}; } } @@ -546,14 +546,14 @@ while(<>) { } my $note = ""; if (exists $sysid{$sysid} && defined $sysid{$sysid}->{tcrash}) { - printf "%9.3f %35s $topfmt DISC node %s apparently not disconnected as assumed before\n", + (void) printf "%9.3f %35s $topfmt DISC node %s apparently not disconnected as assumed before\n", $ts, $sysid, "", $ip; $sysid{$sysid}->{tcrash} = undef; } if ($st != 0) { # should know it, but I guess it might not if one were to receive a dispose followed by an unregister # actually deleting is deferred - #printf "%9.3f LEAVE %s\n", $ts, $ppguid; + #(void) printf "%9.3f LEAVE %s\n", $ts, $ppguid; } else { $sysid{$sysid} = { npp => 0, ip => $ip, name => $name, sname => $sname, tdel => undef, tcrash => undef } unless defined $sysid{$sysid}; if ($sysid{$sysid}->{npp}++ > 0) { @@ -561,7 +561,7 @@ while(<>) { } elsif (! defined $sysid{$sysid}->{tdel}) { my $x = defined $spdp_info{$ppguid}->{ts} ? sprintf " (started at %.3fs)", $spdp_info{$ppguid}->{ts} : ""; my $sx = decimal_sysid($sysid); - printf "%9.3f %35s $topfmt DISC node %s (%s; %s; %s) alive%s%s\n", $ts, $sysid, "", $ip, $sx, $sysid{$sysid}->{name}, vendorstr($spdp_info{$ppguid}->{vendor}), $x, $userdata; + (void) printf "%9.3f %35s $topfmt DISC node %s (%s; %s; %s) alive%s%s\n", $ts, $sysid, "", $ip, $sx, $sysid{$sysid}->{name}, vendorstr($spdp_info{$ppguid}->{vendor}), $x, $userdata; } else { my $dt = $ts - $sysid{$sysid}->{tdel}; my $dtgapstr; @@ -574,7 +574,7 @@ while(<>) { $sysid{$sysid}->{tdel} = undef; delete $sysid{$sysid}->{tlastpkt}; delete $sysid{$sysid}->{tresumepkt}; - printf "%9.3f %35s $topfmt DISC node %s (%s; %s; %s) alive again after %.3fs (disconnect estimate %s)\n", $ts, $sysid, "", $ip, $sx, $sysid{$sysid}->{name}, vendorstr($spdp_info{$ppguid}->{vendor}), $dt, $dtgapstr; + (void) printf "%9.3f %35s $topfmt DISC node %s (%s; %s; %s) alive again after %.3fs (disconnect estimate %s)\n", $ts, $sysid, "", $ip, $sx, $sysid{$sysid}->{name}, vendorstr($spdp_info{$ppguid}->{vendor}), $dt, $dtgapstr; } if (! exists $proxypp{$ppguid}) { $proxypp{$ppguid} = @@ -591,7 +591,7 @@ while(<>) { disccomplete => init_proxypp_disccomplete($bes), disccompleteflag => 0, disccompletewarned => 0 }; - #printf "%9.3f DISCOVER %s @ %s\n", $ts, $ppguid, $ip; + #(void) printf "%9.3f DISCOVER %s @ %s\n", $ts, $ppguid, $ip; } else { die unless defined $proxypp{$ppguid}->{tdel}; my $dt = $ts - $proxypp{$ppguid}->{tdel}; @@ -601,7 +601,7 @@ while(<>) { $proxypp{$ppguid}->{disccomplete} = {}; $proxypp{$ppguid}->{disccompleteflag} = 0; $proxypp{$ppguid}->{disccompletewarned} = 0; - #printf "%9.3f REDISCOVER %s @ %s - gone for %.3fs\n", $ts, $ppguid, $ip, $dt; + #(void) printf "%9.3f REDISCOVER %s @ %s - gone for %.3fs\n", $ts, $ppguid, $ip, $dt; } } } elsif (/lease expired:.*? guid ($guidre)/o) { @@ -615,7 +615,7 @@ while(<>) { die unless defined $sysid{$sysid}; if (!defined $sysid{$sysid}->{tcrash}) { my $lastpacketmsg = exists $tlastpkt{$sysid} ? sprintf " last packet %.3fs ago", $ts - $tlastpkt{$sysid} : ""; - printf "%9.3f %35s $topfmt DIED assuming disconnect of node %s (%s; %s)%s\n", + (void) printf "%9.3f %35s $topfmt DIED assuming disconnect of node %s (%s; %s)%s\n", $ts, fmtguid($ppguid), "", $sysid{$sysid}->{ip}, $sx, $sysid{$sysid}->{name}, $lastpacketmsg; $sysid{$sysid}->{tcrash} = $ts; $sysid{$sysid}->{tlastpkt} = exists $tlastpkt{$sysid} ? $tlastpkt{$sysid} : $ts; @@ -631,7 +631,7 @@ while(<>) { my $sname = $name; $sysid{$sysid} = { npp => 0, ip => $ip, name => $name, sname => $sname, tdel => undef, tcrash => undef } unless defined $sysid{$sysid}; $sysid{$sysid}->{npp}++; - printf "%9.3f %35s $topfmt DISC %s (%s; %s; %s)\n", $ts, $sysid, "", $ip, $sx, $sysid{$sysid}->{name}, vendorstr($spdp_info{$ppguid}->{vendor}); + (void) printf "%9.3f %35s $topfmt DISC %s (%s; %s; %s)\n", $ts, $sysid, "", $ip, $sx, $sysid{$sysid}->{name}, vendorstr($spdp_info{$ppguid}->{vendor}); $proxypp{$ppguid} = { guid => $ppguid, sysid => $sysid, @@ -664,7 +664,7 @@ while(<>) { if (! exists $h->{$prwguid}) { $proxypp{$ppguid}->{$hk}->{$prwguid} = $prw; $h->{$prwguid} = $prw; - printf "%9.3f DISCOVER $kind %s %s {%s}\n", $ts, fmtguid($prwguid), $topic, $partitions + (void) printf "%9.3f DISCOVER $kind %s %s {%s}\n", $ts, fmtguid($prwguid), $topic, $partitions if $shows{remotedisc} && $topic =~ /$topic_filter/o && $topic !~ /$topic_xfilter/o; } else { my $x = $h->{$prwguid}; @@ -673,9 +673,9 @@ while(<>) { my $dt = $ts - $x->{tdel}; $x->{tdel} = undef; if ($x->{explicitdel}) { - printf "%9.3f REDISCOVER ZOMBIE $kind %s %s - gone for %.3fs\n", $ts, fmtguid($prwguid), $stopic, $dt; + (void) printf "%9.3f REDISCOVER ZOMBIE $kind %s %s - gone for %.3fs\n", $ts, fmtguid($prwguid), $stopic, $dt; } else { - printf "%9.3f REDISCOVER $kind %s %s - gone for %.3fs\n", $ts, fmtguid($prwguid), $stopic, $dt + (void) printf "%9.3f REDISCOVER $kind %s %s - gone for %.3fs\n", $ts, fmtguid($prwguid), $stopic, $dt if $shows{remotedisc} && $topic =~ /$topic_filter/o && $topic !~ /$topic_xfilter/o; } } @@ -694,7 +694,7 @@ while(<>) { if (! exists $h->{$prwguid}) { $proxypp{$ppguid}->{$hk}->{$prwguid} = $prw; $h->{$prwguid} = $prw; - printf "%9.3f DISCOVER $kind %s %s {%s}\n", $ts, fmtguid($prwguid), $prw->{topic}, $prw->{partitions} + (void) printf "%9.3f DISCOVER $kind %s %s {%s}\n", $ts, fmtguid($prwguid), $prw->{topic}, $prw->{partitions} if $shows{remotedisc} && $prw->{topic} =~ /$topic_filter/o && $prw->{topic} !~ /$topic_xfilter/o; } else { my $x = $h->{$prwguid}; @@ -703,13 +703,13 @@ while(<>) { my $dt = $ts - $x->{tdel}; $x->{tdel} = undef; if ($x->{explicitdel}) { - printf "%9.3f REDISCOVER ZOMBIE $kind %s %s - gone for %.3fs\n", $ts, fmtguid($prwguid), $prw->{stopic}, $dt; + (void) printf "%9.3f REDISCOVER ZOMBIE $kind %s %s - gone for %.3fs\n", $ts, fmtguid($prwguid), $prw->{stopic}, $dt; } else { - printf "%9.3f REDISCOVER $kind %s %s - gone for %.3fs\n", $ts, fmtguid($prwguid), $prw->{stopic}, $dt + (void) printf "%9.3f REDISCOVER $kind %s %s - gone for %.3fs\n", $ts, fmtguid($prwguid), $prw->{stopic}, $dt if $shows{remotedisc} && $prw->{topic} =~ /$topic_filter/o && $prw->{topic} !~ /$topic_xfilter/o; } } else { - printf "%9.3f RECHECK $kind %s %s {%s}\n", $ts, fmtguid($prwguid), $prw->{stopic}, $prw->{partitions} + (void) printf "%9.3f RECHECK $kind %s %s {%s}\n", $ts, fmtguid($prwguid), $prw->{stopic}, $prw->{partitions} if $shows{remotedisc} && $prw->{topic} =~ /$topic_filter/o && $prw->{topic} !~ /$topic_xfilter/o; } } @@ -731,7 +731,7 @@ while(<>) { if exists $x->{tdel}; my $topic = $x->{topic}; my $gk = ($kind eq "READER") ? "sub" : "pub"; - printf "%9.3f DELETE LOCAL $kind %s %s%s\n", $ts, fmtguid($guid), $topic, ($kind eq "WRITER" && $x->{nhappy} < scalar (keys %{$x->{matches}})) ? " (while unhappy)" : "" if $shows{localdisc} && $topic =~ /$topic_filter/o && $topic !~ /$topic_xfilter/o; + (void) printf "%9.3f DELETE LOCAL $kind %s %s%s\n", $ts, fmtguid($guid), $topic, ($kind eq "WRITER" && $x->{nhappy} < scalar (keys %{$x->{matches}})) ? " (while unhappy)" : "" if $shows{localdisc} && $topic =~ /$topic_filter/o && $topic !~ /$topic_xfilter/o; $x->{tdel} = $ts; } elsif (/proxy_writer_add_connection\(pwr ($guidre) rd ($guidre)\)/o) { next if /already connected/; @@ -768,7 +768,7 @@ while(<>) { } else { $nlost = $wr->{seq} - $prd->{matches}->{$wrguid}->{seqp1del} + 1; } - printf "%9.3f %35s $topfmt MTCH %s rematch %d lost\n", $ts, fmtguid($wrguid), $wr->{stopic}, $prdguid, $nlost + (void) printf "%9.3f %35s $topfmt MTCH %s rematch %d lost\n", $ts, fmtguid($wrguid), $wr->{stopic}, $prdguid, $nlost if $nlost > 0 && $shows{rematch}; delete $prd->{matches}->{$wrguid}->{seqp1del}; } @@ -787,10 +787,10 @@ while(<>) { # (could take time of discovery of proxy participant into account as well) $wr->{zombiewarn}->{$sysid} = 1; if ($seqp1 <= 1) { - printf "%9.3f %35s $topfmt $op %s pre-emptive but writer deleted %.3fs ago, likely zombie\n", + (void) printf "%9.3f %35s $topfmt $op %s pre-emptive but writer deleted %.3fs ago, likely zombie\n", $ts, fmtguid($wrguid), $wr->{stopic}, $prdguid, $ts - $wr->{tdel}; } else { - printf "%9.3f %35s $topfmt $op %s writer deleted %.3fs ago, seemingly no progress\n", + (void) printf "%9.3f %35s $topfmt $op %s writer deleted %.3fs ago, seemingly no progress\n", $ts, fmtguid($wrguid), $wr->{stopic}, $prdguid, $ts - $wr->{tdel}; } } @@ -799,7 +799,7 @@ while(<>) { next unless exists $wr->{matches}->{$prdguid}; if (defined $prd{$prdguid}->{tdel}) { my $dt = $ts - $prd{$prdguid}->{tdel}; - printf "%9.3f %35s $topfmt $op %s undiscovered %.3fs ago\n", $ts, fmtguid($wrguid), $wr->{stopic}, $prdguid, $dt; + (void) printf "%9.3f %35s $topfmt $op %s undiscovered %.3fs ago\n", $ts, fmtguid($wrguid), $wr->{stopic}, $prdguid, $dt; next; } $proxypp{$ppguid}->{non_spdp_seen} = 1; @@ -813,7 +813,7 @@ while(<>) { } if (defined $wr->{matches}->{$prdguid}->{tnack}) { my $dt = $ts - $wr->{matches}->{$prdguid}->{tnack}; - printf "%9.3f %35s $topfmt $op %s caught up after %.3fs\n", $ts, fmtguid($wrguid), $wr->{stopic}, fmtguid($prdguid), $dt if $shows{ack} && show_topic($wr->{topic}); + (void) printf "%9.3f %35s $topfmt $op %s caught up after %.3fs\n", $ts, fmtguid($wrguid), $wr->{stopic}, fmtguid($prdguid), $dt if $shows{ack} && show_topic($wr->{topic}); $wr->{matches}->{$prdguid}->{tnack} = undef; } } elsif ($wr->{matches}->{$prdguid}->{happy}) { @@ -823,7 +823,7 @@ while(<>) { # which uses it to classify requests as historical data or # recovery from packet loss) $wr->{matches}->{$prdguid}->{tnack} = $ts unless defined $wr->{matches}->{$prdguid}->{tnack}; - printf "%9.3f %35s $topfmt $op %s rexmit request for %d samples starting from %d\n", + (void) printf "%9.3f %35s $topfmt $op %s rexmit request for %d samples starting from %d\n", $ts, fmtguid($wrguid), $wr->{stopic}, fmtguid($prdguid), $cnt, $seqp1 if $shows{ack} && show_topic($wr->{topic}); # retransmit count is inexact because it counts requests for retransmission, not actual # retransmits -- the latter is possible, but currently doesn't allow distinguishing between a @@ -832,7 +832,7 @@ while(<>) { } if ($wr->{acklate} && acklate($ts, $wrguid) == 0) { my $dt = $ts - $wr->{acklate}; - printf "%9.3f %35s $topfmt ACK caught up after %.3fs since triggering write\n", + (void) printf "%9.3f %35s $topfmt ACK caught up after %.3fs since triggering write\n", $ts, fmtguid($wrguid), $wr->{stopic}, $dt if $shows{ack} && show_topic($wr->{topic}); $wr->{acklate} = 0; } @@ -842,7 +842,7 @@ while(<>) { die unless defined $pwr; die if ! $pwr->{suppressbegin}; $pwr->{suppressbegin} = 0; - #printf "%9.3f %35s $topfmt %16s RCV BEGIN txn %d\n", $ts, $1, $pwr->{stopic}, "", $2 if $shows{in}; + #(void) printf "%9.3f %35s $topfmt %16s RCV BEGIN txn %d\n", $ts, $1, $pwr->{stopic}, "", $2 if $shows{in}; } elsif (/\(commit ($guidre) txn (\d+) (\d+) seq_offset (\d+)/o) { my $pwrguid = hexify($1); my $txn = $2; my $ktxn = $2; my $pwr = $pwr{$pwrguid}; @@ -850,7 +850,7 @@ while(<>) { die if $pwr->{suppressbegin}; my $n = (defined $pwr->{cseq} && defined $pwr->{seq}) ? $pwr->{seq} - $pwr->{cseq} + 1 : 0; my $nr = keys %{$pwr->{matches}}; - printf "%9.3f %35s $topfmt %16s RCV COMMIT txn %d %d [%d samples %d readers]\n", $ts, fmtguid($pwrguid), $pwr->{stopic}, "", $txn, $ktxn, $n, $nr + (void) printf "%9.3f %35s $topfmt %16s RCV COMMIT txn %d %d [%d samples %d readers]\n", $ts, fmtguid($pwrguid), $pwr->{stopic}, "", $txn, $ktxn, $n, $nr if $shows{in} && $pwr->{topic} =~ /$topic_filter/o && $pwr->{topic} !~ /$topic_xfilter/o; $pwr->{cseq} = undef; } elsif (/data\(application, vendor \d+\.\d+\): ($guidre) #(\d+)((?: C#\d+)?): ST(\d+) [^\{]+?(\{.*|:k:\{.*|:e:\(blob\))/o) { @@ -877,15 +877,15 @@ while(<>) { } if (defined $pwr->{cseq}) { if (! defined $oldcseq) { - printf "%9.3f %35s $topfmt %16s RCV BEGIN\n", $ts, fmtguid($pwrguid), $pwr->{stopic}, "" + (void) printf "%9.3f %35s $topfmt %16s RCV BEGIN\n", $ts, fmtguid($pwrguid), $pwr->{stopic}, "" if $shows{in} && $pwr->{topic} =~ /$topic_filter/o && $pwr->{topic} !~ /$topic_xfilter/o; $pwr->{suppressbegin} = 1; } elsif ($oldcseq != $pwr->{cseq}) { - printf "%9.3f %35s $topfmt %16s RCV IMPLICIT COMMIT + BEGIN\n", $ts, fmtguid($pwrguid), $pwr->{stopic}, "" + (void) printf "%9.3f %35s $topfmt %16s RCV IMPLICIT COMMIT + BEGIN\n", $ts, fmtguid($pwrguid), $pwr->{stopic}, "" if $shows{in} && $pwr->{topic} =~ /$topic_filter/o && $pwr->{topic} !~ /$topic_xfilter/o; } } elsif (defined $oldcseq) { - printf "%9.3f %35s $topfmt %16s RCV IMPLICIT COMMIT\n", $ts, fmtguid($pwrguid), $pwr->{stopic}, "" + (void) printf "%9.3f %35s $topfmt %16s RCV IMPLICIT COMMIT\n", $ts, fmtguid($pwrguid), $pwr->{stopic}, "" if $shows{in} && $pwr->{topic} =~ /$topic_filter/o && $pwr->{topic} !~ /$topic_xfilter/o; } my $op = ($data =~ /^:e:/) ? "W " : $opstr{$st.$dflag}; @@ -908,7 +908,7 @@ while(<>) { $tstamp = sprintf " (@%.3f?) ", $last_infots; } } - printf "%9.3f %35s $topfmt %s #%-4d %-6s RCV %s%s [%s]\n", $ts, fmtguid($pwrguid), $pwr->{stopic}, $op, $seq, $cseq, $tstamp, $sdata, $readers_str if $print; + (void) printf "%9.3f %35s $topfmt %s #%-4d %-6s RCV %s%s [%s]\n", $ts, fmtguid($pwrguid), $pwr->{stopic}, $op, $seq, $cseq, $tstamp, $sdata, $readers_str if $print; } elsif (/DATA\(($guidre)\s*->\s*$guidre\s+#(\d+)/o) { my $pwrguid = hexify($1); my $seq = $2; (my $ppguid = $pwrguid) =~ s/:[0-9a-f]+$/:1c1/; @@ -939,17 +939,17 @@ while(<>) { my $topic = $1; my $type = $2; my $qos = $3; my $sysid = "0"; $topic_qos{$topic} = $qos; - printf "%9.3f %35s $topfmt %16s RCV %s (%s)\n", $ts, $sysid, "TOPIC", "", $topic, $type if $shows{topic} && $shows{in}; + (void) printf "%9.3f %35s $topfmt %16s RCV %s (%s)\n", $ts, $sysid, "TOPIC", "", $topic, $type if $shows{topic} && $shows{in}; } elsif (/: sedp: write topic ([^ ]+)/) { my $topic = $1; - printf "%9.3f %35s $topfmt %16s XMT %s\n", $ts, "0", "TOPIC", "", $topic if $shows{topic} && $shows{out}; + (void) printf "%9.3f %35s $topfmt %16s XMT %s\n", $ts, "0", "TOPIC", "", $topic if $shows{topic} && $shows{out}; } elsif (/writer ($guidre)(?: topic ([^ ]+))? waiting for whc/o) { my $wrguid = hexify($1); $tlast_txblock{$tid} = 0 unless exists $tlast_txblock{$tid}; $txblock{$tid} = $ts; $txblockwr{$tid} = $wrguid; $txblocktp{$tid} = defined $2 ? $2 : exists $wr{$wrguid} && exists $wr{$wrguid}->{topic} ? $wr{$wrguid}->{topic} : 'unknown'; - printf "%9.3f %35s $topfmt BLCK\n", $ts, fmtguid($wrguid), $txblocktp{$tid} if $shows{throttle}; + (void) printf "%9.3f %35s $topfmt BLCK\n", $ts, fmtguid($wrguid), $txblocktp{$tid} if $shows{throttle}; } elsif (/writer ($guidre) done waiting/o) { my $wrguid = hexify($1); my $dt = $ts - $txblock{$tid}; @@ -959,24 +959,24 @@ while(<>) { delete $txblocktp{$tid}; if ($shows{throttle} || $mustprint) { if (!exists $wr{$wrguid}) { - printf "%9.3f %35s $topfmt UNBK after %.3fs\n", $ts, fmtguid($wrguid), "", $dt; + (void) printf "%9.3f %35s $topfmt UNBK after %.3fs\n", $ts, fmtguid($wrguid), "", $dt; } else { my $wr = $wr{$wrguid}; - printf "%9.3f %35s $topfmt UNBK after %.3fs\n", $ts, fmtguid($wrguid), $wr->{stopic}, $dt; + (void) printf "%9.3f %35s $topfmt UNBK after %.3fs\n", $ts, fmtguid($wrguid), $wr->{stopic}, $dt; } } } elsif (/message dropped because sender ($gidre) is unknown/o) { my $gid = hexify($1); $gid =~ /^([0-9a-f]+):([0-9a-f]+):([0-9a-f]+)/; my $decgid = sprintf "{%d,%d,%d}", hex $1, hex $2, hex $3; - printf "%9.3f %55s DROP unknown writer %s (a.k.a. %s) \n", $ts, "", $gid, $decgid; + (void) printf "%9.3f %55s DROP unknown writer %s (a.k.a. %s) \n", $ts, "", $gid, $decgid; } elsif (/writer ($guidre) topic .* considering reader ($guidre) non-responsive/o) { my $wrguid = hexify($1); my $prdguid = hexify($2); if (! exists $wr{$wrguid}) { - printf "%9.3f %35s $topfmt UNRP unknown writer declaring reader %s non-responsive\n", $ts, fmtguid($wrguid), "", fmtguid($prdguid); + (void) printf "%9.3f %35s $topfmt UNRP unknown writer declaring reader %s non-responsive\n", $ts, fmtguid($wrguid), "", fmtguid($prdguid); } else { my $wr = $wr{$wrguid}; - printf "%9.3f %35s $topfmt UNRP writer declaring reader %s non-responsive\n", $ts, fmtguid($wrguid), $wr->{stopic}, fmtguid($prdguid); + (void) printf "%9.3f %35s $topfmt UNRP writer declaring reader %s non-responsive\n", $ts, fmtguid($wrguid), $wr->{stopic}, fmtguid($prdguid); my @lates = acklate(1e100, $wrguid); my @details = (); for (@lates) { @@ -985,12 +985,12 @@ while(<>) { } my $details = join '\n', @details; if ($details ne $last_nonresponsive_details) { - printf "%9.3f %s\n", $ts, $_ for @details; + (void) printf "%9.3f %s\n", $ts, $_ for @details; $last_nonresponsive_details = $details; } } } elsif (/: update_mtreader: (.*)/) { - printf "%9.3f %55s UMTR %s\n", $ts, "", $1 if $shows{mtreader}; + (void) printf "%9.3f %55s UMTR %s\n", $ts, "", $1 if $shows{mtreader}; } elsif (!defined($self_fullversion) && /: spdp_write\($guidre\) - internals: [^\/]*\/([^\/]+)\//o) { $self_fullversion = $1; @self_version = ($self_fullversion =~ /^(\d+)\.(\d+)\.(\d+)(?:p(\d+))?/); @@ -1009,12 +1009,12 @@ for my $t (keys %txblock) { if (defined $txblock{$t} && $shows{block}) { my $dt = $ts - $txblock{$t}; my $wrguid = $txblockwr{$t}; - printf "%9.3f %35s $topfmt BLCK still blocked at end of log after %.3fs\n", $ts, fmtguid($wrguid), $txblocktp{$t}, $dt; + (void) printf "%9.3f %35s $topfmt BLCK still blocked at end of log after %.3fs\n", $ts, fmtguid($wrguid), $txblocktp{$t}, $dt; if (exists $wr{$txblockwr{$t}}) { my @lates = acklate(1e100, $txblockwr{$t}); for (@lates) { my $cause = ($_->{haveack} ? sprintf "%d behind", $_->{nsamp} : "no ack yet"); - printf "%9.3f %35s $topfmt BLCK %s (%s)\n", $ts, fmtguid($txblockwr{$t}), $txblocktp{$t}, fmtguid($_->{guid}), $cause; + (void) printf "%9.3f %35s $topfmt BLCK %s (%s)\n", $ts, fmtguid($txblockwr{$t}), $txblocktp{$t}, fmtguid($_->{guid}), $cause; } } } @@ -1182,7 +1182,7 @@ sub check_disccomplete { my $dt = $ts - $proxypp{$ppguid}->{tcreate}; (my $ppguidpre = $ppguid) =~ s/:1c1$//; my $sx = decimal_sysid($sysid); - printf "%9.3f %35s $topfmt DISC node %s (%s; %s) discovery complete after %.3fs\n", $ts, $ppguidpre, "", $sysid{$sysid}->{ip}, $sx, $sysid{$sysid}->{name}, $dt; + (void) printf "%9.3f %35s $topfmt DISC node %s (%s; %s) discovery complete after %.3fs\n", $ts, $ppguidpre, "", $sysid{$sysid}->{ip}, $sx, $sysid{$sysid}->{name}, $dt; } } } @@ -1210,7 +1210,7 @@ sub delete_pwr { $pwr{$pwrguid}->{cseq} = undef; delete $tstamps{$pwrguid}; if ($shows{remotedisc} && $pwr{$pwrguid}->{topic} =~ /$topic_filter/o && $pwr{$pwrguid}->{topic} !~ /$topic_xfilter/o) { - printf "%9.3f %35s $topfmt UNDISCOVER %s\n", $ts, $pwrguid, $pwr{$pwrguid}->{stopic}, $isimplicit ? " (implicit)" : ""; + (void) printf "%9.3f %35s $topfmt UNDISCOVER %s\n", $ts, $pwrguid, $pwr{$pwrguid}->{stopic}, $isimplicit ? " (implicit)" : ""; } } else { delete $proxypp->{pwr}->{$pwrguid}; @@ -1238,16 +1238,16 @@ sub delete_prd { if ($x->{seqp1} == 0) { # also happens when a writer with an empty WHC has written # nothing since the match, hence disabling it for now - printf "%9.3f %35s $topfmt DEL %s no ACKs received, reader matched for %.3fs\n", $ts, $_, $wr{$_}->{stopic}, $prdguid, $dtmatch + (void) printf "%9.3f %35s $topfmt DEL %s no ACKs received, reader matched for %.3fs\n", $ts, $_, $wr{$_}->{stopic}, $prdguid, $dtmatch if $shows{ack} && 0; } elsif ($wr{$_}->{seq} >= $x->{seqp1}) { - printf "%9.3f %35s $topfmt DEL %s %d samples behind, reader matched for %.3fs\n", $ts, $_, $wr{$_}->{stopic}, $prdguid, $wr{$_}->{seq} - $x->{seqp1} + 1, $dtmatch + (void) printf "%9.3f %35s $topfmt DEL %s %d samples behind, reader matched for %.3fs\n", $ts, $_, $wr{$_}->{stopic}, $prdguid, $wr{$_}->{seq} - $x->{seqp1} + 1, $dtmatch if $shows{ack} && show_topic($wr{$_}->{topic}); } $prd->{matches}->{$_}->{seqp1del} = $x->{seqp1}; delete $wr{$_}->{matches}->{$prdguid}; if ($wr{$_}->{acklate} && acklate($ts, $_) == 0) { - printf "%9.3f %35s $topfmt ACK caught up because of unmatch\n", $ts, fmtguid($_), $wr{$_}->{stopic} if $shows{ack} && show_topic($wr{$_}->{topic}); + (void) printf "%9.3f %35s $topfmt ACK caught up because of unmatch\n", $ts, fmtguid($_), $wr{$_}->{stopic} if $shows{ack} && show_topic($wr{$_}->{topic}); $wr{$_}->{acklate} = 0; } } @@ -1256,7 +1256,7 @@ sub delete_prd { $prd{$prdguid}->{tdel} = $ts; $prd{$prdguid}->{explicitdel} = 1 unless $isimplicit; if ($shows{remotedisc} && $prd{$prdguid}->{topic} =~ /$topic_filter/o && $prd{$prdguid}->{topic} !~ /$topic_xfilter/o) { - printf "%9.3f %35s $topfmt UNDISCOVER %s\n", $ts, $prdguid, $prd{$prdguid}->{stopic}, $isimplicit ? " (implicit)" : ""; + (void) printf "%9.3f %35s $topfmt UNDISCOVER %s\n", $ts, $prdguid, $prd{$prdguid}->{stopic}, $isimplicit ? " (implicit)" : ""; } } else { delete $proxypp->{prd}->{$prdguid}; @@ -1280,7 +1280,7 @@ sub delete_proxypp { my $dt = (defined $sysid{$sysid}->{tcrash}) ? $ts - $sysid{$sysid}->{tcrash} : undef; my $dtmsg = (defined $dt) ? sprintf " (cleanup took %.3fs)", $dt : ""; my $sx = decimal_sysid($sysid); - printf "%9.3f %35s $topfmt DISC node %s (%s; %s) no proxy participants left%s\n", + (void) printf "%9.3f %35s $topfmt DISC node %s (%s; %s) no proxy participants left%s\n", $ts, $sysid, "", $sysid{$sysid}->{ip}, $sx, $sysid{$sysid}->{name}, $dtmsg; $sysid{$sysid}->{tdel} = $ts; $sysid{$sysid}->{tcrash} = undef; @@ -1322,13 +1322,13 @@ sub show_topic { sub check_qos { my ($ts, $kind, $guid, $topic, $partitions, $qos, $pubsub_opt) = @_; if ($kind eq 'WRITER' && $qos =~ /,presentation=2:1:/ && $qos =~ /,history=0:/) { - printf "%9.3f $kind %s %s {%s} is keep-last and group coherent\n", $ts, $guid, $topic, $partitions if $shows{warn}; + (void) printf "%9.3f $kind %s %s {%s} is keep-last and group coherent\n", $ts, $guid, $topic, $partitions if $shows{warn}; } #if ($kind eq 'WRITER' && $qos =~ /,durability=3/) { # if (exists $topic_qos{$topic} && $topic_qos{$topic} =~ /,durability=[0-2]/) { - # printf "%9.3f $kind %s %s {%s} is persistent but topic is not\n", $ts, $guid, $topic, $partitions if $shows{warn}; + # (void) printf "%9.3f $kind %s %s {%s} is persistent but topic is not\n", $ts, $guid, $topic, $partitions if $shows{warn}; # } else { - # printf "%9.3f $kind %s %s {%s} is persistent but topic QoS is not yet known\n", $ts, $guid, $topic, $partitions if $shows{warn}; + # (void) printf "%9.3f $kind %s %s {%s} is persistent but topic QoS is not yet known\n", $ts, $guid, $topic, $partitions if $shows{warn}; # } #} if ($qos =~ /,presentation=2:1:/ && defined $pubsub_opt) { @@ -1336,14 +1336,14 @@ sub check_qos { $pubsub_opt->{durqos} = $durqos unless defined $pubsub_opt->{durqos}; if ($durqos != $pubsub_opt->{durqos}) { my @durstr = qw(volatile transient-local transient persistent); - printf "%9.3f $kind %s %s {%s} is group coherent with durability %s where group is %s\n", $ts, $guid, $topic, $partitions, $durstr[$durqos], $durstr[$pubsub_opt->{durqos}] if $shows{warn}; + (void) printf "%9.3f $kind %s %s {%s} is group coherent with durability %s where group is %s\n", $ts, $guid, $topic, $partitions, $durstr[$durqos], $durstr[$pubsub_opt->{durqos}] if $shows{warn}; } } #if ($qos =~ /,presentation=2:1:/ && $qos =~ /,history=0:/) { - # printf "%9.3f $kind %s %s {%s} is keep-last and group coherent\n", $ts, $guid, $topic, $partitions; + # (void) printf "%9.3f $kind %s %s {%s} is keep-last and group coherent\n", $ts, $guid, $topic, $partitions; #} #if ($kind eq 'WRITER' && $qos =~ /,durability=[23]/ && $qos =~ /,writer_data_lifecycle=\{1/) { - # printf "%9.3f $kind %s %s {%s} is transient/persistent and auto-dispose\n", $ts, $guid, $topic, $partitions; + # (void) printf "%9.3f $kind %s %s {%s} is transient/persistent and auto-dispose\n", $ts, $guid, $topic, $partitions; #} } @@ -1471,7 +1471,7 @@ EOT "compact" => "use a more compact representation in some places (currently only d_sampleChain)", "qos" => "show QoS in some places (currently only d_sampleChain)"); for (sort (keys %shows)) { - printf "* %-14s %-5s %s\n", $_, $shows{$_} ? "yes" : "no", fmtblurb ($blurbs{$_}); + (void) printf "* %-14s %-5s %s\n", $_, $shows{$_} ? "yes" : "no", fmtblurb ($blurbs{$_}); } print << 'EOT' Keywords in the output (in the 4th column, after the topic name, though diff --git a/src/tools/idlc/src/descriptor.c b/src/tools/idlc/src/descriptor.c index b46913f8f2..ab205a522d 100644 --- a/src/tools/idlc/src/descriptor.c +++ b/src/tools/idlc/src/descriptor.c @@ -2529,6 +2529,10 @@ generate_descriptor_impl( { idl_retcode_t ret; idl_visitor_t visitor; + struct constructed_type_key *ctype_keys = NULL; + struct constructed_type *ctype = NULL; + uint32_t n_keys = 0; + allowable_data_representations_t dr = IDL_ALLOWABLE_DATAREPRESENTATION_DEFAULT; /* must be invoked for topics only, so structs and unions */ assert(idl_is_struct(topic_node) || idl_is_union(topic_node)); @@ -2563,10 +2567,8 @@ generate_descriptor_impl( if ((ret = resolve_offsets(descriptor)) < 0) goto err; - struct constructed_type_key *ctype_keys; - struct constructed_type *ctype = find_ctype(descriptor, descriptor->topic); + ctype = find_ctype(descriptor, descriptor->topic); assert(ctype); - uint32_t n_keys = 0; if ((ret = get_ctype_keys(pstate, descriptor, ctype, &ctype_keys, &n_keys, false, 0)) != IDL_RETCODE_OK) goto err; if ((ret = descriptor_init_keys(pstate, ctype, ctype_keys, descriptor, n_keys, (pstate->config.flags & IDL_FLAG_KEYLIST) != 0)) < 0) @@ -2580,7 +2582,7 @@ generate_descriptor_impl( descriptor->flags |= DDS_TOPIC_FIXED_KEY_XCDR2; /* set data representation restriction flag and mask (ignore unsupported data representations) */ - allowable_data_representations_t dr = idl_allowable_data_representations(descriptor->topic); + dr = idl_allowable_data_representations(descriptor->topic); if (dr != IDL_ALLOWABLE_DATAREPRESENTATION_DEFAULT && (dr & (IDL_DATAREPRESENTATION_FLAG_XCDR1 | IDL_DATAREPRESENTATION_FLAG_XCDR2))) { descriptor->flags |= DDS_TOPIC_RESTRICT_DATA_REPRESENTATION; descriptor->data_representations = dr; diff --git a/src/tools/idlc/src/descriptor_type_meta.c b/src/tools/idlc/src/descriptor_type_meta.c index 506de71c3c..d3bbbbda76 100644 --- a/src/tools/idlc/src/descriptor_type_meta.c +++ b/src/tools/idlc/src/descriptor_type_meta.c @@ -881,6 +881,10 @@ add_union_case(const idl_pstate_t *pstate, struct descriptor_type_meta *dtm, DDS if (cnt) { m.common.label_seq._buffer = idl_calloc (cnt, sizeof (*m.common.label_seq._buffer)); c.common.label_seq._buffer = idl_calloc (cnt, sizeof (*c.common.label_seq._buffer)); + if (NULL == m.common.label_seq._buffer || NULL == c.common.label_seq._buffer) { + ret = IDL_RETCODE_NO_MEMORY; + goto err; + } for (cl = case_node->labels, n = 0; cl; cl = idl_next (cl)) { if ((idl_mask(cl) & mask) != mask) { int64_t val = idl_case_label_intvalue (cl); diff --git a/src/tools/idlc/src/idlc.c b/src/tools/idlc/src/idlc.c index e6446d5359..def907a1c7 100644 --- a/src/tools/idlc/src/idlc.c +++ b/src/tools/idlc/src/idlc.c @@ -586,7 +586,7 @@ static const idlc_option_t *compopts[] = { static void print_version(const char *prog) { - printf("%s (Eclipse Cyclone DDS) %s\n", prog, IDL_VERSION); + (void) printf("%s (Eclipse Cyclone DDS) %s\n", prog, IDL_VERSION); } static const char *figure_language(int argc, char **argv) @@ -647,7 +647,7 @@ int main(int argc, char *argv[]) lang = figure_language(argc, argv); memset(&gen, 0, sizeof(gen)); if (idlc_load_generator(&gen, lang) == -1) - fprintf(stderr, "%s: cannot load generator %s\n", prog, lang); + (void) fprintf(stderr, "%s: cannot load generator %s\n", prog, lang); config.argc = 0; if (!(config.argv = idl_calloc((size_t)argc + 7, sizeof(config.argv[0])))) @@ -683,7 +683,7 @@ int main(int argc, char *argv[]) case 0: break; case IDLC_BAD_INPUT: - fprintf(stderr, "%s: conflicting options in generator %s\n", prog, lang); + (void) fprintf(stderr, "%s: conflicting options in generator %s\n", prog, lang); /* fall through */ default: print_usage(prog, "[OPTIONS] FILE"); @@ -712,7 +712,7 @@ int main(int argc, char *argv[]) if ((ret = idlc_parse(generator_annotations))) { /* assume other errors are reported by processor */ if (ret == IDL_RETCODE_NO_MEMORY) - fprintf(stderr, "Out of memory\n"); + (void) fprintf(stderr, "Out of memory\n"); goto err_parse; } else if (config.compile) { idlc_generator_config_t generator_config; @@ -744,7 +744,7 @@ int main(int argc, char *argv[]) idl_free(generator_config.base_dir); idl_delete_pstate(pstate); if (ret) { - fprintf(stderr, "Failed to compile '%s'\n", config.file); + (void) fprintf(stderr, "Failed to compile '%s'\n", config.file); goto err_generate; } } diff --git a/src/tools/idlc/src/options.c b/src/tools/idlc/src/options.c index 2fda1cf651..4b7bc814e8 100644 --- a/src/tools/idlc/src/options.c +++ b/src/tools/idlc/src/options.c @@ -32,7 +32,7 @@ static void print_description (const char *desc, int indent, int init_indent, in int n = (int)strspn (desc + 1, " "); desc += 1 + n; cindent = indent + n; - printf ("\n%*s", cindent, ""); + (void) printf ("\n%*s", cindent, ""); pos = cindent; } else @@ -40,10 +40,10 @@ static void print_description (const char *desc, int indent, int init_indent, in int n = (int)strcspn (desc, " \t\n"); if (pos + n > maxwidth) { - printf ("\n%*s", cindent, ""); + (void) printf ("\n%*s", cindent, ""); pos = cindent; } - printf ("%*s%*.*s", (pos == cindent) ? 0 : 1, "", n, n, desc); + (void) printf ("%*s%*.*s", (pos == cindent) ? 0 : 1, "", n, n, desc); pos += n + ((pos == cindent) ? 0 : 1); desc += n + (int)strspn (desc + n, " "); } @@ -55,7 +55,7 @@ static void print_description (const char *desc, int indent, int init_indent, in cindent = pos; } } - printf ("\n"); + (void) printf ("\n"); } static int ascending(const void *va, const void *vb) @@ -123,18 +123,18 @@ void print_help( const char *argv0, const char *rest, idlc_option_t **options) { idlc_option_t **opts; - printf("Usage: %s%s%s\n", argv0, rest ? " " : "", rest ? rest : ""); + (void) printf("Usage: %s%s%s\n", argv0, rest ? " " : "", rest ? rest : ""); if (!(opts = sort_options(options, &ascending))) return; - printf("Options:\n"); + (void) printf("Options:\n"); for (size_t i=0; opts[i]; i++) { int cnt, off = INDENT; char buf[WIDTH + 1]; cnt = format_option(buf, sizeof(buf), 2, opts[i]); if (cnt <= off) - printf("%-*s", off, buf); + (void) printf("%-*s", off, buf); else - printf("%s\n%*s", buf, off, ""); + (void) printf("%s\n%*s", buf, off, ""); print_description(opts[i]->help, off, off, WIDTH); } idl_free(opts); @@ -143,8 +143,8 @@ void print_help( void print_usage( const char *argv0, const char *rest) { - fprintf(stderr, "Usage: %s%s%s\n", argv0, rest ? " " : "", rest ? rest : ""); - fprintf(stderr, "Try '%s -h' for more information.\n", argv0); + (void) fprintf(stderr, "Usage: %s%s%s\n", argv0, rest ? " " : "", rest ? rest : ""); + (void) fprintf(stderr, "Try '%s -h' for more information.\n", argv0); } static void print_error( @@ -152,9 +152,9 @@ static void print_error( { if (!isempty(subopt)) { int len = (int)strcspn(subopt, "="); - fprintf(stderr,"%s%s%c %.*s\n",argv0, errstr, opt, len, subopt); + (void) fprintf(stderr,"%s%s%c %.*s\n",argv0, errstr, opt, len, subopt); } else { - fprintf(stderr,"%s%s%c\n",argv0, errstr, opt); + (void) fprintf(stderr,"%s%s%c\n",argv0, errstr, opt); } } diff --git a/src/tools/idlc/src/plugin.c b/src/tools/idlc/src/plugin.c index 6bfa2d7932..a79da5e3ef 100644 --- a/src/tools/idlc/src/plugin.c +++ b/src/tools/idlc/src/plugin.c @@ -217,14 +217,14 @@ idlc_load_generator(idlc_generator_plugin_t *plugin, const char *lang) plugin->generator_options = loadsym(handle, "generator_options"); plugin->generator_annotations = loadsym(handle, "generator_annotations"); } else { - fprintf(stderr, "Symbol 'generate' not found in %s\n", path); + (void) fprintf(stderr, "Symbol 'generate' not found in %s\n", path); closelib(handle); } } else { char errmsg[300]; liberror(errmsg, sizeof(errmsg)); - fprintf(stderr, "Cannot load generator %s: %s\n", path, errmsg); + (void) fprintf(stderr, "Cannot load generator %s: %s\n", path, errmsg); } if (file) { diff --git a/src/tools/idlc/tests/descriptor.c b/src/tools/idlc/tests/descriptor.c index 53aa2ec0de..9787eafff3 100644 --- a/src/tools/idlc/tests/descriptor.c +++ b/src/tools/idlc/tests/descriptor.c @@ -88,7 +88,7 @@ CU_Test(idlc_descriptor, keys_nested) static idl_pstate_t *pstate = NULL; struct descriptor descriptor; - printf ("running test for idl: %s\n", tests[i].idl); + (void) printf ("running test for idl: %s\n", tests[i].idl); ret = idl_create_pstate (flags | (tests[i].keylist ? IDL_FLAG_KEYLIST : 0), NULL, &pstate); CU_ASSERT_EQUAL_FATAL (ret, IDL_RETCODE_OK); @@ -146,7 +146,7 @@ CU_Test(idlc_descriptor, default_extensibility) static idl_pstate_t *pstate = NULL; struct descriptor descriptor; - printf ("running test for idl: %s\n", tests[i].idl); + (void) printf ("running test for idl: %s\n", tests[i].idl); ret = idl_create_pstate (flags, NULL, &pstate); pstate->config.default_extensibility = (int) tests[i].default_ext; CU_ASSERT_EQUAL_FATAL (ret, IDL_RETCODE_OK); @@ -244,7 +244,7 @@ CU_Test(idlc_descriptor, key_size) static idl_pstate_t *pstate = NULL; struct descriptor descriptor; - printf ("running test for idl: %s\n", tests[i].idl); + (void) printf ("running test for idl: %s\n", tests[i].idl); ret = idl_create_pstate (flags, NULL, &pstate); CU_ASSERT_EQUAL_FATAL (ret, IDL_RETCODE_OK); @@ -297,7 +297,7 @@ CU_Test(idlc_descriptor, key_valid_types) static idl_pstate_t *pstate = NULL; struct descriptor descriptor; - printf ("running test for idl: %s\n", tests[i].idl); + (void) printf ("running test for idl: %s\n", tests[i].idl); ret = idl_create_pstate (flags, NULL, &pstate); CU_ASSERT_EQUAL_FATAL (ret, IDL_RETCODE_OK); memset (&descriptor, 0, sizeof (descriptor)); /* static analyzer */ @@ -357,7 +357,7 @@ CU_Test(idlc_descriptor, keys_inheritance) static idl_pstate_t *pstate = NULL; struct descriptor descriptor; - printf ("running test for idl: %s\n", tests[i].idl); + (void) printf ("running test for idl: %s\n", tests[i].idl); ret = idl_create_pstate (flags, NULL, &pstate); CU_ASSERT_EQUAL_FATAL (ret, IDL_RETCODE_OK); diff --git a/src/tools/idlc/tests/type_meta.c b/src/tools/idlc/tests/type_meta.c index 6809ab71ef..ee4a09fc69 100644 --- a/src/tools/idlc/tests/type_meta.c +++ b/src/tools/idlc/tests/type_meta.c @@ -68,7 +68,7 @@ CU_Test(idlc_type_meta, union_max_label_value) idl_snprintf (idl, sizeof (idl), fmt, tests[i].switch_type, tests[i].label_value); - printf ("running test for idl: %s\n", idl); + (void) printf ("running test for idl: %s\n", idl); ret = idl_create_pstate (flags, NULL, &pstate); CU_ASSERT_EQUAL_FATAL (ret, IDL_RETCODE_OK); @@ -787,7 +787,7 @@ CU_Test(idlc_type_meta, type_obj_serdes) struct descriptor descriptor; struct descriptor_type_meta dtm; - printf ("running test for idl: %s\n", tests[i].idl); + (void) printf ("running test for idl: %s\n", tests[i].idl); ret = idl_create_pstate (flags, NULL, &pstate); CU_ASSERT_EQUAL_FATAL (ret, IDL_RETCODE_OK); @@ -803,7 +803,7 @@ CU_Test(idlc_type_meta, type_obj_serdes) { struct ddsi_typeid_str tidstr; const char *type_name = idl_identifier(tm->node); - printf ("test type %s %s\n", type_name ? type_name : "", ddsi_make_typeid_str_impl (&tidstr, tm->ti_complete)); + (void) printf ("test type %s %s\n", type_name ? type_name : "", ddsi_make_typeid_str_impl (&tidstr, tm->ti_complete)); // serialize the generated type object dds_ostream_t os; diff --git a/src/tools/idlc/xtests/main.c b/src/tools/idlc/xtests/main.c index 791499a53c..59aa7425c9 100644 --- a/src/tools/idlc/xtests/main.c +++ b/src/tools/idlc/xtests/main.c @@ -57,11 +57,11 @@ static void print_raw_cdr (dds_ostream_t *os) { for (uint32_t n = 0; n < os->m_index; n++) { - printf("%02x ", os->m_buffer[n]); + (void) printf("%02x ", os->m_buffer[n]); if (!((n + 1) % 16)) - printf("\n"); + (void) printf("\n"); } - printf("\n"); + (void) printf("\n"); } int rd_cmp_print_key (dds_ostream_t *os, const void *msg_wr, struct ddsi_sertype_default *sertype) @@ -76,12 +76,12 @@ int rd_cmp_print_key (dds_ostream_t *os, const void *msg_wr, struct ddsi_sertype // compare res = cmp_key(msg_wr, msg_rd); - printf("key compare result: %d\n", res); + (void) printf("key compare result: %d\n", res); // print is.m_index = 0; (void) dds_stream_print_key (&is, sertype, buf, sizeof (buf)); - printf("key: %s\n", buf); + (void) printf("key: %s\n", buf); free_sample(msg_rd); return res; @@ -93,7 +93,7 @@ int main(int argc, char **argv) (void)argv; int res = 0; - printf("Running test for type %s\n", desc->m_typename); + (void) printf("Running test for type %s\n", desc->m_typename); // create sertype struct ddsi_sertype_default sertype; @@ -110,7 +110,7 @@ int main(int argc, char **argv) init_sample(msg_wr); // write data - printf("cdr write %s\n", tests[i] == BE ? "BE" : "LE"); + (void) printf("cdr write %s\n", tests[i] == BE ? "BE" : "LE"); dds_ostream_t os = { NULL, 0, 0, CDR_ENC_VERSION_2 }; bool ret; if (tests[i] == BE) @@ -119,10 +119,10 @@ int main(int argc, char **argv) ret = dds_stream_write_sampleLE ((dds_ostreamLE_t *)(&os), msg_wr, &sertype); if (!ret) { - printf("cdr write failed\n"); + (void) printf("cdr write failed\n"); return 1; } - printf("sample data cdr:\n"); + (void) printf("sample data cdr:\n"); print_raw_cdr (&os); dds_istream_t is = { os.m_buffer, os.m_size, 0, CDR_ENC_VERSION_2 }; @@ -130,29 +130,29 @@ int main(int argc, char **argv) // normalize sample uint32_t actual_size = 0; bool swap = (DDSRT_ENDIAN == DDSRT_LITTLE_ENDIAN) ? (tests[i] == BE) : (tests[i] == LE); - printf("cdr normalize (%sswap)\n", swap ? "" : "no "); + (void) printf("cdr normalize (%sswap)\n", swap ? "" : "no "); if (!dds_stream_normalize ((void *)is.m_buffer, os.m_index, swap, CDR_ENC_VERSION_2, &sertype, false, &actual_size)) { - printf("cdr normalize failed\n"); + (void) printf("cdr normalize failed\n"); return 1; } if (actual_size != os.m_index) { - printf("cdr normalize size invalid (actual: %u, expected: %u)\n", actual_size, os.m_index); + (void) printf("cdr normalize size invalid (actual: %u, expected: %u)\n", actual_size, os.m_index); return 1; } // read data and check for expected result - printf("cdr read data\n"); + (void) printf("cdr read data\n"); void *msg_rd = ddsrt_calloc (1, desc->m_size); dds_stream_read_sample (&is, msg_rd, &sertype); res = cmp_sample(msg_wr, msg_rd); - printf("data compare result: %d\n", res); + (void) printf("data compare result: %d\n", res); // print sample is.m_index = 0; (void) dds_stream_print_sample (&is, &sertype, buf, sizeof (buf)); - printf("sample: %s\n", buf); + (void) printf("sample: %s\n", buf); if (res == 0 && sertype.type.keys.nkeys > 0) { @@ -161,10 +161,10 @@ int main(int argc, char **argv) dds_ostream_t os_key_from_data = { NULL, 0, 0, CDR_ENC_VERSION_2 }; if (!dds_stream_extract_key_from_data (&is, &os_key_from_data, &sertype)) { - printf("extract key from data failed\n"); + (void) printf("extract key from data failed\n"); return 1; } - printf("key cdr:\n"); + (void) printf("key cdr:\n"); print_raw_cdr (&os_key_from_data); res = rd_cmp_print_key (&os_key_from_data, msg_wr, &sertype); diff --git a/src/tools/idlpp/src/directive.c b/src/tools/idlpp/src/directive.c index 2c7022861a..75f41d9a9e 100644 --- a/src/tools/idlpp/src/directive.c +++ b/src/tools/idlpp/src/directive.c @@ -593,7 +593,7 @@ static long do_line( void) unget_ch(); } else { if (warn_level & 1) { - scan_token( c, ((void)(workp = work_buf), &workp), work_end); + (void) scan_token( c, ((void)(workp = work_buf), &workp), work_end); cwarn( excess, work_buf, 0, NULL); } skip_nl(); @@ -762,7 +762,8 @@ DEFBUF * do_define( } } } - strlcpy( macroname, identifier, sizeof(macroname)); /* Remember the name */ + + (void) strlcpy( macroname, identifier, sizeof(macroname)); /* Remember the name */ in_define = TRUE; /* Recognize '#', '##' */ if (get_parm() == FALSE) { /* Get parameter list */ @@ -1226,10 +1227,10 @@ static char * str_parm_scan( char * string_end) * String parameter scan. * This code -- if enabled -- recognizes a formal parameter in a string * literal or in a character constant. - * #define foo(bar, v) printf("%bar\n", v) + * #define foo(bar, v) (void) printf("%bar\n", v) * foo( d, i) * expands to: - * printf("%d\n", i) + * (void) printf("%d\n", i) * str_parm_scan() return the advanced pointer into the replacement text. * This has been superceded by # stringizing and string concatenation. * This routine is called only in OLD_PREP mode. diff --git a/src/tools/idlpp/src/eval.c b/src/tools/idlpp/src/eval.c index a9fdbb37a4..e74dbbfd9c 100644 --- a/src/tools/idlpp/src/eval.c +++ b/src/tools/idlpp/src/eval.c @@ -1319,7 +1319,7 @@ static VAL_SIGN * eval_eval( expr_t v3; v3 = (sign1 == SIGNED ? v1 : v2); - snprintf( negate, sizeof(negate), neg_format, v3, v3); + (void) snprintf( negate, sizeof(negate), neg_format, v3, v3); cwarn( negate, skip ? non_eval : NULL, 0L, NULL); } valp->sign = sign1 = UNSIGNED; diff --git a/src/tools/idlpp/src/expand.c b/src/tools/idlpp/src/expand.c index 989d00295c..c96a26db27 100644 --- a/src/tools/idlpp/src/expand.c +++ b/src/tools/idlpp/src/expand.c @@ -910,7 +910,7 @@ static char * close_macro_inf( *out_p++ = (char)((m_num % UCHARMAX) + 1); } *out_p = EOS; - get_ch(); /* Clear the garbage */ + (void) get_ch(); /* Clear the garbage */ unget_ch(); if (infile->fp || in_src_n) { if (infile->fp) { /* Macro call on source file */ @@ -1029,7 +1029,7 @@ static int prescan( switch (c) { case ST_QUOTE: assert( arglist != NULL); - skip_ws(); /* Skip spaces and the returned MAC_PARM*/ + (void) skip_ws(); /* Skip spaces and the returned MAC_PARM*/ c = get_ch() - 1; /* Parameter number */ prev_token = out; /* Remember the token */ out = stringize( defp, arglist[ c], out); @@ -1080,7 +1080,7 @@ static int prescan( break; default: prev_token = out; - scan_token( c, &out, out_end); /* Ordinary token */ + (void) scan_token( c, &out, out_end); /* Ordinary token */ break; } @@ -1135,7 +1135,7 @@ static char * catenate( file = unget_string( argp, NULL); while ((void)(c = get_ch()), file == infile) { prev_token = out; /* Remember the last token */ - scan_token( c, &out, out_end); + (void) scan_token( c, &out, out_end); } /* Copy actual argument without expansion */ unget_ch(); } else { @@ -1143,7 +1143,7 @@ static char * catenate( while ((c = get_ch()) != RT_END) { prev_prev_token = prev_token; prev_token = out; /* Remember the last token */ - scan_token( c, &out, out_end); + (void) scan_token( c, &out, out_end); } /* Copy actual argument without expansion */ if (*prev_token == TOK_SEP) { out = prev_token; @@ -1171,7 +1171,7 @@ static char * catenate( switch (c) { case ST_QUOTE: /* First stringize and then catenate */ assert( arglist != NULL); - skip_ws(); /* Skip MAC_PARM, ST_QUOTE */ + (void) skip_ws(); /* Skip MAC_PARM, ST_QUOTE */ c = get_ch() - 1; out = stringize( defp, arglist[ c], out); break; @@ -1192,12 +1192,12 @@ static char * catenate( c = get_ch(); /* enabling to replace */ } else if (c == IN_SRC) { /* Remove IN_SRC */ if (trace_macro) { - get_ch(); /* Also its number */ - get_ch(); + (void) get_ch(); /* Also its number */ + (void) get_ch(); } c = get_ch(); } - scan_token( c, &out, out_end); /* The first token */ + (void) scan_token( c, &out, out_end); /* The first token */ if (*infile->bptr) /* There are more tokens*/ in_arg = TRUE; } @@ -1206,15 +1206,15 @@ static char * catenate( break; case IN_SRC: if (trace_macro) { - get_ch(); - get_ch(); + (void) get_ch(); + (void) get_ch(); } /* Fall through */ case DEF_MAGIC: c = get_ch(); /* Skip DEF_MAGIC, IN_SRC */ /* Fall through */ default: - scan_token( c, &out, out_end); /* Copy the token */ + (void) scan_token( c, &out, out_end); /* Copy the token */ break; } @@ -1225,7 +1225,7 @@ static char * catenate( infile->fp = (FILE *)-1; /* To check token length*/ if (mcpp_debug & EXPAND) dump_string( "checking generated token", infile->buffer); - scan_token( c, ((void)(workp = work_buf), &workp), work_end); + (void) scan_token( c, ((void)(workp = work_buf), &workp), work_end); infile->fp = NULL; if (*infile->bptr != EOS) { /* More than a token */ if (option_flags.lang_asm) { /* Assembler source */ @@ -1238,7 +1238,7 @@ static char * catenate( } infile->bptr += strlen( infile->bptr); } - get_ch(); /* To the parent "file" */ + (void) get_ch(); /* To the parent "file" */ unget_ch(); } @@ -1251,7 +1251,7 @@ static char * catenate( file = infile; while ((void)(c = get_ch()), file == infile) { prev_token = out; /* Remember the last token */ - scan_token( c, &out, out_end); + (void) scan_token( c, &out, out_end); } /* Copy rest of argument without expansion */ unget_ch(); } else { @@ -1259,7 +1259,7 @@ static char * catenate( if (c == TOK_SEP) continue; /* Skip separator */ prev_token = out; /* Remember the last token */ - scan_token( c, &out, out_end); + (void) scan_token( c, &out, out_end); } /* Copy rest of argument without expansion */ } } @@ -1392,10 +1392,10 @@ static char * remove_magics( first = ap; if (char_type[ c & UCHARMAX] & HSP) space = ap; /* Remember the last white space */ - scan_token( c, &ap, ep); + (void) scan_token( c, &ap, ep); } if (file == infile) - get_ch(); /* Clear the "file" */ + (void) get_ch(); /* Clear the "file" */ unget_ch(); if (space == ep - 1) ep--; /* Remove trailing white space */ @@ -1500,7 +1500,7 @@ static char * remove_magics( size_t len = 0; if (c != MAC_INF) { - scan_token( c, ((void)(--tp), &tp), ep); + (void) scan_token( c, ((void)(--tp), &tp), ep); continue; } unget_ch(); /* Pushback MAC_INF */ @@ -1550,7 +1550,7 @@ static char * remove_magics( tp--; *tp = EOS; if (file == infile) - get_ch(); /* Clear the "file" */ + (void) get_ch(); /* Clear the "file" */ unget_ch(); done: @@ -1679,8 +1679,8 @@ static char * stringize( continue; /* Skip inserted separator */ } else if (c == IN_SRC) { /* Skip magics */ if (trace_macro) { - get_ch(); - get_ch(); + (void) get_ch(); + (void) get_ch(); } continue; } else if (c == '\\') { @@ -1688,21 +1688,21 @@ static char * stringize( } else if (c == MAC_INF) { /* Remove intervening magics */ switch (c = get_ch()) { case MAC_ARG_START : - get_ch(); + (void) get_ch(); /* Fall through */ case MAC_CALL_START : - get_ch(); - get_ch(); + (void) get_ch(); + (void) get_ch(); break; } if (option_flags.v) { switch (c) { case MAC_ARG_END : - get_ch(); + (void) get_ch(); /* Fall through */ case MAC_CALL_END : - get_ch(); - get_ch(); + (void) get_ch(); + (void) get_ch(); break; } } @@ -1764,7 +1764,7 @@ static char * stringize( if (*infile->bptr != EOS) /* More than a token */ invalid = TRUE; /* Diagnose after clearing the "file" */ infile->bptr += strlen( infile->bptr); - get_ch(); /* Clear the "file" */ + (void) get_ch(); /* Clear the "file" */ unget_ch(); if (invalid) diag_macro( CERROR @@ -1905,7 +1905,7 @@ static char * rescan( if (! disable_repl( outer)) /* Don't re-replace replacing macro */ return NULL; /* Too deeply nested macro call */ if (mcpp_mode == STD) { - get_ch(); /* Clear empty "file"s */ + (void) get_ch(); /* Clear empty "file"s */ unget_ch(); /* for diagnostic */ cur_cp = infile->bptr; /* Remember current location */ } @@ -2512,7 +2512,7 @@ static int collect_args( /* Skip MAC_INF seqs and white spaces, still remember */ /* the sequence in buffer, if necessary. */ if (c == ')' || c == ',') - scan_token( c, &seq, seq_end); /* Ensure token parsing */ + (void) scan_token( c, &seq, seq_end); /* Ensure token parsing */ else *seq = EOS; @@ -2987,7 +2987,7 @@ static void skip_macro( void) return; while (infile->fp == NULL) { /* Stacked stuff */ infile->bptr += strlen( infile->bptr); - get_ch(); /* To the parent "file" */ + (void) get_ch(); /* To the parent "file" */ } unget_ch(); } diff --git a/src/tools/idlpp/src/main.c b/src/tools/idlpp/src/main.c index 879d2b5cb9..9128b4bbee 100644 --- a/src/tools/idlpp/src/main.c +++ b/src/tools/idlpp/src/main.c @@ -922,7 +922,7 @@ static void devide_line( } continue; } - scan_token( c, &wp, out_wend); /* Read a token */ + (void) scan_token( c, &wp, out_wend); /* Read a token */ if (NWORK-2 < wp - out_ptr) { /* Too long a token */ cfatal( "Too long token %s", out_ptr, 0L, NULL); /* _F_ */ } else if (out_end <= wp) { /* Too long line */ diff --git a/src/tools/idlpp/src/mbchar.c b/src/tools/idlpp/src/mbchar.c index a1fbda520c..f65eade8f8 100644 --- a/src/tools/idlpp/src/mbchar.c +++ b/src/tools/idlpp/src/mbchar.c @@ -786,7 +786,7 @@ static size_t mb_read_utf8( /* Illegal */ error = TRUE; #if 0 - printf( "codepoint:0x%x\n", codepoint); + (void) printf( "codepoint:0x%x\n", codepoint); #endif if (error) break; diff --git a/src/tools/idlpp/src/support.c b/src/tools/idlpp/src/support.c index c627488669..49952f5507 100644 --- a/src/tools/idlpp/src/support.c +++ b/src/tools/idlpp/src/support.c @@ -433,12 +433,12 @@ int get_unexpandable( } if (file == infile) { infile->bptr += strlen( infile->bptr); - get_ch(); + (void) get_ch(); } unget_ch(); if (token_type == OPE) { unget_string( work_buf, NULL); /* Set again 'openum' */ - scan_token( get_ch(), ((void)(workp = work_buf), &workp), work_end); + (void) scan_token( get_ch(), ((void)(workp = work_buf), &workp), work_end); } } @@ -453,7 +453,7 @@ void skip_nl( void) insert_sep = NO_SEP; while (infile && infile->fp == NULL) { /* Stacked text */ infile->bptr += strlen( infile->bptr); - get_ch(); /* To the parent */ + (void) get_ch(); /* To the parent */ } if (infile) infile->bptr += strlen( infile->bptr); /* Source line */ diff --git a/src/tools/idlpp/src/system.c b/src/tools/idlpp/src/system.c index 2f43eddad0..0af982ea92 100644 --- a/src/tools/idlpp/src/system.c +++ b/src/tools/idlpp/src/system.c @@ -469,7 +469,7 @@ void do_options( bsl2sl( cwd); #endif cwd_len = strlen( cwd); - snprintf( cwd + cwd_len, cwd_sz - cwd_len, "%c%c", PATH_DELIM, EOS); + (void) snprintf( cwd + cwd_len, cwd_sz - cwd_len, "%c%c", PATH_DELIM, EOS); /* Append trailing path-delimiter */ #if COMPILER == GNUC @@ -1761,9 +1761,9 @@ static void def_a_macro( /* Convert trigraphs for the environment which need trigraphs */ if (mcpp_mode == STD && option_flags.trig) - cnv_trigraph( def); + (void) cnv_trigraph( def); if (mcpp_mode == POST_STD && option_flags.dig) - cnv_digraph( def); /* Convert prior to installing macro */ + (void) cnv_digraph( def); /* Convert prior to installing macro */ definition = xmalloc( strlen( def) + 4); strcpy( definition, def); if ((cp = strchr( definition, '=')) != NULL) { @@ -1974,7 +1974,7 @@ static void init_predefines( void) un_predefine( FALSE); /* Undefine "unix" or so */ #endif } - snprintf( tmp, sizeof(tmp), "%ldL", cplus_val ? cplus_val : stdc_ver); + (void) snprintf( tmp, sizeof(tmp), "%ldL", cplus_val ? cplus_val : stdc_ver); if (cplus_val) { look_and_install( "__cplusplus", DEF_NOARGS_STANDARD, null, tmp); } else { @@ -2019,13 +2019,13 @@ static void init_std_defines( void) /* Define __DATE__, __TIME__ as present date and time. */ time( &tvec); tstring = ctime( &tvec); - snprintf( timestr, sizeof(timestr), "\"%.3s %c%c %.4s\"", + (void) snprintf( timestr, sizeof(timestr), "\"%.3s %c%c %.4s\"", tstring + 4, *(tstring + 8) == '0' ? ' ' : *(tstring + 8), *(tstring + 9), tstring + 20); look_and_install( "__DATE__", DEF_NOARGS_DYNAMIC, null, timestr); - snprintf( timestr, sizeof(timestr), "\"%.8s\"", tstring + 11); + (void) snprintf( timestr, sizeof(timestr), "\"%.8s\"", tstring + 11); look_and_install( "__TIME__", DEF_NOARGS_DYNAMIC, null, timestr); if (! look_id( "__STDC_HOSTED__")) { @@ -2033,7 +2033,7 @@ static void init_std_defines( void) * Some compilers, e.g. GCC older than 3.3, define this macro by * -D option. */ - snprintf( tmp, sizeof(tmp), "%d", STDC_HOSTED); + (void) snprintf( tmp, sizeof(tmp), "%d", STDC_HOSTED); look_and_install( "__STDC_HOSTED__", DEF_NOARGS_PREDEF, null, tmp); } #if COMPILER != GNUC /* GCC do not undefine __STDC__ on C++ */ @@ -2042,7 +2042,7 @@ static void init_std_defines( void) #endif /* Define __STDC__ as 1 or such for Standard conforming compiler. */ if (! look_id( "__STDC__")) { - snprintf( tmp, sizeof(tmp), "%d", stdc_val); + (void) snprintf( tmp, sizeof(tmp), "%d", stdc_val); look_and_install( "__STDC__", DEF_NOARGS_STANDARD, null, tmp); } } @@ -2097,7 +2097,7 @@ static void set_pragma_op( void) char * name = "_Pragma"; char tmp[ 16]; - snprintf( tmp, sizeof(tmp), "%c%s ( %c%c )", DEF_MAGIC, name, MAC_PARM, 1); + (void) snprintf( tmp, sizeof(tmp), "%c%s ( %c%c )", DEF_MAGIC, name, MAC_PARM, 1); /* Replacement text */ look_and_install( name, DEF_PRAGMA, "a", tmp); } @@ -2753,7 +2753,7 @@ static char * norm_path( #endif if (inf) { char debug_buf[ PATHMAX+1]; - strlcpy( debug_buf, dir, sizeof(debug_buf)); + (void) strlcpy( debug_buf, dir, sizeof(debug_buf)); strlcat( debug_buf, fname ? fname : null, sizeof(debug_buf)); #if SYS_FAMILY == SYS_WIN bsl2sl( debug_buf); @@ -3011,7 +3011,7 @@ void put_depend( if (fp == fp_out) mcpp_fputs( output, OUT); else - fputs( output, fp); + (void) fputs( output, fp); return; } else if (strlen( output) * 2 + (pos_num * 2) >= mkdep_len) { /* Enlarge the buffer */ @@ -3040,7 +3040,7 @@ void put_depend( if (fp == fp_out) { /* To the same path with normal preprocessing */ mcpp_fputs( output, OUT); } else { /* To the file specified by -MF, -MD, -MMD options */ - fputs( output, fp); + (void) fputs( output, fp); fclose( fp); } fp = NULL; /* Clear for the next call in MCPP_LIB build */ @@ -3499,7 +3499,7 @@ static int open_file( size_t len; FILEINFO * file = infile; FILE * fp; - char * fullname; + char * fullname = NULL; const char * fname; (void)local; @@ -3527,7 +3527,7 @@ static int open_file( /* src_dir is usually NULL. This is specified to */ /* search the source directory of the includer. */ if (src_dir && *src_dir != EOS) { - strlcpy( dir_fname, src_dir, sizeof(dir_fname)); + (void) strlcpy( dir_fname, src_dir, sizeof(dir_fname)); strlcat( dir_fname, filename, sizeof(dir_fname)); fname = dir_fname; } else { @@ -3598,9 +3598,12 @@ static int open_file( put_depend( fullname); /* Output dependency line */ true: + if (fullname) + free( fullname); return TRUE; false: - free( fullname); + if (fullname) + free( fullname); return FALSE; } @@ -4741,8 +4744,8 @@ static void do_preprocessed( void) strcpy( comment - 2, "\n"); /* Remove the comment */ unget_string( lbuf + 8, NULL); do_define( FALSE, 0); - get_ch(); /* '\n' */ - get_ch(); /* Clear the "file" */ + (void) get_ch(); /* '\n' */ + (void) get_ch(); /* Clear the "file" */ unget_ch(); /* infile == file */ } file->bptr = file->buffer + strlen( file->buffer);