Skip to content
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

Error when building with clang #119

Open
tfarina opened this issue Sep 13, 2014 · 18 comments
Open

Error when building with clang #119

tfarina opened this issue Sep 13, 2014 · 18 comments

Comments

@tfarina
Copy link

tfarina commented Sep 13, 2014

$ ./bootstrap-configure --disable-bluetooth
$ make
...
src/simutil.c:1551:12: error: comparison of constant 8 with expression of type 'enum sim_cphs_service' is always false
[-Werror,-Wtautological-constant-out-of-range-compare]
if (index >= 2 * 4u)
~~~~~ ^ ~~~~~~

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

src/smsutil.c:3566:8: error: implicit conversion from enumeration type 'enum sms_alphabet' to different enumeration type 'enum gsm_dialect'
[-Werror,-Wenum-conversion]
alphabet, &used_locking,
^~~~~~~~

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

unit/test-stkutil.c:16870:28: error: unused variable 'get_input_response_191b' [-Werror,-Wunused-const-variable]
static const unsigned char get_input_response_191b[] = {
^
unit/test-stkutil.c:17352:28: error: unused variable 'poll_interval_response_111b' [-Werror,-Wunused-const-variable]
static const unsigned char poll_interval_response_111b[] = {
^
unit/test-stkutil.c:17484:44: error: unused variable 'refresh_response_data_131b' [-Werror,-Wunused-const-variable]
static const struct terminal_response_test refresh_response_data_131b = {
^
unit/test-stkutil.c:18341:20: error: unused variable 'bcch_channels_131' [-Werror,-Wunused-const-variable]
static const short bcch_channels_131[] = {
^
4 errors generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

src/stkutil.c:4423:12: error: comparison of array 'ussd->string' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
if (ussd->string == NULL)
~~~~~~^~~~~~ ~~~~
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

gril/grilreply.c:461:6: error: cast from 'int *' to 'long *' increases required alignment from 4 to 8 [-Werror,-Wcast-align](long *) &reply->hex_len, -1);
^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

unit/test-mux.c:221:2: error: implicit declaration of function 'g_test_trap_subprocess' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
g_test_trap_subprocess("/testmux/basic:subprocess",
^
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

unit/test-caif.c:143:2: error: implicit declaration of function 'g_test_trap_subprocess' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
g_test_trap_subprocess("/testcaif/basic:subprocess",
^
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

tools/get-location.c:249:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (data_source < 0) {
^~~~~~~~~~~~~~~
tools/get-location.c:270:9: note: uninitialized use occurs here
return ret;
^~~
tools/get-location.c:249:2: note: remove the 'if' if its condition is always false
if (data_source < 0) {
^~~~~~~~~~~~~~~~~~~~~~
tools/get-location.c:245:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (signal_source < 0)
^~~~~~~~~~~~~~~~~
tools/get-location.c:270:9: note: uninitialized use occurs here
return ret;
^~~
tools/get-location.c:245:2: note: remove the 'if' if its condition is always false
if (signal_source < 0)
^~~~~~~~~~~~~~~~~~~~~~
tools/get-location.c:221:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
2 errors generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

plugins/isiusb.c:207:28: error: comparison of constant 0 with boolean expression is always false
[-Werror,-Wtautological-constant-out-of-range-compare]
if (!g_isi_msg_error(msg) < 0)
~~~~~~~~~~~~~~~~~~~~~ ^ ~
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

plugins/n900.c:241:28: error: comparison of constant 0 with boolean expression is always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (!g_isi_msg_error(msg) < 0)
~~~~~~~~~~~~~~~~~~~~~ ^ ~
1 error generated.

plugins/u8500.c:235:28: error: comparison of constant 0 with boolean expression is always false
[-Werror,-Wtautological-constant-out-of-range-compare]
if (!g_isi_msg_error(msg) < 0)
~~~~~~~~~~~~~~~~~~~~~ ^ ~
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

drivers/atmodem/ussd.c:121:6: error: variable 'dcs' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (!g_at_result_iter_next_string(&iter, &content))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/atmodem/ussd.c:168:34: note: uninitialized use occurs here
ofono_ussd_notify(ussd, status, dcs, msg_ptr, msg_ptr ? msg_len : 0);
^~~
drivers/atmodem/ussd.c:121:2: note: remove the 'if' if its condition is always false
if (!g_at_result_iter_next_string(&iter, &content))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/atmodem/ussd.c:107:9: note: initialize the variable 'dcs' to silence this warning
int dcs;
^
= 0
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

drivers/atmodem/voicecall.c:360:6: error: variable 'num' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
if (g_at_result_iter_next(&iter, "+COLP:")) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/atmodem/voicecall.c:373:52: note: uninitialized use occurs here
call = create_call(vc, 0, 0, CALL_STATUS_DIALING, num, type, validity);
^~~
drivers/atmodem/voicecall.c:360:2: note: remove the 'if' if its condition is always true
if (g_at_result_iter_next(&iter, "+COLP:")) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/atmodem/voicecall.c:335:17: note: initialize the variable 'num' to silence this warning
const char *num;
^
= NULL
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

drivers/huaweimodem/ussd.c:65:6: error: variable 'dcs' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (!g_at_result_iter_next_string(&iter, &content))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/huaweimodem/ussd.c:74:34: note: uninitialized use occurs here
ofono_ussd_notify(ussd, status, dcs, msg_ptr, msg_ptr ? msg_len : 0);
^~~
drivers/huaweimodem/ussd.c:65:2: note: remove the 'if' if its condition is always false
if (!g_at_result_iter_next_string(&iter, &content))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/huaweimodem/ussd.c:51:17: note: initialize the variable 'dcs' to silence this warning
int status, dcs;
^
= 0
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

drivers/huaweimodem/radio-settings.c:106:10: error: implicit conversion from enumeration type 'enum ofono_radio_band_umts' to different enumeration
type 'enum ofono_radio_band_gsm' [-Werror,-Wenum-conversion]
return OFONO_RADIO_BAND_UMTS_ANY;
~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

drivers/stemodem/caif_rtnl.c:82:14: error: cast from 'char ' to 'struct rtattr *' increases required alignment from 1 to 2 [-Werror,-Wcast-align]
for (attr = IFLA_RTA(msg); RTA_OK(attr, size);
^~~~~~~~~~~~~
/usr/include/linux/if_link.h:148:23: note: expanded from macro 'IFLA_RTA'
#define IFLA_RTA(r) ((struct rtattr
)(((char_)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/stemodem/caif_rtnl.c:83:10: error: cast from 'char *' to 'struct rtattr ' increases required alignment from 1 to 2 [-Werror,-Wcast-align]
attr = RTA_NEXT(attr, size)) {
^~~~~~~~~~~~~~~~~~~~
/usr/include/linux/rtnetlink.h:150:6: note: expanded from macro 'RTA_NEXT'
(struct rtattr_)(((char
)(rta)) + RTA_ALIGN((rta)->rta_len)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

drivers/speedupmodem/ussd.c:64:6: error: variable 'dcs' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (!g_at_result_iter_next_string(&iter, &content))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/speedupmodem/ussd.c:73:34: note: uninitialized use occurs here
ofono_ussd_notify(ussd, status, dcs, msg_ptr, msg_ptr ? msg_len : 0);
^~~
drivers/speedupmodem/ussd.c:64:2: note: remove the 'if' if its condition is always false
if (!g_at_result_iter_next_string(&iter, &content))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/speedupmodem/ussd.c:50:17: note: initialize the variable 'dcs' to silence this warning
int status, dcs;
^
= 0
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

src/radio-settings.c:165:11: error: implicit conversion from enumeration type 'enum ofono_radio_band_gsm' to different enumeration type
'enum ofono_radio_band_umts' [-Werror,-Wenum-conversion]
*band = OFONO_RADIO_BAND_GSM_ANY;
~ ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

btio/btio.c:522:15: error: no member named 'key_size' in 'struct bt_security'
size = sec.key_size;
~~~ ^
1 error generated.
make[1]: *
* [btio/btio.o] Error 1

@tfarina
Copy link
Author

tfarina commented Sep 13, 2014

btio/btio.o: In function parse_set_opts': btio/btio.c:(.text+0x57a): undefined reference tostr2ba'
btio/btio.c:(.text+0x5b8): undefined reference to str2ba' btio/btio.o: In functionbt_io_get':
btio/btio.c:(.text+0x1213): undefined reference to ba2str' btio/btio.c:(.text+0x1268): undefined reference toba2str'
btio/btio.c:(.text+0x176f): undefined reference to ba2str' btio/btio.c:(.text+0x17bc): undefined reference toba2str'
btio/btio.c:(.text+0x1c0d): undefined reference to ba2str' btio/btio.o:btio/btio.c:(.text+0x1c62): more undefined references toba2str' follow
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [dundee/dundee] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant