Skip to content

Avoid returning enum in boolean context#2364

Open
dkg wants to merge 1 commit into
rnpgp:release/0.xfrom
dkg:return-boolean
Open

Avoid returning enum in boolean context#2364
dkg wants to merge 1 commit into
rnpgp:release/0.xfrom
dkg:return-boolean

Conversation

@dkg

@dkg dkg commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

Without this fix, when compiling with ENABLE_CRYPTO_REFRESH, we see:

…/src/lib/enc_material.cpp: In member function ‘virtual bool pgp::X25519EncMaterial::parse(pgp_packet_body_t&)’:
…/src/lib/enc_material.cpp:154:20: warning: enum constant in boolean context [-Wint-in-bool-context]
  154 |             return RNP_ERROR_BAD_FORMAT;
      |                    ^~~~~~~~~~~~~~~~~~~~
make[3]: Leaving directory '…/build'

Without this fix, when compiling with `ENABLE_CRYPTO_REFRESH`, we see:

```
…/src/lib/enc_material.cpp: In member function ‘virtual bool pgp::X25519EncMaterial::parse(pgp_packet_body_t&)’:
…/src/lib/enc_material.cpp:154:20: warning: enum constant in boolean context [-Wint-in-bool-context]
  154 |             return RNP_ERROR_BAD_FORMAT;
      |                    ^~~~~~~~~~~~~~~~~~~~
make[3]: Leaving directory '…/build'
```
@codecov

codecov Bot commented Oct 9, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.46%. Comparing base (bf89f0b) to head (dcaa3a1).
⚠️ Report is 15 commits behind head on release/0.x.

Additional details and impacted files
@@             Coverage Diff              @@
##           release/0.x    #2364   +/-   ##
============================================
  Coverage        85.46%   85.46%           
============================================
  Files              126      126           
  Lines            22710    22710           
============================================
  Hits             19408    19408           
  Misses            3302     3302           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TJ-91

TJ-91 commented Oct 29, 2025

Copy link
Copy Markdown
Contributor

FYI, this, among other things, is also being fixed in PR #2355

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

Successfully merging this pull request may close these issues.

2 participants