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

warning unknown attribute 'no_sanitize' in hb.hh with xlc16/xlclang #1852

Closed
MBaesken opened this issue Jul 22, 2019 · 4 comments
Closed

warning unknown attribute 'no_sanitize' in hb.hh with xlc16/xlclang #1852

MBaesken opened this issue Jul 22, 2019 · 4 comments

Comments

@MBaesken
Copy link

When building the currently included harfbuzz in OpenJDK on AIX with the latest xlc16/xlclang compiler, we run into this warning :

In file included from /jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-aat-layout.cc:37:
In file included from /jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-aat-layout-kerx-table.hh:31:
/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-kern.hh:46:3: warning: unknown attribute 'no_sanitize' ignored [-Wunknown-attributes]
HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW
^
/jdk/src/java.desktop/share/native/libfontmanager/harfbuzz/hb.hh:363:63: note: expanded from macro 'HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW'
#define HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW attribute((no_sanitize("signed-integer-overflow")))

Coding : in hb.hh :

#if defined(clang)
/* Disable certain sanitizer errors. /
/
#1247 */
#define HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW attribute((no_sanitize("signed-integer-overflow")))
#else
#define HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW
#endif

I think the “#else” - case of the macro should be used when building with AIX xlc16/xlclang .

@MBaesken
Copy link
Author

MBaesken commented Jul 22, 2019

Small potential patch for the issue

--- a/harfbuzz/hb.hh	Fri Jul 19 12:35:33 2019 +0200
+++ b/harfbuzz/hb.hh	Fri Jul 19 13:19:24 2019 +0200
@@ -357,7 +357,7 @@
 #  define HB_FALLTHROUGH /* FALLTHROUGH */
 #endif
 
-#if defined(__clang__)
+#if defined(__clang__) && !(defined(_AIX) && (defined(__IBMCPP__) || defined(__ibmxl__)))
 /* Disable certain sanitizer errors. */
 /* https://github.com/harfbuzz/harfbuzz/issues/1247 */
 #define HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW __attribute__((no_sanitize("signed-integer-overflow")))

@behdad
Copy link
Member

behdad commented Jul 22, 2019

Thanks. Given that the compiler involved does seem to impersonate clang, and that this is just a warning, any reason we should fix it instead of just ignoring?

@MBaesken
Copy link
Author

Reason is that we want to achieve building the codebase in OpenJDK (including harfbuzz) with "warnings as errors" (we do this already on most other platforms).

@behdad
Copy link
Member

behdad commented Jul 22, 2019

I'm glad to hear that the code compiles almost warning-free. Fixed. Thanks.

@behdad behdad closed this as completed in 89228cc Jul 22, 2019
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