Skip to content
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

libbpf-tools: enforce missing-field-initializers warning and error on… #4975

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

chantra
Copy link
Contributor

@chantra chantra commented Apr 30, 2024

… warnings

In an internal build where missing-field-initializers would be enforce, libbpf-tools would fail to build with an error similar to:

tcptop.c:75:9: error: missing initializer for field 'group' of 'const struct argp_option' [-Werror=missing-field-initializers]
   75 |         { "nosummary", 'S', NULL, 0, "Skip system summary line"},
      |         ^
In file included from tcptop.c:10:
/usr/include/argp.h:73:7: note: 'group' declared here
   73 |   int group;
      |       ^~~~~

This change tacks the default group value of 0 to all struct argp_option used in libbpf-tools.

At the same time, I am taking the opportunity to promote warnings to error in order to prevent regressions from making it in.

… warnings

In an internal build where `missing-field-initializers` would be enforce,
libbpf-tools would fail to build with an error similar to:
```
tcptop.c:75:9: error: missing initializer for field 'group' of 'const struct argp_option' [-Werror=missing-field-initializers]
   75 |         { "nosummary", 'S', NULL, 0, "Skip system summary line"},
      |         ^
In file included from tcptop.c:10:
/usr/include/argp.h:73:7: note: 'group' declared here
   73 |   int group;
      |       ^~~~~
```

This change tacks the default group value of 0 to all `struct argp_option` used
in libbpf-tools.

At the same time, I am taking the opportunity to promote warnings to error
in order to prevent regressions from making it in.

Signed-off-by: Manu Bretelle <[email protected]>
@yonghong-song yonghong-song merged commit 74fe720 into iovisor:master Apr 30, 2024
12 checks passed
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.

None yet

2 participants