Skip to content

C++ usage #1205

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

Closed
drahnr opened this issue Aug 21, 2017 · 3 comments
Closed

C++ usage #1205

drahnr opened this issue Aug 21, 2017 · 3 comments
Labels
area: C++ Enhancement Changes/Updates/Additions to existing features

Comments

@drahnr
Copy link

drahnr commented Aug 21, 2017

In file included from /home/bernhard/Projects/nello_firmware_ng/src/main.cpp:4:0:
/home/bernhard/Projects/zephyr/include/sensor.h: In function 'int sensor_attr_set(device*, sensor_channel, sensor_attribute, const sensor_value*)':
/home/bernhard/Projects/zephyr/include/sensor.h:271:45: error: invalid conversion from 'const void*' to 'const sensor_driver_api*' [-fpermissive]
  const struct sensor_driver_api *api = dev->driver_api;
                                        ~~~~~^~~~~~~~~~
/home/bernhard/Projects/zephyr/include/sensor.h: In function 'int sensor_trigger_set(device*, sensor_trigger*, sensor_trigger_handler_t)':
/home/bernhard/Projects/zephyr/include/sensor.h:299:45: error: invalid conversion from 'const void*' to 'const sensor_driver_api*' [-fpermissive]
  const struct sensor_driver_api *api = dev->driver_api;

my config includes the CONFIG_CPLUSPLUS=y the target is the nrf52 dk dev boad.

How do I get around this? Specifiying -fpermissive does not solve my issue. I tried to include all C includes in extern "C" but no success.


CONFIG_COMPILER_OPT="-fpermissive" does not help either

@drahnr
Copy link
Author

drahnr commented Aug 21, 2017

This happens with 1.8.0 and the latest git of today

@drahnr
Copy link
Author

drahnr commented Aug 21, 2017

CXXFLAGS=-fpermissive make works though, but specifying it inside the makefile does not:

#required since pgio.h and snesors.h of zephyr otherwise fail to build
CXXFLAGS="-fpermissive"


BOARD ?= nrf52_pca10040
CONF_FILE = prj.conf

include ${ZEPHYR_BASE}/Makefile.inc

nagineni pushed a commit to nagineni/zephyr that referenced this issue Nov 20, 2017
…rtos#1464)

We are not currently checking if the file exists when
calling FS.statSync() to create the Stats object, in which
case if the file doesn't exists, we should return a undefined
value, and the unit tests should also check if the value
is undefined.  Added a ToDo to properly fix this with adding
a FS.exist() api that can be used to check if the file exists,
and then return a valid FSStat object when the file is invalid
according the NodeJS spec.

Also updated tests and API doc to reflect new change.

Fixes zephyrproject-rtos#1205

Signed-off-by: Jimmy Huang <[email protected]>
@nashif nashif added the Enhancement Changes/Updates/Additions to existing features label Jan 30, 2018
@szundi
Copy link

szundi commented May 30, 2019

This is an issue for me too, i have to use -fpermissive, with that it works, but... it's permissive :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: C++ Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

3 participants