Here's a warning I get on darwin:

resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c:766:39: warning:
implicit declaration of function 'coap_get_total_message_length' is invalid
in C99 [-Wimplicit-function-declaration]
            newSender->totalDataLen =
coap_get_total_message_length(bleData->data, bleData->dataLen);

(Note that I'm compiling with -std=c11; I think "invalid in C99" means C99
or later?)

coap_get_total_message_length is prototyped
in resource/csdk/connectivity/lib/libcoap-4.1.1/pdu.h, but it's
conditional: the prototype is within #ifdef WITH_TCP.

caleadapter.c does not test for WITH_TCP.

Here is where coap_get_total_message_length is used:

resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c:
         deviceInfo->totalDataLen =
coap_get_total_message_length(deviceInfo->recvData,
resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrclient.c:
   deviceInfo->totalDataLen =
coap_get_total_message_length(deviceInfo->recvData,
resource/csdk/connectivity/src/bt_le_adapter/arduino/cableserver.cpp:
     g_packetDataLen = coap_get_total_message_length(g_coapBuffer,
g_receivedDataLen);
resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c:
 newSender->totalDataLen = coap_get_total_message_length(bleData->data,
bleData->dataLen);

If this isn't a bug waiting to happen it is surely discombobulated.  But I
don't know what to do about it since I don't really know the code.  My
guess is that coap_get_total_message_length should not be dependent on
WITH_TCP. Either that or the bt code is misusing libcoap?  That seems more
likely since the implementation in pdu.c
calls coap_get_tcp_header_type_from_initbyte.

What say ye?

Thanks,

gregg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160606/30934d65/attachment.html>

Reply via email to