Skip to content

Address warning in compiler #22

@gvegayon

Description

@gvegayon

Recently, a compiler found the following issue:

Found the following significant warnings:
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:188:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:143:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:270:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:229:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:311:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:358:9: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:418:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:458:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:498:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:538:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:578:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:618:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:658:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:698:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    /Volumes/Builds/packages/big-sur-arm64/Rlib/4.5/barry/include/barry/counters/network-css.hpp:738:5: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]

This has been found in a handful of compiler x OS combinations. We need to ensure that proper Boolean operands are used. We can check when this is happening by adding the corresponding flag to the compiler (-Wbitwise-instead-of-logical). Check this in other parts of the code as well (the network-css.hpp header may not be the only one).

This will also require bumping the version of barry. Since this is a small modification, let's increase the patch number (major.minor.patch).

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions