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

Build warning: [-Wpointer-bool-conversion] with LLVM/icx (samples/bluetooth/mesh) #3985

Closed
zephyrbot opened this issue Aug 18, 2017 · 0 comments
Assignees
Labels
area: Bluetooth area: Samples Samples bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Milestone

Comments

@zephyrbot
Copy link
Collaborator

zephyrbot commented Aug 18, 2017

Reported by ashish sinha:

Test case with build warnings raised from LLVM/icx:
samples/bluetooth/mesh

zephyr/subsys/bluetooth/host/mesh/transport.c:982:30: warning: 
      address of 'net_rx->ctx' will always evaluate to 'true'
      [-Wpointer-bool-conversion]
        if (!sdu_len_is_ok(&net_rx->ctx, seg_n)) {
             ~~~~~~~~~~~~~  ~~~~~~~~^~~
1 warning generated.
  CC      subsys/bluetooth/host/mesh/crypto.o
  CC      subsys/bluetooth/host/mesh/access.o
zephyr/subsys/bluetooth/host/mesh/access.c:35:3: warning: 
      duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
} const model_init[] = {
  ^
1 warning generated.
  CC      subsys/bluetooth/host/mesh/cfg.o
  CC      subsys/bluetooth/host/mesh/health.o
  CC      subsys/bluetooth/host/mesh/prov.o
zephyr/subsys/bluetooth/host/mesh/prov.c:616:31: warning: 
      passing 'u8_t [9]' to parameter of type 'const char *' converts between
      pointers to integer types with different sign [-Wpointer-sign]
                        return prov->output_string(str);
                                                   ^~~
zephyr/subsys/bluetooth/host/mesh/prov.c:758:10: warning: 
      passing 'u8_t [16]' to parameter of type 'char *' converts between
      pointers to integer types with different sign [-Wpointer-sign]
        strncpy(link.auth, str, prov->output_size);
                ^~~~~~~~~
zephyr/lib/libc/minimal/include/string.h:20:45: note: 
      passing argument to parameter 'd' here
extern char  *strncpy(char *_MLIBC_RESTRICT d, const char *_MLIBC_RESTRICT s,
                                            ^
2 warnings generated.


how-to-reproduce:

source zephyr-env.sh
export ZEPHYR_GCC_VARIANT=issm
cd samples/bluetooth/mesh
make pristine
make BOARD=quark_se_c1000_devboard CC=icx

(Imported from Jira ZEP-2555)

@zephyrbot zephyrbot added priority: low Low impact/importance bug area: Samples Samples area: Bluetooth bug The issue is a bug, or the PR is fixing a bug labels Sep 23, 2017
@zephyrbot zephyrbot added this to the v1.10.0 milestone Sep 23, 2017
jhedberg added a commit to jhedberg/zephyr that referenced this issue Sep 26, 2017
Some compilers (like icx) may complain about unsigned vs signed
strings.

Fixes zephyrproject-rtos#3985

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
jhedberg added a commit to jhedberg/zephyr that referenced this issue Sep 26, 2017
The code was passing the wrong first parameter to the sdu_len_is_ok()
function.

Fixes zephyrproject-rtos#3985
Fixes zephyrproject-rtos#3984

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
jhedberg added a commit that referenced this issue Sep 26, 2017
The code was passing the wrong first parameter to the sdu_len_is_ok()
function.

Fixes #3985
Fixes #3984

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
jhedberg added a commit to jhedberg/zephyr that referenced this issue Oct 19, 2017
Some compilers (like icx) may complain about unsigned vs signed
strings.

Fixes zephyrproject-rtos#3985

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
jhedberg added a commit to jhedberg/zephyr that referenced this issue Oct 19, 2017
The code was passing the wrong first parameter to the sdu_len_is_ok()
function.

Fixes zephyrproject-rtos#3985
Fixes zephyrproject-rtos#3984

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
nashif pushed a commit that referenced this issue Oct 19, 2017
Some compilers (like icx) may complain about unsigned vs signed
strings.

Fixes #3985

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
nashif pushed a commit that referenced this issue Oct 19, 2017
The code was passing the wrong first parameter to the sdu_len_is_ok()
function.

Fixes #3985
Fixes #3984

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth area: Samples Samples bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

2 participants