Skip to content

/mesh/include/mesh/glue.h : warning: pointer of type 'void *' used in arithmetic #1145

@xgnata

Description

@xgnata

Hi,

I get this warning when I compile my esp32 project using NimBLE-arduino.
I'm not sure that the issue is 100% NimBLE related. I may be due to some bad interactions with Arduino Release v3.3.8 based on ESP-IDF v5.5.4.

In file included from src/Nixie.cpp:11:
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h: In function 'void sys_memcpy_swap(void*, const void*, size_t)':
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h:481:34: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
481 | __ASSERT(((src < dst && (src + length) <= dst) ||
| ~~~~^~~~~~~~
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h:158:15: note: in definition of macro '__ASSERT'
158 | if (!(code)) BT_ERR(str);
| ^~~~
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h:482:30: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
482 | (src > dst && (dst + length) <= src)),
| ~~~~^~~~~~~~
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h:158:15: note: in definition of macro '__ASSERT'
158 | if (!(code)) BT_ERR(str);
| ^~~~
In file included from /Users/xavier/.platformio/packages/toolchain-xtensa-esp-elf/xtensa-esp-elf/include/sys/reent.h:458,
from /Users/xavier/.platformio/packages/framework-arduinoespressif32-libs/esp32/include/newlib/platform_include/sys/reent.h:15,
from /Users/xavier/.platformio/packages/toolchain-xtensa-esp-elf/xtensa-esp-elf/include/stdio.h:60,
from /Users/xavier/.platformio/packages/framework-arduinoespressif32-libs/esp32/include/newlib/platform_include/stdio.h:8,
from /Users/xavier/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:27,
from .pio/libdeps/stable/Timezone/src/Timezone.h:9,
from include/SetNixieTask.h:4,
from src/Nixie.cpp:1:
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h:481:34: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
481 | __ASSERT(((src < dst && (src + length) <= dst) ||
| ~~~~^~~~~~~~
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h:481:5: note: in expansion of macro '__ASSERT'
481 | __ASSERT(((src < dst && (src + length) <= dst) ||
| ^~~~~~~~
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h:482:30: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
482 | (src > dst && (dst + length) <= src)),
| ~~~~^~~~~~~~
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h:481:5: note: in expansion of macro '__ASSERT'
481 | __ASSERT(((src < dst && (src + length) <= dst) ||
| ^~~~~~~~
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h:485:9: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
485 | src += length - 1;
| ~~~~^~~~~~~~~~~~~
cc1plus: warning: pointer of type 'void ' used in arithmetic [-Wpointer-arith]
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h:488:22: warning: ISO C++ forbids incrementing a pointer of type 'void
' [-Wpointer-arith]
488 | *((uint8_t *)dst++) = *((uint8_t )src--);
| ^~~
.pio/libdeps/stable/NimBLE-Arduino/src/nimble/nimble/host/mesh/include/mesh/glue.h:488:44: warning: ISO C++ forbids decrementing a pointer of type 'const void
' [-Wpointer-arith]
488 | *((uint8_t *)dst++) = *((uint8_t *)src--);
| ^~~

Xavier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions