Try not to use c-style initializers#3
Merged
kuba-moo merged 4 commits intolinux-netdev:mainfrom Jul 7, 2025
Merged
Conversation
added 3 commits
July 2, 2025 13:22
More strict/old compilers do not like them: error: designator order for field ‘ynl_policy_attr::type’ does not match declaration order in ‘ynl_policy_attr’ error: designator order for field ‘ynl_policy_attr::type’ does not match declaration order in ‘ynl_policy_attr Signed-off-by: Stanislav Fomichev <stfomichev@gmail.com>
More strict/old compilers do not like them: error: designator order for field ‘ynl_ntf_info::policy’ does not match declaration order in ‘ynl_ntf_info’ Signed-off-by: Stanislav Fomichev <stfomichev@gmail.com>
Signed-off-by: Stanislav Fomichev <stfomichev@gmail.com>
Contributor
|
Build trips on ethtool. Looks like C++ fun? |
Author
|
The same issue that I hack up internally: Should be: (name shadows the type and we don't use type qualifiers enum/struct in the gen) Let me see if I can fix it properly. If not, I'll manually edit the generated file... |
There is a type and a field with the same name (hwtstamp_source): std::optional<hwtstamp_source> hwtstamp_source; It needs to be the following to compile: we need std::optional<enum hwtstamp_source> hwtstamp_source; Also, skip nl80211 gen, the spec is too complicated and ynl-gen-cpp doesn't follow ynl_gen_c.py :-( Signed-off-by: Stanislav Fomichev <stfomichev@gmail.com>
Author
|
Added 2c8e6ef The libs compile locally now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
They are ok if they are in the same order as the fields. Otherwise g++ complains about them:
error: designator order for field ‘ynl_ntf_info::policy’ does not match declaration order in ‘ynl_ntf_info’
Use regular var.field = val style initializers. Also regenerate the libs.