You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Version info:
Pico-SDK develop branch (5592322)
arm-none-eabi-gcc (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24)) 13.3.1 20240614
Steps to reproduce:
Get the pico-examples repository
Rename either of the binary_info examples to have a .cpp extension and update the corresponding CMakeLists.txt
Build that example:
In file included from /pico/pico-sdk/src/common/pico_binary_info/include/pico/binary_info.h:30,
from /pico/pico-examples/binary_info/hello_anything/hello_anything.cpp:9:
/pico/pico-examples/binary_info/hello_anything/hello_anything.cpp: In function 'int main()':
/pico/pico-examples/binary_info/hello_anything/hello_anything.cpp:15:13: error: designator order for field '_binary_info_named_group::flags' does not match declaration order in 'const _binary_info_named_group'
15 | bi_decl(bi_program_feature_group(0x1111, 0, "UART Configuration"));
| ^~~~~~~~~~~~~~~~~~~~~~~~
/pico/pico-examples/binary_info/hello_anything/hello_anything.cpp:16:13: error: designator order for field '_binary_info_named_group::flags' does not match declaration order in 'const _binary_info_named_group'
16 | bi_decl(bi_program_feature_group(0x1111, 1, "Enabled Interfaces"));
| ^~~~~~~~~~~~~~~~~~~~~~~~
C++ has stricter requirements for designated initialisers: cppref
Note: out-of-order designated initialization, nested designated initialization, mixing of designated initializers and regular initializers, and designated initialization of arrays are all supported in the C programming language, but are not allowed in C++.
This can be resolved by changing the __bi_named_group macro so flags and group_tag are initialised in the same order they are declared in the _binary_info_named_group structure:
Version info:
Pico-SDK
develop
branch (5592322)arm-none-eabi-gcc (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24)) 13.3.1 20240614
Steps to reproduce:
Get the
pico-examples
repositoryRename either of the
binary_info
examples to have a.cpp
extension and update the correspondingCMakeLists.txt
Build that example:
C++ has stricter requirements for designated initialisers: cppref
This can be resolved by changing the
__bi_named_group
macro soflags
andgroup_tag
are initialised in the same order they are declared in the_binary_info_named_group
structure:The text was updated successfully, but these errors were encountered: