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

cpuinfo_x86_normalize_brand_string #226

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fbarchard
Copy link
Contributor

Fix cpuinfo_x86_normalize_brand_string unannotated fall-through warning

Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you perhaps provide an example of the config when it raises this warning, as cpuinfo code is explicitly marked as C99 compliant, so CMake selects -Wno-implicit-falltrhough flag to suppress this warning.

But if you are using C23 compiler, please modify this PR to use [[fallthrough]] attribute (guarded with proper ifdefs) to mark this falltrhough as expected

@fbarchard
Copy link
Contributor Author

The issue was reported as XNNPack not building with the -Wimplicit-fallthrough flag
google/XNNPACK#6047
But when I apply the flag in XNNPack build the pytorch/cpuinfo has 2 build warnings.
The first was a legitimate bug and fixed in #225
This one is not a bug, but the other cases are handled the same was as this PR.

XNNPack requires C11 but can work on VS2012 or GCC 4.9.
If this PR is taken, x86 builds cleanly, but for ARM are more, but I didnt spot legitimate bugs, so I wasnt going to do the fallthru directives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants