Skip to content
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

UpdateHasPendingInformation() gives compile error #410

Open
tsgouros opened this issue Jul 1, 2024 · 0 comments
Open

UpdateHasPendingInformation() gives compile error #410

tsgouros opened this issue Jul 1, 2024 · 0 comments

Comments

@tsgouros
Copy link

tsgouros commented Jul 1, 2024

> NMEA2000 % cmake --build .
> [  5%] Building CXX object src/CMakeFiles/nmea2000.dir/N2kMsg.cpp.o
> [ 10%] Building CXX object src/CMakeFiles/nmea2000.dir/N2kStream.cpp.o
> [ 15%] Building CXX object src/CMakeFiles/nmea2000.dir/N2kMessages.cpp.o
> [ 21%] Building CXX object src/CMakeFiles/nmea2000.dir/N2kTimer.cpp.o
> [ 26%] Building CXX object src/CMakeFiles/nmea2000.dir/Seasmart.cpp.o
> [ 31%] Building CXX object src/CMakeFiles/nmea2000.dir/N2kDeviceList.cpp.o
> In file included from XX/teensy/Teensy_40_NMEA2000_depth_and_temperature/libraries/NMEA2000/src/N2kDeviceList.cpp:26:
> In file included from XX/teensy/Teensy_40_NMEA2000_depth_and_temperature/libraries/NMEA2000/src/N2kDeviceList.h:33:
> XX/teensy/Teensy_40_NMEA2000_depth_and_temperature/libraries/NMEA2000/src/NMEA2000.h:923:31: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
>       HasPendingInformation=  PendingIsoAddressClaim.IsEnabled()
>                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> XX/teensy/Teensy_40_NMEA2000_depth_and_temperature/libraries/NMEA2000/src/NMEA2000.h:923:31: note: cast one or both operands to int to silence this warning
> XX/teensy/Teensy_40_NMEA2000_depth_and_temperature/libraries/NMEA2000/src/NMEA2000.h:923:31: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
>       HasPendingInformation=  PendingIsoAddressClaim.IsEnabled()
>                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> XX/teensy/Teensy_40_NMEA2000_depth_and_temperature/libraries/NMEA2000/src/NMEA2000.h:923:31: note: cast one or both operands to int to silence this warning
> XX/teensy/Teensy_40_NMEA2000_depth_and_temperature/libraries/NMEA2000/src/NMEA2000.h:923:31: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
>       HasPendingInformation=  PendingIsoAddressClaim.IsEnabled()
>                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> XX/teensy/Teensy_40_NMEA2000_depth_and_temperature/libraries/NMEA2000/src/NMEA2000.h:923:31: note: cast one or both operands to int to silence this warning
> 3 errors generated.
> make[2]: *** [src/CMakeFiles/nmea2000.dir/N2kDeviceList.cpp.o] Error 1
> make[1]: *** [src/CMakeFiles/nmea2000.dir/all] Error 2
> make: *** [all] Error 2
> 

I changed UpdateHasPendingInformation() to look like this:

    void UpdateHasPendingInformation() {
      HasPendingInformation=  PendingIsoAddressClaim.IsEnabled()
                            || PendingProductInformation.IsEnabled()
                            || PendingConfigurationInformation.IsEnabled()
                            #if !defined(N2K_NO_ISO_MULTI_PACKET_SUPPORT)
                            || NextDTSendTime.IsEnabled()
                            #endif
                            ;
    }
  };

That seems to have silenced the error. This is on a Mac, Ventura 13.6.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant