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

[PATCH v5] quell GCC 13.1 bound check warnings #1838

Merged
merged 3 commits into from
Dec 21, 2023

Conversation

JereLeppanen
Copy link
Collaborator

@JereLeppanen JereLeppanen commented Jun 9, 2023

Quell a few -Warray-bounds and -Wstringop-overflow warnings with GCC 13.1, with and without -Wpedantic.

The question here is do we keep adding these pragmas to the code or do we just disable -Warray-bounds and -Wstringop-overflow?

@odpbuild odpbuild changed the title Quell GCC 13.1.1 bound check warnings [PATCH v1] Quell GCC 13.1.1 bound check warnings Jun 9, 2023
@odpbuild odpbuild changed the title [PATCH v1] Quell GCC 13.1.1 bound check warnings [PATCH v2] Quell GCC 13.1.1 bound check warnings Jun 12, 2023
@JereLeppanen
Copy link
Collaborator Author

v2:

  • Don't try to fix flexible array member in ethtool_stats.c, just quell the error.
  • Quell error in odp_api_from_cpp LTO link.

@JereLeppanen JereLeppanen changed the title [PATCH v2] Quell GCC 13.1.1 bound check warnings [PATCH v2] Quell GCC 13.1 bound check warnings Jun 12, 2023
@JereLeppanen JereLeppanen changed the title [PATCH v2] Quell GCC 13.1 bound check warnings [PATCH v2] quell GCC 13.1 bound check warnings Jun 15, 2023
@JereLeppanen JereLeppanen marked this pull request as ready for review June 15, 2023 09:46
@odpbuild odpbuild changed the title [PATCH v2] quell GCC 13.1 bound check warnings [PATCH v3] quell GCC 13.1 bound check warnings Oct 27, 2023
@JereLeppanen
Copy link
Collaborator Author

v3:

  • Rebase.

@odpbuild odpbuild changed the title [PATCH v3] quell GCC 13.1 bound check warnings [PATCH v4] quell GCC 13.1 bound check warnings Nov 23, 2023
@JereLeppanen
Copy link
Collaborator Author

v4:

  • Fix pedantic error instead of just suppressing it.

Quell false positive GCC 13.1 -Warray-bounds and -Wstringop-overflow
warnings.

The warnings still appear during LTO linking, because GCC does not
carry diagnostic pragmas to the linking stage.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
…tion

When compiling with GCC 13.1 and -Wpedantic, struct sset_info causes
the error "invalid use of structure with flexible array member
[-Werror=pedantic]". The flexible array member in this case is the
data member of struct ethtool_sset_info. In order to reserve space for
it, turn sset_info into a union, and make the next member in the union
the size of struct ethtool_sset_info and the data.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
Also c++ programs need -Wno-error=stringop-overflow flag, in order to
avoid errors during linking, when using LTO.

Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
@odpbuild odpbuild changed the title [PATCH v4] quell GCC 13.1 bound check warnings [PATCH v5] quell GCC 13.1 bound check warnings Dec 21, 2023
@JereLeppanen
Copy link
Collaborator Author

v5:

  • Rebase.
  • Add review tags.

@MatiasElo MatiasElo enabled auto-merge (rebase) December 21, 2023 13:17
@MatiasElo MatiasElo merged commit bcc3a8c into OpenDataPlane:master Dec 21, 2023
171 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.

3 participants