-
Notifications
You must be signed in to change notification settings - Fork 38
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
EmbeddedProto v3.5.0 - build warnings using gcc #77
Comments
Hello @eS-Ha-79, Thank you for writing in with these issues! Your input helps improve embedded proto. float fields: This has been added to the backlog. It is easy to add and will indeed clarify the meaning of the code. empty messages: CPP17, at the moment, is not the default. There are still customers with projects on CPP14. We may increase the requirement to 17 with the next major release of EmbeddedProto. If that is the case we will include your suggestion. On a side note, may I ask what your use case is for empty messages? Best regards, Bart |
Hey Bart, was playing around with some sort of lightweight/naive (whatever one may call it ;-) ) RPC and used empty messages for commands w/o parameters, e.g.
and
Best regards, |
Hi, I was used to using enums for commands thus far. Best regards, Bart |
Hey, yes keeping it small was the idea. Regarding the floats 0.0 vs 0.0f: Best regards, |
Hi @eS-Ha-79, Both the float default value and a fix for the unused parameter have been implemented in the upcoming v4 release of Embedded Proto. For the unused parameter, I went the old Currently, it is only visible in the develop-v4 branch. This is an active development branch and is not suitable for usage yet. Best regards, Bart |
Hi,
i'm using gcc (13.2.1 but shouldn't matter) with additional warnings enabled:
-Wall -Wextra -Wdouble-promotion
float fields
With messages containing float fields, the following warning(s) are produced in the serialize() function:
I guess changing "0.0" to "0.0f" in
Field.py
->class FieldBasic(Field)
->type_to_default_value
(lines 159+) forthe dictionary entry
FieldDescriptorProto.TYPE_FLOAT
should be enough.empty messages
Using empty messages (like google.protobuf.Empty) there are some unused parameter warnings (generated constructors, assignment operators and serialize() ). Personally, i added
[[maybe_unused]]
attributes inTypeDefMsg.h
but there might be better ways, since this is CPP17+:{{ typedef.get_name() }}([[maybe_unused]] const {{typedef.get_name()}}& rhs )
{{ typedef.get_name() }}([[maybe_unused]] const {{typedef.get_name()}}&& rhs ) noexcept
{{ typedef.name }}& operator=([[maybe_unused]] const {{ typedef.name }}& rhs)
{{ typedef.name }}& operator=([[maybe_unused]] const {{ typedef.name }}&& rhs) noexcept
::EmbeddedProto::Error serialize([[maybe_unused]] ::EmbeddedProto::WriteBufferInterface& buffer) const override
The text was updated successfully, but these errors were encountered: