bluetooth: Fix "struct bt_gatt_read_params" declaration

Compiling this declaration with a CXX compiler triggers the compiler
error:

/home/sebo/zephyr/include/bluetooth/gatt.h:898:10: error: ‘struct
bt_gatt_read_params::<anonymous union>::__single’ invalid; an
anonymous union can only have non-static data members [-fpermissive]

Reading up on the standard, I was unable to find any mention of this
being valid C or CXX code (But reading the standard is not
straightforward). And I was unable to find any mechanism to make the
CXX compiler accept it (e.g. Changing the -std, or adding this as a
language extension e.g. -fms-extensions).

So we rewrite it to not declare the struct with the tag
"__single". There does not seem to be any reason for it to be declared
like this.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2018-01-11 17:37:03 +01:00 committed by Anas Nashif
commit f61cd12bf8

View file

@ -895,7 +895,7 @@ struct bt_gatt_read_params {
bt_gatt_read_func_t func;
size_t handle_count;
union {
struct __single {
struct {
u16_t handle;
u16_t offset;
} single;