Skip to content

src: ittnotify: ittnotify_static: resolve Wundef hits#176

Merged
eparshut merged 2 commits into
intel:masterfrom
dzarukin:dzarukin/resolve_wundef_hits
Apr 29, 2025
Merged

src: ittnotify: ittnotify_static: resolve Wundef hits#176
eparshut merged 2 commits into
intel:masterfrom
dzarukin:dzarukin/resolve_wundef_hits

Conversation

@dzarukin
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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