Cannot build uavcan with -std=c++11 & CMAKE_BUILD_TYPE=Debug

The uavcan/util/comparison.hpp file causes some compile warnings (see below) that comments in build_config.hpp suggest can be removed by defining UAVCAN_CPP_VERSION=UAVCAN_CPP11.

That suggestion results in compiler error because cfloat is not in the search -isystem paths (various ways of getting to NuttX headers). Shouldn’t standard C/C++ library headers come from the compiler, instead of NuttX? UPDATE: I guess not because NuttX provides only a minimal impl.

Regardless, does anyone have a remedy for building cubepilot_cubeorange with -std=c++11?

Compile error when UAVCAN_CPP_VERSION=UAVCAN_CPP11:

    dgeorge@danduril:~/projects/px4/build/cubepilot_cubeorange_default$ /opt/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-g++  -DCONFIG_ARCH_BOARD_CUBEPILOT_CUBEORANGE -DUAVCAN_CPP_VERSION=UAVCAN_CPP11 -DUAVCAN_DRIVER=uavcan_stm32h7 -DUAVCAN_IMPLEMENT_PLACEMENT_NEW=1 -DUAVCAN_MEM_POOL_BLOCK_SIZE=48 -DUAVCAN_NO_ASSERTIONS -DUAVCAN_PLATFORM=generic -DUAVCAN_STM32H7_NUM_IFACES=2 -DUAVCAN_STM32H7_NUTTX=1 -DUAVCAN_STM32H7_TIMER_NUMBER=5 -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/cubepilot/cubeorange/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -INuttX/nuttx/arch/arm/src/armv7-m -INuttX/nuttx/arch/arm/src/chip -INuttX/nuttx/arch/arm/src/common -INuttX/apps/include -Iexternal/Install/include -I../../src/drivers/uavcan/libuavcan/./libuavcan/include -I../../src/drivers/uavcan/libuavcan/./libuavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan/include -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem NuttX/nuttx/include/cxx -isystem NuttX/nuttx/include  -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Wall -Wextra -Wundef -std=c++11 -Os -DNDEBUG   -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-rtti -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -nostdinc++ -fno-sized-deallocation -Wno-cast-align -Wno-deprecated-copy -Wno-address-of-packed-member -std=gnu++14 -o src/drivers/uavcan/libuavcan/libuavcan/CMakeFiles/uavcan.dir/src/transport/uc_can_io.cpp.obj -c /home/dgeorge/projects/px4/src/drivers/uavcan/libuavcan/libuavcan/src/transport/uc_can_io.cpp
    In file included from ../../src/drivers/uavcan/libuavcan/./libuavcan/include/uavcan/util/linked_list.hpp:12:0,
                     from ../../src/drivers/uavcan/libuavcan/./libuavcan/include/uavcan/transport/can_io.hpp:12,
                     from /home/dgeorge/projects/px4/src/drivers/uavcan/libuavcan/libuavcan/src/transport/uc_can_io.cpp:6:
    ../../src/drivers/uavcan/libuavcan/./libuavcan/include/uavcan/util/templates.hpp:19:11: fatal error: cfloat: No such file or directory
     # include <cfloat>       // C++11 mode assumes that all standard headers are available
               ^~~~~~~~
    compilation terminated.

Warnings when UAVCAN_CPP_VERSION=UAVCAN_CPP03:

-- Build files have been written to: /home/dgeorge/projects/my-px4/build/cubepilot_cubeorange_default/external/Build/bootloader_firmware
[386/1388] Building CXX object src/drivers/uavcan/libuavcan/libuavcan/CMakeFiles/uavcan.dir/src/marshal/uc_float_spec.cpp.obj
FAILED: src/drivers/uavcan/libuavcan/libuavcan/CMakeFiles/uavcan.dir/src/marshal/uc_float_spec.cpp.obj 
/usr/bin/ccache /opt/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-g++  -DCONFIG_ARCH_BOARD_CUBEPILOT_CUBEORANGE -DUAVCAN_CPP_VERSION=UAVCAN_CPP03 -DUAVCAN_DEBUG=1 -DUAVCAN_DRIVER=uavcan_stm32h7 -DUAVCAN_IMPLEMENT_PLACEMENT_NEW=1 -DUAVCAN_MEM_POOL_BLOCK_SIZE=48 -DUAVCAN_NO_ASSERTIONS -DUAVCAN_PLATFORM=generic -DUAVCAN_STM32H7_NUM_IFACES=2 -DUAVCAN_STM32H7_NUTTX=1 -DUAVCAN_STM32H7_TIMER_NUMBER=5 -D_SYS_CDEFS_H_ -D_SYS_REENT_H_ -D__CUSTOM_FILE_IO__ -D__PX4_NUTTX -D__STDC_FORMAT_MACROS -I../../boards/cubepilot/cubeorange/src -I../../platforms/nuttx/src/px4/common/include -I. -Isrc/lib -I../../platforms/nuttx/src/px4/stm/stm32h7/include -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -INuttX/nuttx/arch/arm/src/armv7-m -INuttX/nuttx/arch/arm/src/chip -INuttX/nuttx/arch/arm/src/common -INuttX/apps/include -Iexternal/Install/include -I../../src/drivers/uavcan/libuavcan/./libuavcan/include -I../../src/drivers/uavcan/libuavcan/./libuavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan/include/dsdlc_generated -I../../src/drivers/uavcan/libuavcan/libuavcan/include -isystem ../../platforms/nuttx/NuttX/include/cxx -isystem NuttX/nuttx/include/cxx -isystem NuttX/nuttx/include -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -Wall -Wextra -Wundef -std=c++11 -Wall -Wextra -Werror -pedantic -Wfloat-equal -Wconversion -Wsign-conversion -Wcast-align -Wmissing-declarations -Wlogical-op -Wdouble-promotion -Wswitch-enum -Wtype-limits -Wno-error=array-bounds -Wzero-as-null-pointer-constant -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo -Wold-style-cast -Wno-error=deprecated-declarations -g   -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-rtti -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -nostdinc++ -fno-sized-deallocation -Wno-cast-align -Wno-deprecated-copy -Wno-address-of-packed-member -std=gnu++14 -MD -MT src/drivers/uavcan/libuavcan/libuavcan/CMakeFiles/uavcan.dir/src/marshal/uc_float_spec.cpp.obj -MF src/drivers/uavcan/libuavcan/libuavcan/CMakeFiles/uavcan.dir/src/marshal/uc_float_spec.cpp.obj.d -o src/drivers/uavcan/libuavcan/libuavcan/CMakeFiles/uavcan.dir/src/marshal/uc_float_spec.cpp.obj -c ../../src/drivers/uavcan/libuavcan/libuavcan/src/marshal/uc_float_spec.cpp
In file included from ../../src/drivers/uavcan/libuavcan/./libuavcan/include/uavcan/marshal/type_util.hpp:10:0,
                 from ../../src/drivers/uavcan/libuavcan/./libuavcan/include/uavcan/marshal/float_spec.hpp:13,
                 from ../../src/drivers/uavcan/libuavcan/libuavcan/src/marshal/uc_float_spec.cpp:5:
../../src/drivers/uavcan/libuavcan/./libuavcan/include/uavcan/util/comparison.hpp: In instantiation of 'bool uavcan::areFloatsClose(T, T, const T&, const T&) [with T = float]':
../../src/drivers/uavcan/libuavcan/./libuavcan/include/uavcan/util/comparison.hpp:172:87:   required from here
../../src/drivers/uavcan/libuavcan/./libuavcan/include/uavcan/util/comparison.hpp:46:29: error: conversion to 'float' from 'double' may alter its value [-Werror=float-conversion]
     const T diff = std::fabs(a - b);
                    ~~~~~~~~~^~~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors

Additional error messages not shown