Skip to content

Conversation

@Cyberax
Copy link
Contributor

@Cyberax Cyberax commented Sep 19, 2025

constexpr doesn't imply const?!?

This silences this warning:

.....libraries/SNMP/src/SNMPMessage.h:127:53: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  127 |         static constexpr char *SNMPTRAPENTERPRISE = "1.3.6.1.6.3.1.1.4.3.0";
      |                                                     ^~~~~~~~~~~~~~~~~~~~~~~

`constexpr` doesn't imply `const`?!?

This silences this warning:

```
.....libraries/SNMP/src/SNMPMessage.h:127:53: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  127 |         static constexpr char *SNMPTRAPENTERPRISE = "1.3.6.1.6.3.1.1.4.3.0";
      |                                                     ^~~~~~~~~~~~~~~~~~~~~~~
```
@patricklaf patricklaf merged commit 76e6f3b into patricklaf:master Oct 20, 2025
2 checks passed
@patricklaf
Copy link
Owner

Hello @Cyberax ,
Thank you for this PR.

@patricklaf patricklaf mentioned this pull request Oct 20, 2025
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