All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH next] wifi: iwlwifi: Avoid disabling GCC specific flag with clang
@ 2023-03-16  3:28 Nathan Chancellor
  2023-03-16  7:52 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2023-03-16  3:28 UTC (permalink / raw)
  To: johannes.berg, gregory.greenman
  Cc: kvalo, nathan, ndesaulniers, trix, linux-wireless, netdev,
	linux-kernel, llvm, patches

Clang errors:

  drivers/net/wireless/intel/iwlwifi/iwl-devtrace.c:15:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
  #pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
                                 ^
  1 error generated.

The warning being disabled by this pragma is GCC specific. Guard its use
with CONFIG_CC_IS_GCC so that it is not used with clang to clear up the
error.

Fixes: 4eca8cbf7ba8 ("wifi: iwlwifi: suppress printf warnings in tracing")
Link: https://github.com/ClangBuiltLinux/linux/issues/1818
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/net/wireless/intel/iwlwifi/iwl-devtrace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.c b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.c
index c190ec5effa1..e46639b097f4 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-devtrace.c
@@ -12,7 +12,9 @@
 #include "iwl-trans.h"
 
 #define CREATE_TRACE_POINTS
+#ifdef CONFIG_CC_IS_GCC
 #pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
+#endif
 #include "iwl-devtrace.h"
 
 EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ucode_event);

---
base-commit: 4eca8cbf7ba83c3291b5841905ce64584036b1ff
change-id: 20230315-iwlwifi-fix-pragma-bb4630518e88

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH next] wifi: iwlwifi: Avoid disabling GCC specific flag with clang
  2023-03-16  3:28 [PATCH next] wifi: iwlwifi: Avoid disabling GCC specific flag with clang Nathan Chancellor
@ 2023-03-16  7:52 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2023-03-16  7:52 UTC (permalink / raw)
  To: Nathan Chancellor, gregory.greenman
  Cc: kvalo, ndesaulniers, trix, linux-wireless, netdev, linux-kernel,
	llvm, patches

On Wed, 2023-03-15 at 20:28 -0700, Nathan Chancellor wrote:
> Clang errors:
> 
>   drivers/net/wireless/intel/iwlwifi/iwl-devtrace.c:15:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
>   #pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
>                                  ^
>   1 error generated.

Oops.

> The warning being disabled by this pragma is GCC specific. Guard its use
> with CONFIG_CC_IS_GCC so that it is not used with clang to clear up the
> error.
> 

Thanks.

johannes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-16  8:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16  3:28 [PATCH next] wifi: iwlwifi: Avoid disabling GCC specific flag with clang Nathan Chancellor
2023-03-16  7:52 ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.