You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need support for const char* overload to keep convenient usage of CppRuntimeException. The exception is thrown only from Zserio controlled code and we can ensure that all strings are properly zero-terminated.
Note that it's not trivial to add an overload for const char (&message)[N] since the overload resolution would still choose const char* overload.
Also we have use-cases where we currently need to support const char* - e.g. exception throw by zserio enums. It could be possible to change it, but it would be significant amount of work.
There is a corresponding SonarCloud rule S945 which is able to catch some problems in the C++ runtime library. For example in
CppRuntimeException.h
:The problem in the previous example is that the string literal
"vector([...]),"
is silently casted from theconst char[N]
to theconst char*
.Enable this rule and fix all found issues.
The text was updated successfully, but these errors were encountered: