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

Compiler warnings in flash.h: invalid conversion from 'const void*' to 'const flash_driver_api*' #21290

Closed
szundi opened this issue Dec 11, 2019 · 1 comment · Fixed by #21391

Comments

@szundi
Copy link

szundi commented Dec 11, 2019

There is a missing cast in /include/drivers/flash.h, i checked it on master too.

These are only warnings:
In file included from ../src/main.cpp:15: /Users/szundi/zephyrproject/zephyr/include/drivers/flash.h: In function 'int z_impl_flash_read(device*, off_t, void*, size_t)': /Users/szundi/zephyrproject/zephyr/include/drivers/flash.h:104:44: warning: invalid conversion from 'const void*' to 'const flash_driver_api*' [-fpermissive] 104 | const struct flash_driver_api *api = dev->driver_api; | ~~~~~^~~~~~~~~~ | | | const void* /Users/szundi/zephyrproject/zephyr/include/drivers/flash.h: In function 'int z_impl_flash_write(device*, off_t, const void*, size_t)': /Users/szundi/zephyrproject/zephyr/include/drivers/flash.h:128:44: warning: invalid conversion from 'const void*' to 'const flash_driver_api*' [-fpermissive] 128 | const struct flash_driver_api *api = dev->driver_api; | ~~~~~^~~~~~~~~~ | | | const void* /Users/szundi/zephyrproject/zephyr/include/drivers/flash.h: In function 'int z_impl_flash_erase(device*, off_t, size_t)': /Users/szundi/zephyrproject/zephyr/include/drivers/flash.h:159:44: warning: invalid conversion from 'const void*' to 'const flash_driver_api*' [-fpermissive] 159 | const struct flash_driver_api *api = dev->driver_api; | ~~~~~^~~~~~~~~~ | | | const void* /Users/szundi/zephyrproject/zephyr/include/drivers/flash.h: In function 'int z_impl_flash_write_protection_set(device*, bool)': /Users/szundi/zephyrproject/zephyr/include/drivers/flash.h:185:44: warning: invalid conversion from 'const void*' to 'const flash_driver_api*' [-fpermissive] 185 | const struct flash_driver_api *api = dev->driver_api; | ~~~~~^~~~~~~~~~ | | | const void* /Users/szundi/zephyrproject/zephyr/include/drivers/flash.h: In function 'size_t z_impl_flash_get_write_block_size(device*)': /Users/szundi/zephyrproject/zephyr/include/drivers/flash.h:272:44: warning: invalid conversion from 'const void*' to 'const flash_driver_api*' [-fpermissive] 272 | const struct flash_driver_api *api = dev->driver_api; | ~~~~~^~~~~~~~~~ | | | const void*

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