connectedhomeip icon indicating copy to clipboard operation
connectedhomeip copied to clipboard

Figure out a better way to test for NaN in attribute-storage-null-handling.h

Open bzbarsky-apple opened this issue 4 years ago • 1 comments

Problem

We have this code:

        // Trying to include math.h (to use isnan()) fails on EFR32, both when
        // included as "cmath" and when included as "math.h".  For lack of
        // isnan(), just fall back on the NaN != NaN thing.
        return value != value;

but as https://github.com/project-chip/connectedhomeip/pull/12439#discussion_r760761018 points out this could trap (certainly if value happens to be a signaling NaN).

Proposed Solution

Ideally, the EFR32 headers would get fixed so including "math.h" works. The compiler error we run into is on this line:

.environment/cipd/pigweed/arm-none-eabi/include/c++/10.2.1/cmath:237:  using ::fabs;

where the compiler complains it has no idea what ::fabs is.

@mspang do you know who might know about this?

bzbarsky-apple avatar Dec 02 '21 07:12 bzbarsky-apple

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Sep 17 '22 00:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Mar 22 '23 22:03 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Oct 15 '23 07:10 stale[bot]