-- v2: include: Use GCC-style attributes and builtins on Clang MSVC target.
From: Jacek Caban jacek@codeweavers.com
--- include/private/vkd3d_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h index 619665ad3..5557df41a 100644 --- a/include/private/vkd3d_common.h +++ b/include/private/vkd3d_common.h @@ -75,7 +75,7 @@ static inline size_t align(size_t addr, size_t alignment) return (addr + (alignment - 1)) & ~(alignment - 1); }
-#ifdef __GNUC__ +#if defined(__GNUC__) || defined(__clang__) # define VKD3D_NORETURN __attribute__((noreturn)) # ifdef __MINGW_PRINTF_FORMAT # define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(__MINGW_PRINTF_FORMAT, fmt, args)))
On Fri Nov 17 16:53:13 2023 +0000, Jacek Caban wrote:
changed this line in [version 2 of the diff](/wine/vkd3d/-/merge_requests/484/diffs?diff_id=84234&start_sha=2cc485a089a672efac12839ad95e12900d4ed6e1#269229ea42d057f22ac2025fc6e991e1b106802a_78_78)
Oh, right - I failed to set that your original version didn’t set any format attributes in clang/msvc builds, while my suggestion does. How could I overlook that? I guess I didn’t consider that you intentionally wanted to omit the argument from a configuration where it could be supported. Anyway, avoiding such unnecessary warnings probably is good in any case.
On Fri Nov 17 16:55:50 2023 +0000, Martin Storsjö wrote:
Oh, right - I failed to set that your original version didn’t set any format attributes in clang/msvc builds, while my suggestion does. How could I overlook that? I guess I didn’t consider that you intentionally wanted to omit the argument from a configuration where it could be supported. Anyway, avoiding such unnecessary warnings probably is good in any case.
Yes, fixing it in standalone vkd3d would be nice as well. I'm not sure which solution would be preferred, vkd3d already uses macros like `PRIx64`, so I their usage could be extended. An easy solution would be disabling those warnings in condigure or skipping format attribute on PE targets in the header and depending on Unix builds to validate formats. Anyway, it's a separated issue, this MR just brings msvc target on pair with mingw.
This merge request was approved by Giovanni Mascellani.
On Fri Nov 17 17:45:23 2023 +0000, Jacek Caban wrote:
Yes, fixing it in standalone vkd3d would be nice as well. I'm not sure which solution would be preferred, vkd3d already uses macros like `PRIx64`, so I their usage could be extended. An easy solution would be disabling those warnings in condigure or skipping format attribute on PE targets in the header and depending on Unix builds to validate formats. Anyway, it's a separated issue, this MR just brings msvc target on pair with mingw.
Agreed that it would be nice to fix the `-Wformat` warnings. In the CI we explicitly disable them for the moment.
This merge request was approved by Henri Verbeet.