New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module Build Warnings #4

Closed
WilliamBerryiii opened this Issue Dec 21, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@WilliamBerryiii
Copy link
Member

WilliamBerryiii commented Dec 21, 2016

OS: Linux raspberrypi 4.4.26-v7+
GCC: (Raspbian 4.9.2-10) 4.9.2

When the current module is built against the 2016-11-18 branch of the azure-iot-gateway-sdk on Raspbian the following build warnings are encountered:

Building C object modules/modbus_read/CMakeFiles/modbus_read.dir/src/modbus_read.c.o
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c: In function ‘addOneServer’:
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:171:46: warning: passing argument 1 of ‘isValidServer’ discards ‘const’ qualifier from pointer target type
     if (server_str == NULL || !isValidServer(server_str))
                                              ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:90:13: note: expected ‘char *’ but argument is of type ‘const char *’
 static bool isValidServer(char* server)
             ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:177:49: warning: passing argument 1 of ‘isValidMac’ discards ‘const’ qualifier from pointer target type
     else if (mac_address == NULL || !isValidMac(mac_address))
                                                 ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:54:13: note: expected ‘char *’ but argument is of type ‘const char *’
 static bool isValidMac(char* mac)
             ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c: In function ‘modbusReadThread’:
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:681:43: warning: assignment from incompatible pointer type
             server_config->encode_read_cb = (int*)encode_read_request_com;
                                           ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:682:44: warning: assignment from incompatible pointer type
             server_config->encode_write_cb = (int*)encode_write_request_com;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:683:47: warning: assignment from incompatible pointer type
             server_config->decode_response_cb = (int*)decode_response_com;
                                               ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:684:44: warning: assignment from incompatible pointer type
             server_config->send_request_cb = (int*)send_request_com;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:697:43: warning: assignment from incompatible pointer type
             server_config->encode_read_cb = (int*)encode_read_request_tcp;
                                           ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:698:44: warning: assignment from incompatible pointer type
             server_config->encode_write_cb = (int*)encode_write_request_tcp;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:699:47: warning: assignment from incompatible pointer type
             server_config->decode_response_cb = (int*)decode_response_tcp;
                                               ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:700:44: warning: assignment from incompatible pointer type
             server_config->send_request_cb = (int*)send_request_tcp;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c: At top level:
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:1095:2: warning: initialization from incompatible pointer type
  ModbusRead_ParseConfigurationFromJson,
  ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:1095:2: warning: (near initialization for ‘moduleInterface.Module_ParseConfigurationFromJson’)
Linking C shared module libmodbus_read.so
[ 81%] Built target modbus_read
Scanning dependencies of target modbus_read_static
[ 82%] Building C object modules/modbus_read/CMakeFiles/modbus_read_static.dir/src/modbus_read.c.o
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c: In function ‘addOneServer’:
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:171:46: warning: passing argument 1 of ‘isValidServer’ discards ‘const’ qualifier from pointer target type
     if (server_str == NULL || !isValidServer(server_str))
                                              ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:90:13: note: expected ‘char *’ but argument is of type ‘const char *’
 static bool isValidServer(char* server)
             ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:177:49: warning: passing argument 1 of ‘isValidMac’ discards ‘const’ qualifier from pointer target type
     else if (mac_address == NULL || !isValidMac(mac_address))
                                                 ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:54:13: note: expected ‘char *’ but argument is of type ‘const char *’
 static bool isValidMac(char* mac)
             ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c: In function ‘modbusReadThread’:
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:681:43: warning: assignment from incompatible pointer type
             server_config->encode_read_cb = (int*)encode_read_request_com;
                                           ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:682:44: warning: assignment from incompatible pointer type
             server_config->encode_write_cb = (int*)encode_write_request_com;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:683:47: warning: assignment from incompatible pointer type
             server_config->decode_response_cb = (int*)decode_response_com;
                                               ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:684:44: warning: assignment from incompatible pointer type
             server_config->send_request_cb = (int*)send_request_com;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:697:43: warning: assignment from incompatible pointer type
             server_config->encode_read_cb = (int*)encode_read_request_tcp;
                                           ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:698:44: warning: assignment from incompatible pointer type
             server_config->encode_write_cb = (int*)encode_write_request_tcp;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:699:47: warning: assignment from incompatible pointer type
             server_config->decode_response_cb = (int*)decode_response_tcp;
                                               ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:700:44: warning: assignment from incompatible pointer type
             server_config->send_request_cb = (int*)send_request_tcp;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c: At top level:
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:1095:2: warning: initialization from incompatible pointer type
  ModbusRead_ParseConfigurationFromJson,
  ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:1095:2: warning: (near initialization for ‘moduleInterface.Module_ParseConfigurationFromJson’)
Linking C static library libmodbus_read_static.a
[ 82%] Built target modbus_read_static
Scanning dependencies of target modbus_read_unittests_exe
[ 83%] Building CXX object modules/modbus_read/tests/modbus_read_unittests/CMakeFiles/modbus_read_unittests_exe.dir/modbus_read_unittests.cpp.o
[ 85%] Building C object modules/modbus_read/tests/modbus_read_unittests/CMakeFiles/modbus_read_unittests_exe.dir/__/__/src/modbus_read.c.o
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c: In function ‘addOneServer’:
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:171:46: warning: passing argument 1 of ‘isValidServer’ discards ‘const’ qualifier from pointer target type
     if (server_str == NULL || !isValidServer(server_str))
                                              ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:90:13: note: expected ‘char *’ but argument is of type ‘const char *’
 static bool isValidServer(char* server)
             ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:177:49: warning: passing argument 1 of ‘isValidMac’ discards ‘const’ qualifier from pointer target type
     else if (mac_address == NULL || !isValidMac(mac_address))
                                                 ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:54:13: note: expected ‘char *’ but argument is of type ‘const char *’
 static bool isValidMac(char* mac)
             ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c: In function ‘modbusReadThread’:
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:681:43: warning: assignment from incompatible pointer type
             server_config->encode_read_cb = (int*)encode_read_request_com;
                                           ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:682:44: warning: assignment from incompatible pointer type
             server_config->encode_write_cb = (int*)encode_write_request_com;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:683:47: warning: assignment from incompatible pointer type
             server_config->decode_response_cb = (int*)decode_response_com;
                                               ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:684:44: warning: assignment from incompatible pointer type
             server_config->send_request_cb = (int*)send_request_com;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:697:43: warning: assignment from incompatible pointer type
             server_config->encode_read_cb = (int*)encode_read_request_tcp;
                                           ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:698:44: warning: assignment from incompatible pointer type
             server_config->encode_write_cb = (int*)encode_write_request_tcp;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:699:47: warning: assignment from incompatible pointer type
             server_config->decode_response_cb = (int*)decode_response_tcp;
                                               ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:700:44: warning: assignment from incompatible pointer type
             server_config->send_request_cb = (int*)send_request_tcp;
                                            ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c: At top level:
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:1095:2: warning: initialization from incompatible pointer type
  ModbusRead_ParseConfigurationFromJson,
  ^
/home/pi/code/test/azure-iot-gateway-sdk/modules/modbus_read/src/modbus_read.c:1095:2: warning: (near initialization for ‘moduleInterface.Module_ParseConfigurationFromJson’)```
@606simps

This comment has been minimized.

Copy link
Contributor

606simps commented Jan 16, 2017

Fixed, thanks!

@606simps 606simps closed this Jan 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment