Newly introduced findings

List of Findings

Error: CPPCHECK_WARNING (CWE-398): [#def1]
avahi-0.9.rc2/avahi-client/client-test.c:54: style[constParameterCallback]: Parameter 'b' can be declared as pointer to const. However it seems that 'avahi_domain_browser_callback' is a callback function, if 'b' is declared with const you might also need to cast function pointer(s).
#   52|   }
#   53|   
#   54|-> static void avahi_domain_browser_callback(AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol,
#   55|                                             AvahiBrowserEvent event, const char *domain,
#   56|                                             AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) {

Error: CPPCHECK_WARNING (CWE-398): [#def2]
avahi-0.9.rc2/avahi-client/client-test.c:56: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_domain_browser_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
#   54|   static void avahi_domain_browser_callback(AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol,
#   55|                                             AvahiBrowserEvent event, const char *domain,
#   56|->                                           AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) {
#   57|   
#   58|       printf("DOMAIN-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), domain (%s), data (%s)\n",

Error: CPPCHECK_WARNING (CWE-398): [#def3]
avahi-0.9.rc2/avahi-client/client-test.c:67: style[constParameterCallback]: Parameter 'r' can be declared as pointer to const. However it seems that 'avahi_service_resolver_callback' is a callback function, if 'r' is declared with const you might also need to cast function pointer(s).
#   65|   }
#   66|   
#   67|-> static void avahi_service_resolver_callback(AvahiServiceResolver *r, AvahiIfIndex interface, AvahiProtocol protocol,
#   68|                                               AvahiResolverEvent event, const char *name, const char *type, const char *domain,
#   69|                                               const char *host_name, const AvahiAddress *a, uint16_t port, AvahiStringList *txt,

Error: CPPCHECK_WARNING (CWE-398): [#def4]
avahi-0.9.rc2/avahi-client/client-test.c:70: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_service_resolver_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
#   68|                                               AvahiResolverEvent event, const char *name, const char *type, const char *domain,
#   69|                                               const char *host_name, const AvahiAddress *a, uint16_t port, AvahiStringList *txt,
#   70|->                                             AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) {
#   71|   
#   72|       char  addr[64];

Error: CPPCHECK_WARNING (CWE-398): [#def5]
avahi-0.9.rc2/avahi-client/client-test.c:98: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_service_browser_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
#   96|   static void avahi_service_browser_callback(AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol,
#   97|                                              AvahiBrowserEvent event, const char *name, const char *type, const char *domain,
#   98|->                                            AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) {
#   99|   
#  100|       AvahiServiceResolver *sr;

Error: CPPCHECK_WARNING (CWE-398): [#def6]
avahi-0.9.rc2/avahi-client/client-test.c:128: style[constParameterCallback]: Parameter 'b' can be declared as pointer to const. However it seems that 'avahi_service_type_browser_callback' is a callback function, if 'b' is declared with const you might also need to cast function pointer(s).
#  126|   }
#  127|   
#  128|-> static void avahi_service_type_browser_callback(AvahiServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol,
#  129|                                                   AvahiBrowserEvent event, const char *type, const char *domain,
#  130|                                                   AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) {

Error: CPPCHECK_WARNING (CWE-398): [#def7]
avahi-0.9.rc2/avahi-client/client-test.c:130: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_service_type_browser_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
#  128|   static void avahi_service_type_browser_callback(AvahiServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol,
#  129|                                                   AvahiBrowserEvent event, const char *type, const char *domain,
#  130|->                                                 AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) {
#  131|   
#  132|       printf(

Error: CPPCHECK_WARNING (CWE-398): [#def8]
avahi-0.9.rc2/avahi-client/client-test.c:145: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_address_resolver_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
#  143|   static void avahi_address_resolver_callback(AVAHI_GCC_UNUSED AvahiAddressResolver *r, AvahiIfIndex interface,
#  144|                                               AvahiProtocol protocol, AvahiResolverEvent event, const AvahiAddress *address,
#  145|->                                             const char *name, AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) {
#  146|   
#  147|       char addr[64];

Error: CPPCHECK_WARNING (CWE-398): [#def9]
avahi-0.9.rc2/avahi-client/client-test.c:165: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'avahi_host_name_resolver_callback' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
#  163|   static void avahi_host_name_resolver_callback(AvahiHostNameResolver *r, AvahiIfIndex interface, AvahiProtocol protocol,
#  164|                                                 AvahiResolverEvent event, const char *name, const AvahiAddress *a,
#  165|->                                               AVAHI_GCC_UNUSED AvahiLookupResultFlags flags, void *userdata) {
#  166|   
#  167|       AvahiClient          *client;

Error: CPPCHECK_WARNING (CWE-475): [#def10]
avahi-0.9.rc2/avahi-client/client-test.c:211: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#  209|   
#  210|       avahi_entry_group_add_service(
#  211|->         g, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, NULL, 80, "foo=bar2", NULL);
#  212|   
#  213|       avahi_entry_group_commit(g);

Error: CPPCHECK_WARNING (CWE-475): [#def11]
avahi-0.9.rc2/avahi-client/client-test.c:222: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#  220|   
#  221|       avahi_entry_group_update_service_txt(
#  222|->         g, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, "foo=bar3", NULL);
#  223|   }
#  224|   

Error: CPPCHECK_WARNING (CWE-475): [#def12]
avahi-0.9.rc2/avahi-client/client-test.c:284: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#  282|           "%s\n",
#  283|           avahi_strerror(avahi_entry_group_add_service(
#  284|->             group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "Lathiat's Site", "_http._tcp", NULL, NULL, 80, "foo=bar", NULL)));
#  285|       printf("add_record: %d\n",
#  286|              avahi_entry_group_add_record(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "TestX", 0x01, 0x10, 120, "\5booya", 6));

Error: CPPCHECK_WARNING (CWE-476): [#def13]
avahi-0.9.rc2/avahi-client/client.c:140: warning[nullPointerRedundantCheck]: Either the condition '!old' is redundant or there is possible null pointer dereference: old.
#  138|           if (strcmp(name, AVAHI_DBUS_NAME) == 0) {
#  139|   
#  140|->             if (old[0] && avahi_client_is_connected(client)) {
#  141|   
#  142|                   /* Regardless if the server lost its name or

Error: COMPILER_WARNING (CWE-843): [#def14]
avahi-0.9.rc2/avahi-compat-howl/compat.c: scope_hint: In function 'client_callback'
avahi-0.9.rc2/avahi-compat-howl/compat.c:326:14: warning[-Wcast-function-type]: cast between incompatible function types from 'sw_result (*)(void)' {aka 'int (*)(void)'} to 'sw_result (*)(struct _sw_discovery *, sw_discovery_oid,  sw_discovery_browse_status,  sw_uint32,  const char *, const char *, const char *, void *)' {aka 'int (*)(struct _sw_discovery *, unsigned int,  enum _sw_discovery_browse_status,  unsigned int,  const char *, const char *, const char *, void *)'}
#  326 |             ((sw_discovery_browse_reply)self->oid_table[oid].reply)(
#      |              ^
#  324|           case OID_DOMAIN_BROWSER:
#  325|           case OID_SERVICE_BROWSER:
#  326|->             ((sw_discovery_browse_reply)self->oid_table[oid].reply)(
#  327|                   self, oid, SW_DISCOVERY_BROWSE_INVALID, 0, NULL, NULL, NULL, self->oid_table[oid].extra);
#  328|               break;

Error: CPPCHECK_WARNING (CWE-398): [#def15]
avahi-0.9.rc2/avahi-compat-howl/compat.c:748: style[constParameterPointer]: Parameter 'text_record' can be declared as pointer to const
#  746|   
#  747|   sw_result sw_discovery_publish(sw_discovery self, sw_uint32 interface_index, sw_const_string name, sw_const_string type,
#  748|->                                sw_const_string domain, sw_const_string host, sw_port port, sw_octets text_record,
#  749|                                  sw_uint32 text_record_len, sw_discovery_publish_reply reply, sw_opaque extra,
#  750|                                  sw_discovery_oid *oid) {

Error: COMPILER_WARNING: [#def16]
avahi-0.9.rc2/avahi-compat-howl/include/salt/salt.h:32: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/include/howl.h:32: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/unsupported.c:26: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/include/salt/platform.h:372:1: warning[-Wstrict-prototypes]: function declaration isn't a prototype
#  372 | sw_const_string sw_strerror();
#      | ^~~~~~~~~~~~~~~
#  370|    */
#  371|   
#  372|-> sw_const_string sw_strerror();
#  373|   
#  374|   /*

Error: COMPILER_WARNING: [#def17]
avahi-0.9.rc2/avahi-compat-howl/include/salt/salt.h:32: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/include/howl.h:32: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/address-test.c:29: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/include/salt/platform.h:372:1: warning[-Wstrict-prototypes]: function declaration isn’t a prototype
#  372 | sw_const_string sw_strerror();
#      | ^~~~~~~~~~~~~~~
#  370|    */
#  371|   
#  372|-> sw_const_string sw_strerror();
#  373|   
#  374|   /*

Error: COMPILER_WARNING (CWE-563): [#def18]
avahi-0.9.rc2/avahi-compat-howl/samples/browse.c:36:51: warning[-Wunused-parameter]: unused parameter ‘extra’
#   36 |                                       sw_opaque_t extra) {
#      |                                       ~~~~~~~~~~~~^~~~~
#   34|                                         sw_const_string name, sw_const_string type, sw_const_string domain,
#   35|                                         sw_ipv4_address address, sw_port port, sw_octets text_record, sw_uint32 text_record_len,
#   36|->                                       sw_opaque_t extra) {
#   37|       sw_text_record_iterator it;
#   38|       sw_int8                 name_buf[16];

Error: COMPILER_WARNING (CWE-681): [#def19]
avahi-0.9.rc2/avahi-compat-howl/samples/browse.c: scope_hint: In function ‘my_resolver’
avahi-0.9.rc2/avahi-compat-howl/samples/browse.c:53:43: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘sw_ipv4_address_name’ differ in signedness
#   53 |             sw_ipv4_address_name(address, name_buf, 16),
#      |                                           ^~~~~~~~
#      |                                           |
#      |                                           sw_int8 * {aka signed char *}
avahi-0.9.rc2/avahi-compat-howl/include/corby/orb.h:33: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/include/howl.h:35: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/include/salt/address.h:64:73: note: expected ‘sw_string’ {aka ‘char *’} but argument is of type ‘sw_int8 *’ {aka ‘signed char *’}
#   64 | sw_string HOWL_API sw_ipv4_address_name(sw_ipv4_address self, sw_string name, sw_uint32 len);
#      |                                                               ~~~~~~~~~~^~~~
#   51|               type,
#   52|               domain,
#   53|->             sw_ipv4_address_name(address, name_buf, 16),
#   54|               port);
#   55|   

Error: COMPILER_WARNING (CWE-681): [#def20]
avahi-0.9.rc2/avahi-compat-howl/samples/browse.c:60:49: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘sw_text_record_iterator_next’ differ in signedness
#   60 |         while (sw_text_record_iterator_next(it, key, oval, &oval_len) == SW_OKAY) {
#      |                                                 ^~~
#      |                                                 |
#      |                                                 sw_int8 * {aka signed char *}
avahi-0.9.rc2/avahi-compat-howl/include/howl.h:41: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/include/discovery/text_record.h:73:84: note: expected ‘char *’ but argument is of type ‘sw_int8 *’ {aka ‘signed char *’}
#   73 | sw_result HOWL_API sw_text_record_iterator_next(sw_text_record_iterator self, char key[SW_TEXT_RECORD_MAX_LEN],
#      |                                                                               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#   58|           sw_check_okay(err, exit);
#   59|   
#   60|->         while (sw_text_record_iterator_next(it, key, oval, &oval_len) == SW_OKAY) {
#   61|               fprintf(stderr, "Txt: [%s]=[%s] - (%d bytes)\n", key, oval, oval_len);
#   62|           }

Error: COMPILER_WARNING (CWE-563): [#def21]
avahi-0.9.rc2/avahi-compat-howl/samples/browse.c: scope_hint: In function ‘my_browser’
avahi-0.9.rc2/avahi-compat-howl/samples/browse.c:73:79: warning[-Wunused-parameter]: unused parameter ‘oid’
#   73 | static sw_result HOWL_API my_browser(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_browse_status status,
#      |                                                              ~~~~~~~~~~~~~~~~~^~~
#   71|   }
#   72|   
#   73|-> static sw_result HOWL_API my_browser(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_browse_status status,
#   74|                                        sw_uint32 interface_index, sw_const_string name, sw_const_string type,
#   75|                                        sw_const_string domain, sw_opaque_t extra) {

Error: COMPILER_WARNING (CWE-563): [#def22]
avahi-0.9.rc2/avahi-compat-howl/samples/browse.c:75:74: warning[-Wunused-parameter]: unused parameter ‘extra’
#   75 |                                      sw_const_string domain, sw_opaque_t extra) {
#      |                                                              ~~~~~~~~~~~~^~~~~
#   73|   static sw_result HOWL_API my_browser(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_browse_status status,
#   74|                                        sw_uint32 interface_index, sw_const_string name, sw_const_string type,
#   75|->                                      sw_const_string domain, sw_opaque_t extra) {
#   76|       sw_discovery_resolve_id rid;
#   77|   

Error: COMPILER_WARNING (CWE-563): [#def23]
avahi-0.9.rc2/avahi-compat-howl/samples/publish.c:32:57: warning[-Wunused-parameter]: unused parameter ‘discovery’
#   32 | static sw_result HOWL_API my_service_reply(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_publish_status status,
#      |                                            ~~~~~~~~~~~~~^~~~~~~~~
#   30|   #include <stdio.h>
#   31|   
#   32|-> static sw_result HOWL_API my_service_reply(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_publish_status status,
#   33|                                              sw_opaque extra) {
#   34|       static sw_string status_text[] = {"Started", "Stopped", "Name Collision", "Invalid"};

Error: COMPILER_WARNING (CWE-563): [#def24]
avahi-0.9.rc2/avahi-compat-howl/samples/publish.c:32:85: warning[-Wunused-parameter]: unused parameter ‘oid’
#   32 | static sw_result HOWL_API my_service_reply(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_publish_status status,
#      |                                                                    ~~~~~~~~~~~~~~~~~^~~
#   30|   #include <stdio.h>
#   31|   
#   32|-> static sw_result HOWL_API my_service_reply(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_publish_status status,
#   33|                                              sw_opaque extra) {
#   34|       static sw_string status_text[] = {"Started", "Stopped", "Name Collision", "Invalid"};

Error: COMPILER_WARNING (CWE-563): [#def25]
avahi-0.9.rc2/avahi-compat-howl/samples/publish.c:33:54: warning[-Wunused-parameter]: unused parameter ‘extra’
#   33 |                                            sw_opaque extra) {
#      |                                            ~~~~~~~~~~^~~~~
#   31|   
#   32|   static sw_result HOWL_API my_service_reply(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_publish_status status,
#   33|->                                            sw_opaque extra) {
#   34|       static sw_string status_text[] = {"Started", "Stopped", "Name Collision", "Invalid"};
#   35|   

Error: COMPILER_WARNING (CWE-704): [#def26]
avahi-0.9.rc2/avahi-compat-howl/samples/publish.c: scope_hint: In function ‘my_service_reply’
avahi-0.9.rc2/avahi-compat-howl/samples/publish.c:34:39: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#   34 |     static sw_string status_text[] = {"Started", "Stopped", "Name Collision", "Invalid"};
#      |                                       ^~~~~~~~~
#   32|   static sw_result HOWL_API my_service_reply(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_publish_status status,
#   33|                                              sw_opaque extra) {
#   34|->     static sw_string status_text[] = {"Started", "Stopped", "Name Collision", "Invalid"};
#   35|   
#   36|       fprintf(stderr, "publish reply: %s\n", status_text[status]);

Error: COMPILER_WARNING (CWE-704): [#def27]
avahi-0.9.rc2/avahi-compat-howl/samples/publish.c:34:50: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#   34 |     static sw_string status_text[] = {"Started", "Stopped", "Name Collision", "Invalid"};
#      |                                                  ^~~~~~~~~
#   32|   static sw_result HOWL_API my_service_reply(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_publish_status status,
#   33|                                              sw_opaque extra) {
#   34|->     static sw_string status_text[] = {"Started", "Stopped", "Name Collision", "Invalid"};
#   35|   
#   36|       fprintf(stderr, "publish reply: %s\n", status_text[status]);

Error: COMPILER_WARNING (CWE-704): [#def28]
avahi-0.9.rc2/avahi-compat-howl/samples/publish.c:34:61: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#   34 |     static sw_string status_text[] = {"Started", "Stopped", "Name Collision", "Invalid"};
#      |                                                             ^~~~~~~~~~~~~~~~
#   32|   static sw_result HOWL_API my_service_reply(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_publish_status status,
#   33|                                              sw_opaque extra) {
#   34|->     static sw_string status_text[] = {"Started", "Stopped", "Name Collision", "Invalid"};
#   35|   
#   36|       fprintf(stderr, "publish reply: %s\n", status_text[status]);

Error: COMPILER_WARNING (CWE-704): [#def29]
avahi-0.9.rc2/avahi-compat-howl/samples/publish.c:34:79: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#   34 |     static sw_string status_text[] = {"Started", "Stopped", "Name Collision", "Invalid"};
#      |                                                                               ^~~~~~~~~
#   32|   static sw_result HOWL_API my_service_reply(sw_discovery discovery, sw_discovery_oid oid, sw_discovery_publish_status status,
#   33|                                              sw_opaque extra) {
#   34|->     static sw_string status_text[] = {"Started", "Stopped", "Name Collision", "Invalid"};
#   35|   
#   36|       fprintf(stderr, "publish reply: %s\n", status_text[status]);

Error: COMPILER_WARNING (CWE-563): [#def30]
avahi-0.9.rc2/avahi-compat-howl/samples/query.c:33:59: warning[-Wunused-parameter]: unused parameter ‘session’
#   33 | static sw_result HOWL_API query_record_reply(sw_discovery session, sw_discovery_oid oid,
#      |                                              ~~~~~~~~~~~~~^~~~~~~
#   31|   #include <stdio.h>
#   32|   
#   33|-> static sw_result HOWL_API query_record_reply(sw_discovery session, sw_discovery_oid oid,
#   34|                                                sw_discovery_query_record_status status, sw_uint32 interface_index,
#   35|                                                sw_const_string fullname, sw_uint16 rrtype, sw_uint16 rrclass, sw_uint16 rrdatalen,

Error: COMPILER_WARNING (CWE-563): [#def31]
avahi-0.9.rc2/avahi-compat-howl/samples/query.c:33:85: warning[-Wunused-parameter]: unused parameter ‘oid’
#   33 | static sw_result HOWL_API query_record_reply(sw_discovery session, sw_discovery_oid oid,
#      |                                                                    ~~~~~~~~~~~~~~~~~^~~
#   31|   #include <stdio.h>
#   32|   
#   33|-> static sw_result HOWL_API query_record_reply(sw_discovery session, sw_discovery_oid oid,
#   34|                                                sw_discovery_query_record_status status, sw_uint32 interface_index,
#   35|                                                sw_const_string fullname, sw_uint16 rrtype, sw_uint16 rrclass, sw_uint16 rrdatalen,

Error: COMPILER_WARNING (CWE-563): [#def32]
avahi-0.9.rc2/avahi-compat-howl/samples/query.c:34:79: warning[-Wunused-parameter]: unused parameter ‘status’
#   34 |                                              sw_discovery_query_record_status status, sw_uint32 interface_index,
#      |                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
#   32|   
#   33|   static sw_result HOWL_API query_record_reply(sw_discovery session, sw_discovery_oid oid,
#   34|->                                              sw_discovery_query_record_status status, sw_uint32 interface_index,
#   35|                                                sw_const_string fullname, sw_uint16 rrtype, sw_uint16 rrclass, sw_uint16 rrdatalen,
#   36|                                                sw_const_octets rrdata, sw_uint32 ttl, sw_opaque extra) {

Error: COMPILER_WARNING (CWE-563): [#def33]
avahi-0.9.rc2/avahi-compat-howl/samples/query.c:35:119: warning[-Wunused-parameter]: unused parameter ‘rrdatalen’
#   35 |                                              sw_const_string fullname, sw_uint16 rrtype, sw_uint16 rrclass, sw_uint16 rrdatalen,
#      |                                                                                                             ~~~~~~~~~~^~~~~~~~~
#   33|   static sw_result HOWL_API query_record_reply(sw_discovery session, sw_discovery_oid oid,
#   34|                                                sw_discovery_query_record_status status, sw_uint32 interface_index,
#   35|->                                              sw_const_string fullname, sw_uint16 rrtype, sw_uint16 rrclass, sw_uint16 rrdatalen,
#   36|                                                sw_const_octets rrdata, sw_uint32 ttl, sw_opaque extra) {
#   37|       sw_ipv4_address address;

Error: COMPILER_WARNING (CWE-563): [#def34]
avahi-0.9.rc2/avahi-compat-howl/samples/query.c:36:80: warning[-Wunused-parameter]: unused parameter ‘ttl’
#   36 |                                              sw_const_octets rrdata, sw_uint32 ttl, sw_opaque extra) {
#      |                                                                      ~~~~~~~~~~^~~
#   34|                                                sw_discovery_query_record_status status, sw_uint32 interface_index,
#   35|                                                sw_const_string fullname, sw_uint16 rrtype, sw_uint16 rrclass, sw_uint16 rrdatalen,
#   36|->                                              sw_const_octets rrdata, sw_uint32 ttl, sw_opaque extra) {
#   37|       sw_ipv4_address address;
#   38|   

Error: COMPILER_WARNING (CWE-563): [#def35]
avahi-0.9.rc2/avahi-compat-howl/samples/query.c:36:95: warning[-Wunused-parameter]: unused parameter ‘extra’
#   36 |                                              sw_const_octets rrdata, sw_uint32 ttl, sw_opaque extra) {
#      |                                                                                     ~~~~~~~~~~^~~~~
#   34|                                                sw_discovery_query_record_status status, sw_uint32 interface_index,
#   35|                                                sw_const_string fullname, sw_uint16 rrtype, sw_uint16 rrclass, sw_uint16 rrdatalen,
#   36|->                                              sw_const_octets rrdata, sw_uint32 ttl, sw_opaque extra) {
#   37|       sw_ipv4_address address;
#   38|   

Error: COMPILER_WARNING (CWE-563): [#def36]
avahi-0.9.rc2/avahi-compat-howl/samples/resolve.c:36:51: warning[-Wunused-parameter]: unused parameter ‘extra’
#   36 |                                       sw_opaque_t extra) {
#      |                                       ~~~~~~~~~~~~^~~~~
#   34|                                         sw_const_string name, sw_const_string type, sw_const_string domain,
#   35|                                         sw_ipv4_address address, sw_port port, sw_octets text_record, sw_uint32 text_record_len,
#   36|->                                       sw_opaque_t extra) {
#   37|       sw_text_record_iterator it;
#   38|       sw_int8                 name_buf[16];

Error: COMPILER_WARNING (CWE-681): [#def37]
avahi-0.9.rc2/avahi-compat-howl/samples/resolve.c: scope_hint: In function ‘my_resolver’
avahi-0.9.rc2/avahi-compat-howl/samples/resolve.c:53:43: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘sw_ipv4_address_name’ differ in signedness
#   53 |             sw_ipv4_address_name(address, name_buf, 16),
#      |                                           ^~~~~~~~
#      |                                           |
#      |                                           sw_int8 * {aka signed char *}
avahi-0.9.rc2/avahi-compat-howl/include/corby/orb.h:33: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/include/howl.h:35: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/include/salt/address.h:64:73: note: expected ‘sw_string’ {aka ‘char *’} but argument is of type ‘sw_int8 *’ {aka ‘signed char *’}
#   64 | sw_string HOWL_API sw_ipv4_address_name(sw_ipv4_address self, sw_string name, sw_uint32 len);
#      |                                                               ~~~~~~~~~~^~~~
#   51|               type,
#   52|               domain,
#   53|->             sw_ipv4_address_name(address, name_buf, 16),
#   54|               port);
#   55|   

Error: COMPILER_WARNING (CWE-681): [#def38]
avahi-0.9.rc2/avahi-compat-howl/samples/resolve.c:60:49: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘sw_text_record_iterator_next’ differ in signedness
#   60 |         while (sw_text_record_iterator_next(it, key, oval, &oval_len) == SW_OKAY) {
#      |                                                 ^~~
#      |                                                 |
#      |                                                 sw_int8 * {aka signed char *}
avahi-0.9.rc2/avahi-compat-howl/include/howl.h:41: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-howl/include/discovery/text_record.h:73:84: note: expected ‘char *’ but argument is of type ‘sw_int8 *’ {aka ‘signed char *’}
#   73 | sw_result HOWL_API sw_text_record_iterator_next(sw_text_record_iterator self, char key[SW_TEXT_RECORD_MAX_LEN],
#      |                                                                               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#   58|           sw_check_okay(err, exit);
#   59|   
#   60|->         while (sw_text_record_iterator_next(it, key, oval, &oval_len) == SW_OKAY) {
#   61|               fprintf(stderr, "key = %s, data is %d bytes\n", key, oval_len);
#   62|           }

Error: CPPCHECK_WARNING (CWE-398): [#def39]
avahi-0.9.rc2/avahi-compat-howl/text.c:119: style[constParameterPointer]: Parameter 'val' can be declared as pointer to const
#  117|   }
#  118|   
#  119|-> sw_result sw_text_record_add_key_and_binary_value(sw_text_record self, sw_const_string key, sw_octets val, sw_uint32 len) {
#  120|   
#  121|       AvahiStringList *n;

Error: CPPCHECK_WARNING (CWE-398): [#def40]
avahi-0.9.rc2/avahi-compat-howl/text.c:180: style[constParameterPointer]: Parameter 'text_record' can be declared as pointer to const
#  178|   };
#  179|   
#  180|-> sw_result sw_text_record_iterator_init(sw_text_record_iterator *self, sw_octets text_record, sw_uint32 text_record_len) {
#  181|   
#  182|       AvahiStringList *txt;

Error: COMPILER_WARNING: [#def41]
avahi-0.9.rc2/avahi-compat-howl/unsupported.c: scope_hint: In function 'sw_strerror'
avahi-0.9.rc2/avahi-compat-howl/unsupported.c:51:17: warning[-Wold-style-definition]: old-style function definition
#   49|   
#   50|   AVAHI_GCC_NORETURN
#   51|-> sw_const_string sw_strerror(/* howl sucks */) { AVAHI_WARN_UNSUPPORTED_ABORT; }
#   52|   
#   53|   sw_result sw_timer_init(AVAHI_GCC_UNUSED sw_timer *self) {

Error: COMPILER_WARNING: [#def42]
avahi-0.9.rc2/avahi-compat-howl/unsupported.c: scope_hint: At top level
avahi-0.9.rc2/avahi-compat-howl/unsupported.c:51:17: warning[-Wstrict-prototypes]: function declaration isn't a prototype
#   51 | sw_const_string sw_strerror(/* howl sucks */) { AVAHI_WARN_UNSUPPORTED_ABORT; }
#      |                 ^~~~~~~~~~~
#   49|   
#   50|   AVAHI_GCC_NORETURN
#   51|-> sw_const_string sw_strerror(/* howl sucks */) { AVAHI_WARN_UNSUPPORTED_ABORT; }
#   52|   
#   53|   sw_result sw_timer_init(AVAHI_GCC_UNUSED sw_timer *self) {

Error: COMPILER_WARNING: [#def43]
avahi-0.9.rc2/avahi-compat-libdns_sd/compat.c:47: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-libdns_sd/compat.c: scope_hint: In function 'DNSServiceBrowse'
avahi-0.9.rc2/avahi-compat-libdns_sd/warn.h:39:32: warning[-Wpedantic]: ISO C does not support '__FUNCTION__' predefined identifier
#   39 |         avahi_warn_unsupported(__FUNCTION__);                                                                                  \
#      |                                ^~~~~~~~~~~~
avahi-0.9.rc2/avahi-compat-libdns_sd/compat.c:613:9: note: in expansion of macro 'AVAHI_WARN_UNSUPPORTED'
#  613 |         AVAHI_WARN_UNSUPPORTED;
#      |         ^~~~~~~~~~~~~~~~~~~~~~
#   37|       do {                                                                                                                       \
#   38|           avahi_warn_linkage();                                                                                                  \
#   39|->         avahi_warn_unsupported(__FUNCTION__);                                                                                  \
#   40|       } while (0)
#   41|   #define AVAHI_WARN_UNSUPPORTED_ABORT                                                                                           \

Error: COMPILER_WARNING: [#def44]
avahi-0.9.rc2/avahi-compat-libdns_sd/compat.c:47: included_from: Included from here.
avahi-0.9.rc2/avahi-compat-libdns_sd/compat.c: scope_hint: In function ‘DNSServiceBrowse’
avahi-0.9.rc2/avahi-compat-libdns_sd/warn.h:39:32: warning[-Wpedantic]: ISO C does not support ‘__FUNCTION__’ predefined identifier
#   39 |         avahi_warn_unsupported(__FUNCTION__);                                                                                  \
#      |                                ^~~~~~~~~~~~
avahi-0.9.rc2/avahi-compat-libdns_sd/compat.c:613:9: note: in expansion of macro ‘AVAHI_WARN_UNSUPPORTED’
#  613 |         AVAHI_WARN_UNSUPPORTED;
#      |         ^~~~~~~~~~~~~~~~~~~~~~
#   37|       do {                                                                                                                       \
#   38|           avahi_warn_linkage();                                                                                                  \
#   39|->         avahi_warn_unsupported(__FUNCTION__);                                                                                  \
#   40|       } while (0)
#   41|   #define AVAHI_WARN_UNSUPPORTED_ABORT                                                                                           \

Error: CPPCHECK_WARNING (CWE-398): [#def45]
avahi-0.9.rc2/avahi-core/avahi-test.c:56: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'dump_line' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
#   54|   }
#   55|   
#   56|-> static void dump_line(const char *text, AVAHI_GCC_UNUSED void *userdata) { printf("%s\n", text); }
#   57|   
#   58|   static void dump_timeout_callback(AvahiTimeout *timeout, void *userdata) {

Error: CPPCHECK_WARNING (CWE-398): [#def46]
avahi-0.9.rc2/avahi-core/avahi-test.c:96: style[constParameterCallback]: Parameter 'record' can be declared as pointer to const. However it seems that 'record_browser_callback' is a callback function, if 'record' is declared with const you might also need to cast function pointer(s).
#   94|   
#   95|   static void record_browser_callback(AvahiSRecordBrowser *r, AvahiIfIndex interface, AvahiProtocol protocol,
#   96|->                                     AvahiBrowserEvent event, AvahiRecord *record, AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
#   97|                                       AVAHI_GCC_UNUSED void *userdata) {
#   98|       char *t;

Error: CPPCHECK_WARNING (CWE-475): [#def47]
avahi-0.9.rc2/avahi-core/avahi-test.c:176: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#  174|   
#  175|       if (avahi_server_add_service(
#  176|->             server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, service_name, "_http._tcp", NULL, NULL, 80, "foo", NULL) <
#  177|           0) {
#  178|           avahi_log_error("Failed to add HTTP service");

Error: CPPCHECK_WARNING (CWE-475): [#def48]
avahi-0.9.rc2/avahi-core/avahi-test.c:183: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#  181|   
#  182|       if (avahi_server_add_service(
#  183|->             server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, service_name, "_ftp._tcp", NULL, NULL, 21, "foo", NULL) <
#  184|           0) {
#  185|           avahi_log_error("Failed to add FTP service");

Error: CPPCHECK_WARNING (CWE-475): [#def49]
avahi-0.9.rc2/avahi-core/avahi-test.c:190: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#  188|   
#  189|       if (avahi_server_add_service(
#  190|->             server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, service_name, "_webdav._tcp", NULL, NULL, 80, "foo", NULL) <
#  191|           0) {
#  192|           avahi_log_error("Failed to add WEBDAV service");

Error: CPPCHECK_WARNING (CWE-398): [#def50]
avahi-0.9.rc2/avahi-core/browse.c:156: style[constParameterPointer]: Parameter 'key' can be declared as pointer to const
#  154|   
#  155|   static AvahiSRBLookup *lookup_find(AvahiSRecordBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol,
#  156|->                                    AvahiLookupFlags flags, AvahiKey *key) {
#  157|   
#  158|       AvahiSRBLookup *l;

Error: CPPCHECK_WARNING (CWE-398): [#def51]
avahi-0.9.rc2/avahi-core/conformance-test.c:50: style[constParameterCallback]: Parameter 'userdata' can be declared as pointer to const. However it seems that 'dump_line' is a callback function, if 'userdata' is declared with const you might also need to cast function pointer(s).
#   48|   static const AvahiPoll  *poll_api;
#   49|   
#   50|-> static void dump_line(const char *text, AVAHI_GCC_UNUSED void *userdata) { printf("%s\n", text); }
#   51|   
#   52|   static void dump_timeout_callback(AvahiTimeout *timeout, AVAHI_GCC_UNUSED void *userdata) {

Error: CPPCHECK_WARNING (CWE-475): [#def52]
avahi-0.9.rc2/avahi-core/conformance-test.c:78: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#   76|   
#   77|       avahi_server_add_service(
#   78|->         avahi, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_http._tcp", NULL, NULL, 80, "foo", NULL);
#   79|       avahi_s_entry_group_commit(group);
#   80|   

Error: CPPCHECK_WARNING (CWE-398): [#def53]
avahi-0.9.rc2/avahi-core/entry.c:644: style[constParameterPointer]: Parameter 'strlst' can be declared as pointer to const
#  642|   int avahi_server_add_service_strlst(AvahiServer *s, AvahiSEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol,
#  643|                                       AvahiPublishFlags flags, const char *name, const char *type, const char *domain,
#  644|->                                     const char *host, uint16_t port, AvahiStringList *strlst) {
#  645|   
#  646|       assert(s);

Error: CPPCHECK_WARNING (CWE-475): [#def54]
avahi-0.9.rc2/avahi-core/iface.c:154: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#  152|                                            NULL,
#  153|                                            NULL,
#  154|->                                          9,
#  155|                                            NULL) < 0) {
#  156|                   avahi_log_warn(__FILE__ ": avahi_server_add_service() failed: %s", avahi_strerror(m->server->error));

Error: CPPCHECK_WARNING (CWE-475): [#def55]
avahi-0.9.rc2/avahi-core/update-test.c:52: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#   50|   
#   51|           ret = avahi_server_add_service(
#   52|->             s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "foo", "_http._tcp", NULL, NULL, 80, "test1", NULL);
#   53|           assert(ret == AVAHI_OK);
#   54|   

Error: CPPCHECK_WARNING (CWE-475): [#def56]
avahi-0.9.rc2/avahi-core/update-test.c:66: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#   64|   
#   65|       ret = avahi_server_update_service_txt(
#   66|->         s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, "foo", "_http._tcp", NULL, "test2", NULL);
#   67|       assert(ret == AVAHI_OK);
#   68|   }

Error: CPPCHECK_WARNING (CWE-398): [#def57]
avahi-0.9.rc2/avahi-discover-standalone/main.c:257: style[constParameterCallback]: Parameter 'r' can be declared as pointer to const. However it seems that 'service_resolver_callback' is a callback function, if 'r' is declared with const you might also need to cast function pointer(s).
#  255|   }
#  256|   
#  257|-> static void service_resolver_callback(AvahiSServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIndex interface,
#  258|                                         AVAHI_GCC_UNUSED AvahiProtocol protocol, AvahiResolverEvent event,
#  259|                                         AVAHI_GCC_UNUSED const char *name, AVAHI_GCC_UNUSED const char *type,

Error: CPPCHECK_WARNING (CWE-398): [#def58]
avahi-0.9.rc2/avahi-discover-standalone/main.c:305: style[constParameterCallback]: Parameter 'event' can be declared as pointer to const. However it seems that 'main_window_on_delete_event' is a callback function, if 'event' is declared with const you might also need to cast function pointer(s).
#  303|   }
#  304|   
#  305|-> static gboolean main_window_on_delete_event(AVAHI_GCC_UNUSED GtkWidget *widget, AVAHI_GCC_UNUSED GdkEvent *event,
#  306|                                               AVAHI_GCC_UNUSED gpointer user_data) {
#  307|       gtk_main_quit();

Error: CPPCHECK_WARNING (CWE-398): [#def59]
avahi-0.9.rc2/avahi-discover-standalone/main.c:305: style[constParameterCallback]: Parameter 'widget' can be declared as pointer to const. However it seems that 'main_window_on_delete_event' is a callback function, if 'widget' is declared with const you might also need to cast function pointer(s).
#  303|   }
#  304|   
#  305|-> static gboolean main_window_on_delete_event(AVAHI_GCC_UNUSED GtkWidget *widget, AVAHI_GCC_UNUSED GdkEvent *event,
#  306|                                               AVAHI_GCC_UNUSED gpointer user_data) {
#  307|       gtk_main_quit();

Error: CPPCHECK_WARNING (CWE-783): [#def60]
avahi-0.9.rc2/avahi-glib/glib-watch.c:94: style[clarifyCalculation]: Clarify calculation precedence for '&' and '?'.
#   92|   
#   93|   static gushort map_events_to_glib(AvahiWatchEvent events) {
#   94|->     return (events & AVAHI_WATCH_IN ? G_IO_IN : 0) | (events & AVAHI_WATCH_OUT ? G_IO_OUT : 0) |
#   95|              (events & AVAHI_WATCH_ERR ? G_IO_ERR : 0) | (events & AVAHI_WATCH_HUP ? G_IO_HUP : 0);
#   96|   }

Error: CPPCHECK_WARNING (CWE-783): [#def61]
avahi-0.9.rc2/avahi-glib/glib-watch.c:95: style[clarifyCalculation]: Clarify calculation precedence for '&' and '?'.
#   93|   static gushort map_events_to_glib(AvahiWatchEvent events) {
#   94|       return (events & AVAHI_WATCH_IN ? G_IO_IN : 0) | (events & AVAHI_WATCH_OUT ? G_IO_OUT : 0) |
#   95|->            (events & AVAHI_WATCH_ERR ? G_IO_ERR : 0) | (events & AVAHI_WATCH_HUP ? G_IO_HUP : 0);
#   96|   }
#   97|   

Error: COMPILER_WARNING (CWE-192): [#def62]
avahi-0.9.rc2/avahi-gobject/ga-client.c:235:69: warning[-Wenum-conversion]: implicit conversion from 'GaClientFlags' to 'AvahiClientFlags'
#  235 |     aclient = avahi_client_new(avahi_glib_poll_get(priv->poll), priv->flags, _avahi_client_cb, client, &aerror);
#      |                                                                 ~~~~^~~~~~~
#  233|       priv->poll = avahi_glib_poll_new(context, G_PRIORITY_DEFAULT);
#  234|   
#  235|->     aclient = avahi_client_new(avahi_glib_poll_get(priv->poll), priv->flags, _avahi_client_cb, client, &aerror);
#  236|       if (aclient == NULL) {
#  237|           if (error != NULL) {

Error: COMPILER_WARNING (CWE-477): [#def63]
avahi-0.9.rc2/avahi-gobject/ga-entry-group.c: scope_hint: In function 'ga_entry_group_class_init'
avahi-0.9.rc2/avahi-gobject/ga-entry-group.c:110:5: warning[-Wdeprecated-declarations]: 'g_type_class_add_private' is deprecated
/usr/include/glib-2.0/gobject/gobject.h:26: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:31: included_from: Included from here.
/usr/include/glib-2.0/gobject/gtype.h:1503:10: note: declared here
#  108|       GParamSpec   *param_spec;
#  109|   
#  110|->     g_type_class_add_private(ga_entry_group_class, sizeof(GaEntryGroupPrivate));
#  111|   
#  112|       object_class->dispose = ga_entry_group_dispose;

Error: COMPILER_WARNING (CWE-477): [#def64]
avahi-0.9.rc2/avahi-gobject/ga-record-browser.c: scope_hint: In function 'ga_record_browser_class_init'
avahi-0.9.rc2/avahi-gobject/ga-record-browser.c:145:5: warning[-Wdeprecated-declarations]: 'g_type_class_add_private' is deprecated
#  145 |     g_type_class_add_private(ga_record_browser_class, sizeof(GaRecordBrowserPrivate));
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gobject.h:26: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:31: included_from: Included from here.
/usr/include/glib-2.0/gobject/gtype.h:1503:10: note: declared here
# 1503 | void     g_type_class_add_private       (gpointer                    g_class,
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~
#  143|       GParamSpec   *param_spec;
#  144|   
#  145|->     g_type_class_add_private(ga_record_browser_class, sizeof(GaRecordBrowserPrivate));
#  146|   
#  147|       object_class->dispose = ga_record_browser_dispose;

Error: COMPILER_WARNING (CWE-477): [#def65]
avahi-0.9.rc2/avahi-gobject/ga-service-browser.c: scope_hint: In function 'ga_service_browser_class_init'
avahi-0.9.rc2/avahi-gobject/ga-service-browser.c:145:5: warning[-Wdeprecated-declarations]: 'g_type_class_add_private' is deprecated
#  145 |     g_type_class_add_private(ga_service_browser_class, sizeof(GaServiceBrowserPrivate));
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gobject.h:26: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:31: included_from: Included from here.
/usr/include/glib-2.0/gobject/gtype.h:1503:10: note: declared here
# 1503 | void     g_type_class_add_private       (gpointer                    g_class,
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~
#  143|       GParamSpec   *param_spec;
#  144|   
#  145|->     g_type_class_add_private(ga_service_browser_class, sizeof(GaServiceBrowserPrivate));
#  146|   
#  147|       object_class->dispose = ga_service_browser_dispose;

Error: CPPCHECK_WARNING (CWE-398): [#def66]
avahi-0.9.rc2/avahi-gobject/ga-service-resolver.c:130: style[constVariablePointer]: Variable 'priv' can be declared as pointer to const
#  128|   static void ga_service_resolver_get_property(GObject *object, guint property_id, GValue *value, GParamSpec *pspec) {
#  129|       GaServiceResolver        *resolver = GA_SERVICE_RESOLVER(object);
#  130|->     GaServiceResolverPrivate *priv = GA_SERVICE_RESOLVER_GET_PRIVATE(resolver);
#  131|   
#  132|       switch (property_id) {

Error: COMPILER_WARNING (CWE-477): [#def67]
avahi-0.9.rc2/avahi-gobject/ga-service-resolver.c: scope_hint: In function 'ga_service_resolver_class_init'
avahi-0.9.rc2/avahi-gobject/ga-service-resolver.c:164:5: warning[-Wdeprecated-declarations]: 'g_type_class_add_private' is deprecated
#  164 |     g_type_class_add_private(ga_service_resolver_class, sizeof(GaServiceResolverPrivate));
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/gobject/gobject.h:26: included_from: Included from here.
/usr/include/glib-2.0/gobject/gbinding.h:31: included_from: Included from here.
/usr/include/glib-2.0/gobject/gtype.h:1503:10: note: declared here
# 1503 | void     g_type_class_add_private       (gpointer                    g_class,
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~
#  162|       GParamSpec   *param_spec;
#  163|   
#  164|->     g_type_class_add_private(ga_service_resolver_class, sizeof(GaServiceResolverPrivate));
#  165|   
#  166|       object_class->set_property = ga_service_resolver_set_property;

Error: CPPCHECK_WARNING (CWE-398): [#def68]
avahi-0.9.rc2/avahi-gobject/ga-service-resolver.c:371: style[constVariablePointer]: Variable 'priv' can be declared as pointer to const
#  369|   
#  370|   gboolean ga_service_resolver_get_address(GaServiceResolver *resolver, AvahiAddress *address, uint16_t *port) {
#  371|->     GaServiceResolverPrivate *priv = GA_SERVICE_RESOLVER_GET_PRIVATE(resolver);
#  372|       if (priv->port == 0) {
#  373|           /*         printf("PORT == 0\n"); */

Error: CPPCHECK_WARNING (CWE-398): [#def69]
avahi-0.9.rc2/avahi-ui/avahi-ui.c:332: style[constParameterCallback]: Parameter 'txt' can be declared as pointer to const. However it seems that 'resolve_callback' is a callback function, if 'txt' is declared with const you might also need to cast function pointer(s).
#  330|                                AvahiProtocol protocol G_GNUC_UNUSED, AvahiResolverEvent event, const char *name, const char *type,
#  331|                                const char *domain, const char *host_name, const AvahiAddress *a, uint16_t port,
#  332|->                              AvahiStringList *txt, AvahiLookupResultFlags flags G_GNUC_UNUSED, void *userdata) {
#  333|   
#  334|       AuiServiceDialog *d = AUI_SERVICE_DIALOG(userdata);

Error: CPPCHECK_WARNING (CWE-398): [#def70]
avahi-0.9.rc2/avahi-utils/avahi-browse.c:153: style[constParameterPointer]: Parameter 'config' can be declared as pointer to const
#  151|   }
#  152|   
#  153|-> static void print_service_line(Config *config, char c, AvahiIfIndex interface, AvahiProtocol protocol, const char *name,
#  154|                                  const char *type, const char *domain, int nl) {
#  155|       char ifname[IF_NAMESIZE];

Error: CPPCHECK_WARNING (CWE-563): [#def71]
avahi-0.9.rc2/avahi-utils/avahi-browse.c:480: style[unreadVariable]: Variable 'b' is assigned a value that is never used.
#  478|       assert(c);
#  479|   
#  480|->     if (!(b = avahi_domain_browser_new(client,
#  481|                                          AVAHI_IF_UNSPEC,
#  482|                                          AVAHI_PROTO_UNSPEC,

Error: COMPILER_WARNING (CWE-252): [#def72]
avahi-0.9.rc2/avahi-utils/sigint.c: scope_hint: In function ‘handler’
avahi-0.9.rc2/avahi-utils/sigint.c:54:30: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
#   54 | static void handler(int s) { write(pipe_fds[1], &s, sizeof(s)); }
#      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   52|   }
#   53|   
#   54|-> static void handler(int s) { write(pipe_fds[1], &s, sizeof(s)); }
#   55|   
#   56|   static void close_pipe_fds(void) {

Error: CPPCHECK_WARNING (CWE-475): [#def73]
avahi-0.9.rc2/examples/client-publish-service.c:115: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#  113|           /* Add the service for IPP */
#  114|           if ((ret = avahi_entry_group_add_service(
#  115|->                  group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_ipp._tcp", NULL, NULL, 651, "test=blah", r, NULL)) <
#  116|               0) {
#  117|   

Error: CPPCHECK_WARNING (CWE-475): [#def74]
avahi-0.9.rc2/examples/client-publish-service.c:127: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#  125|           /* Add the same service for BSD LPR */
#  126|           if ((ret = avahi_entry_group_add_service(
#  127|->                  group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_printer._tcp", NULL, NULL, 515, NULL)) < 0) {
#  128|   
#  129|               if (ret == AVAHI_ERR_COLLISION)

Error: CPPCHECK_WARNING (CWE-398): [#def75]
avahi-0.9.rc2/examples/core-publish-service.c:42: style[constParameterCallback]: Parameter 'g' can be declared as pointer to const. However it seems that 'entry_group_callback' is a callback function, if 'g' is declared with const you might also need to cast function pointer(s).
#   40|   static void create_services(AvahiServer *s);
#   41|   
#   42|-> static void entry_group_callback(AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state,
#   43|                                    AVAHI_GCC_UNUSED void *userdata) {
#   44|       assert(s);

Error: CPPCHECK_WARNING (CWE-475): [#def76]
avahi-0.9.rc2/examples/core-publish-service.c:104: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#  102|       /* Add the service for IPP */
#  103|       if ((ret = avahi_server_add_service(
#  104|->              s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_ipp._tcp", NULL, NULL, 651, "test=blah", r, NULL)) < 0) {
#  105|           fprintf(stderr, "Failed to add _ipp._tcp service: %s\n", avahi_strerror(ret));
#  106|           goto fail;

Error: CPPCHECK_WARNING (CWE-475): [#def77]
avahi-0.9.rc2/examples/core-publish-service.c:111: portability[varFuncNullUB]: Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.
#  109|       /* Add the same service for BSD LPR */
#  110|       if ((ret = avahi_server_add_service(
#  111|->              s, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, name, "_printer._tcp", NULL, NULL, 515, NULL)) < 0) {
#  112|           fprintf(stderr, "Failed to add _printer._tcp service: %s\n", avahi_strerror(ret));
#  113|           goto fail;

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
analyzer-version-gcc-analyzer15.2.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.18.3
diffbase-analyzer-version-gcc15.2.1
diffbase-analyzer-version-gcc-analyzer15.2.1
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-128.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-nameavahi-0.9.rc2-6.20251229090240048565.master.121.g13b0273
diffbase-store-results-to/tmp/tmpsqess4rr/avahi-0.9.rc2-6.20251229090240048565.master.121.g13b0273.tar.xz
diffbase-time-created2025-12-29 12:13:12
diffbase-time-finished2025-12-29 12:21:09
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,unicontrol,gcc,shellcheck,clippy' '-o' '/tmp/tmpsqess4rr/avahi-0.9.rc2-6.20251229090240048565.master.121.g13b0273.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--cppcheck-add-flag=--enable=style' '/tmp/tmpsqess4rr/avahi-0.9.rc2-6.20251229090240048565.master.121.g13b0273.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-128.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameavahi-0.9.rc2-6.20251229120235676096.pr819.124.gf79b532
store-results-to/tmp/tmpza53k73x/avahi-0.9.rc2-6.20251229120235676096.pr819.124.gf79b532.tar.xz
time-created2025-12-29 12:21:57
time-finished2025-12-29 12:28:50
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'cppcheck,unicontrol,gcc,shellcheck,clippy' '-o' '/tmp/tmpza53k73x/avahi-0.9.rc2-6.20251229120235676096.pr819.124.gf79b532.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--cppcheck-add-flag=--enable=style' '/tmp/tmpza53k73x/avahi-0.9.rc2-6.20251229120235676096.pr819.124.gf79b532.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9