Skip to content

src: ittnotify: ittnotify_static: resolve Wundef hits #176

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

Merged
merged 2 commits into from
Apr 29, 2025

Conversation

dzarukin
Copy link
Contributor

Some projects that include oneDNN use -Wundef compilation flag. oneDNN decided to add the flag into the build as well and it automatically promoted to third_party dependencies including ittnotify.

Macros that may not be defined must be checked for presence first.

@eparshut
Copy link
Contributor

@dzarukin, Thanks for your contribution!

After adding the -Wundef flag I see 3 hits:

Building C object CMakeFiles/ittnotify.dir/src/ittnotify/ittnotify_static.c.o
/localdisk3/eparshut/temp/wundef_ittapi/src/ittnotify/ittnotify_static.c:59:64: warning: "__cplusplus" is not defined, evaluates to 0 [-Wundef]
   59 | #if (HAS_CPP_ATTR(fallthrough) || HAS_C_ATTR(fallthrough)) && (__cplusplus >= 201703L || _MSVC_LANG >= 201703L)
      |                                                                ^~~~~~~~~~~
/localdisk3/eparshut/temp/wundef_ittapi/src/ittnotify/ittnotify_static.c:59:90: warning: "_MSVC_LANG" is not defined, evaluates to 0 [-Wundef]
   59 | #if (HAS_CPP_ATTR(fallthrough) || HAS_C_ATTR(fallthrough)) && (__cplusplus >= 201703L || _MSVC_LANG >= 201703L)
      |                                                                                          ^~~~~~~~~~
/localdisk3/eparshut/temp/wundef_ittapi/src/ittnotify/ittnotify_static.c:66:37: warning: "__INTEL_COMPILER" is not defined, evaluates to 0 [-Wundef]
   66 | #elif HAS_GNU_ATTR(fallthrough) && !__INTEL_COMPILER
      |                                     ^~~~~~~~~~~~~~~~

So I suggest also resolve the 3rd Wundef hit for __INTEL_COMPILER marco in my commit

@eparshut eparshut merged commit d505e4b into intel:master Apr 29, 2025
16 checks passed
@dzarukin
Copy link
Contributor Author

Thank you for the rapid support and taking care of the last hit. It seemed to me it was addressed but looks like I missed it.

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.

2 participants