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

ittnotify_static.c is not complaint with -Wundef compile option #157

Open
dzarukin opened this issue Sep 7, 2024 · 3 comments
Open

ittnotify_static.c is not complaint with -Wundef compile option #157

dzarukin opened this issue Sep 7, 2024 · 3 comments

Comments

@dzarukin
Copy link

dzarukin commented Sep 7, 2024

$ gcc -Iinclude -Wundef -c src/ittnotify/ittnotify_static.c -o ittnotify_static.o
src/ittnotify/ittnotify_static.c:65:37: warning: "__INTEL_COMPILER" is not defined, evaluates to 0 [-Wundef]
 #elif HAS_GNU_ATTR(fallthrough) && !__INTEL_COMPILER
                                     ^~~~~~~~~~~~~~~~

The solution:

diff --git a/src/ittnotify/ittnotify_static.c b/src/ittnotify/ittnotify_static.c
index 17c50a5..5e6a0ea 100644
--- a/src/ittnotify/ittnotify_static.c
+++ b/src/ittnotify/ittnotify_static.c
@@ -62,7 +62,7 @@ static const char api_version[] = API_VERSION "\0\n@(#) $Revision$\n";
 #define ITT_ATTRIBUTE_FALLTHROUGH [[gnu::fallthrough]]
 #elif HAS_CPP_ATTR(clang::fallthrough)
 #define ITT_ATTRIBUTE_FALLTHROUGH [[clang::fallthrough]]
-#elif HAS_GNU_ATTR(fallthrough) && !__INTEL_COMPILER
+#elif HAS_GNU_ATTR(fallthrough) && !defined(__INTEL_COMPILER)
 #define ITT_ATTRIBUTE_FALLTHROUGH __attribute__((fallthrough))
 #else
 #define ITT_ATTRIBUTE_FALLTHROUGH
@eparshut
Copy link
Contributor

@dzarukin Thanks for reporting the issue.
Would you like to create a PR for this fix?

@dzarukin
Copy link
Author

@dzarukin Thanks for reporting the issue. Would you like to create a PR for this fix?

Hi @eparshut, I don't mind if the team handles it. But I can try to handle it, too, if you could share the process, please. The repo didn't let me create a branch to open a PR. I haven't try the fork though. Than you.

@eparshut
Copy link
Contributor

@dzarukin Thanks for reporting the issue. Would you like to create a PR for this fix?

Hi @eparshut, I don't mind if the team handles it. But I can try to handle it, too, if you could share the process, please. The repo didn't let me create a branch to open a PR. I haven't try the fork though. Than you.

Looks like we need to add information to the readme on how to contribute to this repository.
Anyone who wants to improve the ittapi project is invited to fork this repository and submit a PR.

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

No branches or pull requests

2 participants