[sr-dev] [kamailio/kamailio] [Low Priority] Minor build warnings with gcc-7.2.1-2.fc27.x86_64 (#1325)

Anthony Messina notifications at github.com
Thu Nov 23 04:53:13 CET 2017


Getting prepared for the next set of builds with an updated Fedora 27 system using gcc-7.2.1-2.fc27.x86_64, the following are the warnings dumped out.  Feel free to close if this isn't important.  I am not reporting that any of these create issues in my running Kamailio instance.

```
rtpengine.c: In function 'add_rtpengine_socks':
rtpengine.c:778:24: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   if (p1 != NULL && p1 != '\0') {
                        ^~
rtpengine.c:778:21: note: did you mean to dereference the pointer?
   if (p1 != NULL && p1 != '\0') {
```

```
libsms_modem.c: In function 'initmodem':
libsms_modem.c:230:36: warning: '%s' directive writing up to 128 bytes into a region of size 91 [-Wformat-overflow=]
    clen=sprintf(command,"AT+CPIN=\"%s\"\r",mdm->pin);
                                    ^~
libsms_modem.c:230:8: note: 'sprintf' output between 12 and 140 bytes into a destination of size 100
    clen=sprintf(command,"AT+CPIN=\"%s\"\r",mdm->pin);
```

```
xhttp_rpc_fnc.c:188:18: warning: 'XHTTP_RPC_Post_1a' defined but not used [-Wunused-const-variable=]
 static const str XHTTP_RPC_Post_1a = str_init("\n"\
                  ^~~~~~~~~~~~~~~~~
xhttp_rpc_fnc.c:176:18: warning: 'XHTTP_RPC_ATTR_VAL_SEPARATOR' defined but not used [-Wunused-const-variable=]
 static const str XHTTP_RPC_ATTR_VAL_SEPARATOR = str_init("=");
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
xhttp_rpc_fnc.c:175:18: warning: 'XHTTP_RPC_ATTR_SEPARATOR' defined but not used [-Wunused-const-variable=]
 static const str XHTTP_RPC_ATTR_SEPARATOR = str_init(" ");
                  ^~~~~~~~~~~~~~~~~~~~~~~~
xhttp_rpc_fnc.c:174:18: warning: 'XHTTP_RPC_NODE_SEPARATOR' defined but not used [-Wunused-const-variable=]
 static const str XHTTP_RPC_NODE_SEPARATOR = str_init(":: ");
                  ^~~~~~~~~~~~~~~~~~~~~~~~
```

```
uac_reg.c: In function 'reg_ht_add':
uac_reg.c:558:81: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
uac_reg.c:502:13:
    p = p + ((bsize)?(bsize):(dst)->len) + 1; \
             ~~~~~~~                                                              
uac_reg.c:558:81:
  reg_copy_shm(&nr->callid, &str_empty, reg_keep_callid ? UAC_REG_TM_CALLID_SIZE : 0);
uac_reg.c:502:14: note: in definition of macro 'reg_copy_shm'
    p = p + ((bsize)?(bsize):(dst)->len) + 1; \
              ^~~~~
```

```
cr_fifo.c:64:12: warning: 'get_fifo_opts' declared 'static' but never defined [-Wunused-function]
 static int get_fifo_opts(str * buf, fifo_opt_t * opts, unsigned int opt_set[]);
            ^~~~~~~~~~~~~
cr_fifo.c:66:12: warning: 'update_route_data' declared 'static' but never defined [-Wunused-function]
 static int update_route_data(fifo_opt_t * opts);
            ^~~~~~~~~~~~~~~~~
cr_fifo.c:753:12: warning: 'update_route_data_recursor' defined but not used [-Wunused-function]
 static int update_route_data_recursor(struct dtrie_node_t *node, str * act_domain, fifo_opt_t * opts) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~
cr_fifo.c:78:12: warning: 'str_toklen' defined but not used [-Wunused-function]
 static int str_toklen(str * str, const char * delims)
            ^~~~~~~~~~
```

```
authorize.c:158:12: warning: 'get_ha1' defined but not used [-Wunused-function]
 static int get_ha1(struct username* _username, str* _domain,
            ^~~~~~~
```

```
java_msgobj.c: In function 'fill_sipmsg_object':
java_msgobj.c:88:30: warning: passing argument 2 of '(*env)->SetIntField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetIntField(env, SipMsgInstance, fid, msg->id);
                              ^~~~~~~~~~~~~~
java_msgobj.c:88:30: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:103:30: warning: passing argument 2 of '(*env)->SetIntField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetIntField(env, SipMsgInstance, fid, msg->pid);
                              ^~~~~~~~~~~~~~
java_iface.c: In function 'java_exec':
java_iface.c:193:48: warning: passing argument 2 of '(*env)->NewLocalRef' from incompatible pointer type [-Wincompatible-pointer-types]
     invk_method_ref = (*env)->NewLocalRef(env, invk_method);
                                                ^~~~~~~~~~~
java_iface.c:193:48: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'jmethodID {aka struct _jmethodID *}'
java_iface.c:193:21: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
     invk_method_ref = (*env)->NewLocalRef(env, invk_method);
                     ^
java_iface.c:197:30: warning: passing argument 2 of '(*env)->DeleteLocalRef' from incompatible pointer type [-Wincompatible-pointer-types]
  (*env)->DeleteLocalRef(env, invk_method_ref);
                              ^~~~~~~~~~~~~~~
java_iface.c:197:30: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'jmethodID {aka struct _jmethodID *}'
java_iface.c:206:32: warning: passing argument 2 of '(*env)->MonitorEnter' from incompatible pointer type [-Wincompatible-pointer-types]
  if ((*env)->MonitorEnter(env, invk_method_ref) != JNI_OK)
                                ^~~~~~~~~~~~~~~
java_iface.c:206:32: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'jmethodID {aka struct _jmethodID *}'
java_iface.c:228:34: warning: passing argument 2 of '(*env)->DeleteLocalRef' from incompatible pointer type [-Wincompatible-pointer-types]
      (*env)->DeleteLocalRef(env, invk_method_ref);
                                  ^~~~~~~~~~~~~~~
java_iface.c:228:34: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'jmethodID {aka struct _jmethodID *}'
java_iface.c:229:34: warning: passing argument 2 of '(*env)->DeleteLocalRef' from incompatible pointer type [-Wincompatible-pointer-types]
      (*env)->DeleteLocalRef(env, invk_method);
                                  ^~~~~~~~~~~
java_iface.c:229:34: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'jmethodID {aka struct _jmethodID *}'
java_iface.c:251:30: warning: passing argument 2 of '(*env)->DeleteLocalRef' from incompatible pointer type [-Wincompatible-pointer-types]
  (*env)->DeleteLocalRef(env, invk_method_ref);
                              ^~~~~~~~~~~~~~~
java_iface.c:251:30: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'jmethodID {aka struct _jmethodID *}'
java_iface.c:252:30: warning: passing argument 2 of '(*env)->DeleteLocalRef' from incompatible pointer type [-Wincompatible-pointer-types]
  (*env)->DeleteLocalRef(env, invk_method);
                              ^~~~~~~~~~~
java_iface.c:252:30: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'jmethodID {aka struct _jmethodID *}'
java_iface.c:260:31: warning: passing argument 2 of '(*env)->MonitorExit' from incompatible pointer type [-Wincompatible-pointer-types]
  if ((*env)->MonitorExit(env, invk_method_ref) != JNI_OK)
                               ^~~~~~~~~~~~~~~
java_iface.c:260:31: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'jmethodID {aka struct _jmethodID *}'
java_iface.c:266:33: warning: passing argument 2 of '(*env)->DeleteLocalRef' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->DeleteLocalRef(env, invk_method_ref);
                                 ^~~~~~~~~~~~~~~
java_iface.c:266:33: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'jmethodID {aka struct _jmethodID *}'
java_iface.c:267:33: warning: passing argument 2 of '(*env)->DeleteLocalRef' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->DeleteLocalRef(env, invk_method);
                                 ^~~~~~~~~~~
java_iface.c:267:33: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'jmethodID {aka struct _jmethodID *}'
java_msgobj.c:103:30: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
app_java_mod.c: In function 'child_init':
java_msgobj.c:119:33: warning: passing argument 2 of '(*env)->SetObjectField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam);
                                 ^~~~~~~~~~~~~~
java_msgobj.c:119:33: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
app_java_mod.c:230:33: warning: passing argument 2 of '(*env)->DeleteLocalRef' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->DeleteLocalRef(env, child_init_id);
                                 ^~~~~~~~~~~~~
java_native_methods.c: In function 'Java_org_siprouter_SipMsg_ParseSipMsg':
java_native_methods.c:478:12: warning: return from incompatible pointer type [-Wincompatible-pointer-types]
     return fill_sipmsg_object(jenv, msg);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
java_msgobj.c:136:33: warning: passing argument 2 of '(*env)->SetObjectField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam);
                                 ^~~~~~~~~~~~~~
java_msgobj.c:136:33: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:153:33: warning: passing argument 2 of '(*env)->SetObjectField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam);
                                 ^~~~~~~~~~~~~~
app_java_mod.c:230:33: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'jmethodID {aka struct _jmethodID *}'
java_msgobj.c:153:33: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:169:30: warning: passing argument 2 of '(*env)->SetIntField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetIntField(env, SipMsgInstance, fid, msg->len);
                              ^~~~~~~~~~~~~~
java_msgobj.c:169:30: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:185:33: warning: passing argument 2 of '(*env)->SetObjectField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam);
                                 ^~~~~~~~~~~~~~
java_msgobj.c:185:33: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:202:33: warning: passing argument 2 of '(*env)->SetObjectField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam);
                                 ^~~~~~~~~~~~~~
java_msgobj.c:202:33: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:218:30: warning: passing argument 2 of '(*env)->SetIntField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetIntField(env, SipMsgInstance, fid, msg->parsed_orig_ruri_ok);
                              ^~~~~~~~~~~~~~
java_msgobj.c:218:30: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:234:33: warning: passing argument 2 of '(*env)->SetObjectField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam);
                                 ^~~~~~~~~~~~~~
java_msgobj.c:234:33: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:250:30: warning: passing argument 2 of '(*env)->SetIntField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetIntField(env, SipMsgInstance, fid, msg->add_to_branch_len);
                              ^~~~~~~~~~~~~~
java_msgobj.c:250:30: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:265:30: warning: passing argument 2 of '(*env)->SetIntField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetIntField(env, SipMsgInstance, fid, msg->hash_index);
                              ^~~~~~~~~~~~~~
java_msgobj.c:265:30: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:280:30: warning: passing argument 2 of '(*env)->SetIntField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetIntField(env, SipMsgInstance, fid, msg->msg_flags);
                              ^~~~~~~~~~~~~~
java_msgobj.c:280:30: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:296:33: warning: passing argument 2 of '(*env)->SetObjectField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam);
                                 ^~~~~~~~~~~~~~
java_msgobj.c:296:33: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
java_msgobj.c:313:33: warning: passing argument 2 of '(*env)->SetObjectField' from incompatible pointer type [-Wincompatible-pointer-types]
     (*env)->SetObjectField(env, SipMsgInstance, fid, jStrParam);
                                 ^~~~~~~~~~~~~~
java_msgobj.c:313:33: note: expected 'jobject {aka struct _jobject *}' but argument is of type 'struct _jobject **'
```
```
mongodb_dbase.c: In function 'db_mongodb_query':
mongodb_dbase.c:922:2: warning: 'mongoc_collection_find' is deprecated: Use mongoc_collection_find_with_opts instead [-Wdeprecated-declarations]
  mgcon->cursor = mongoc_collection_find (mgcon->collection,
  ^~~~~
In file included from /usr/include/libmongoc-1.0/mongoc-client.h:28:0,
                 from /usr/include/libmongoc-1.0/mongoc.h:28,
                 from mongodb_connection.h:26,
                 from mongodb_dbase.c:27:
/usr/include/libmongoc-1.0/mongoc-collection.h:145:1: note: declared here
 mongoc_collection_find (mongoc_collection_t *collection,
 ^~~~~~~~~~~~~~~~~~~~~~
```

```
mongodb_client.c: In function 'mongodbc_exec_cmd':
mongodb_client.c:290:4: warning: 'mongoc_collection_find' is deprecated: Use mongoc_collection_find_with_opts instead [-Wdeprecated-declarations]
    rpl->cursor = mongoc_collection_find (rpl->collection,
    ^~~
In file included from /usr/include/libmongoc-1.0/mongoc-client.h:28:0,
                 from /usr/include/libmongoc-1.0/mongoc.h:28,
                 from mongodb_client.h:25,
                 from mongodb_client.c:34:
/usr/include/libmongoc-1.0/mongoc-collection.h:145:1: note: declared here
 mongoc_collection_find (mongoc_collection_t *collection,
 ^~~~~~~~~~~~~~~~~~~~~~
```

```
subscribe.c: In function 'reply_200':
subscribe.c:340:6: warning: unused variable 'len' [-Wunused-variable]
  int len;
      ^~~
```

```
In file included from /usr/include/python2.7/pyconfig.h:6:0,
                 from /usr/include/python2.7/Python.h:8,
                 from apy_kemi_export.c:30:
/usr/include/python2.7/pyconfig-64.h:1202:0: warning: "_POSIX_C_SOURCE" redefined
 #define _POSIX_C_SOURCE 200112L
 
In file included from /usr/include/bits/libc-header-start.h:33:0,
                 from /usr/include/stdio.h:27,
                 from apy_kemi_export.c:26:
/usr/include/features.h:260:0: note: this is the location of the previous definition
 # define _POSIX_C_SOURCE 200809L
```

```
In file included from /usr/include/python2.7/pyconfig.h:6:0,
                 from /usr/include/python2.7/Python.h:8,
                 from apy_kemi.c:25:
/usr/include/python2.7/pyconfig-64.h:1202:0: warning: "_POSIX_C_SOURCE" redefined
 #define _POSIX_C_SOURCE 200112L
 
In file included from /usr/include/bits/libc-header-start.h:33:0,
                 from /usr/include/stdio.h:27,
                 from apy_kemi.c:21:
/usr/include/features.h:260:0: note: this is the location of the previous definition
 # define _POSIX_C_SOURCE 200809L
```

```
sterman.c: In function 'extract_avp':
sterman.c:77:60: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   if (!q && p == vp->strvalue && vp->strvalue+sizeof(char) != '\0' ) {
                                                            ^~
sterman.c:77:34: note: did you mean to dereference the pointer?
   if (!q && p == vp->strvalue && vp->strvalue+sizeof(char) != '\0' ) {
```

```
xhttp_pi_fnc.c:358:18: warning: 'XHTTP_PI_CODE_2' defined but not used [-Wunused-const-variable=]
 static const str XHTTP_PI_CODE_2 = str_init("</pre>");
                  ^~~~~~~~~~~~~~~
xhttp_pi_fnc.c:357:18: warning: 'XHTTP_PI_CODE_1' defined but not used [-Wunused-const-variable=]
 static const str XHTTP_PI_CODE_1 = str_init("<pre>");
                  ^~~~~~~~~~~~~~~
xhttp_pi_fnc.c:356:18: warning: 'XHTTP_PI_BREAK' defined but not used [-Wunused-const-variable=]
 static const str XHTTP_PI_BREAK = str_init("<br/>");
                  ^~~~~~~~~~~~~~
xhttp_pi_fnc.c:352:18: warning: 'XHTTP_PI_NODE_SEPARATOR' defined but not used [-Wunused-const-variable=]
 static const str XHTTP_PI_NODE_SEPARATOR = str_init(":: ");
                  ^~~~~~~~~~~~~~~~~~~~~~~
xhttp_pi_fnc.c:351:18: warning: 'XHTTP_PI_NODE_INDENT' defined but not used [-Wunused-const-variable=]
 static const str XHTTP_PI_NODE_INDENT = str_init("\t");
                  ^~~~~~~~~~~~~~~~~~~~
xhttp_pi_fnc.c:348:18: warning: 'XHTTP_PI_SEMICOLON' defined but not used [-Wunused-const-variable=]
 static const str XHTTP_PI_SEMICOLON = str_init(" : ");
                  ^~~~~~~~~~~~~~~~~~
```

```
xode.c: In function 'xode_get_tag':
xode.c:346:77: warning: comparison between pointer and zero character constant [-Wpointer-compare]
     if(parent == NULL || parent->firstchild == NULL || name == NULL || name == '\0') return NULL;
                                                                             ^~
xode.c:346:72: note: did you mean to dereference the pointer?
     if(parent == NULL || parent->firstchild == NULL || name == NULL || name == '\0') return NULL;
                                                                        ^
```

```
xstream.c: In function '_xode_put_expatattribs':
xstream.c:34:20: warning: comparison between pointer and zero character constant [-Wpointer-compare]
     while (atts[i] != '\0')
                    ^~
xstream.c:34:12: note: did you mean to dereference the pointer?
     while (atts[i] != '\0')
            ^
xode_from.c: In function '_xode_put_expatattribs':
xode_from.c:35:20: warning: comparison between pointer and zero character constant [-Wpointer-compare]
     while (atts[i] != '\0')
                    ^~
xode_from.c:35:12: note: did you mean to dereference the pointer?
     while (atts[i] != '\0')
            ^
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1325
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20171123/18bd4406/attachment-0001.html>


More information about the sr-dev mailing list