Re: [PATCH v5 02/11] qla2xxx: Suppress two recently introduced compiler warnings

1 view
Skip to first unread message

kbuild test robot

unread,
May 7, 2020, 3:18:11 PM5/7/20
to Bart Van Assche, Martin K . Petersen, James E . J . Bottomley, kbuil...@lists.01.org, clang-bu...@googlegroups.com, linux...@vger.kernel.org, Bart Van Assche, Daniel Wagner, Himanshu Madhani, Hannes Reinecke, Rajan Shanmugavelu, Joe Jin, Nilesh Javali, Quinn Tran
Hi Bart,

I love your patch! Yet something to improve:

[auto build test ERROR on scsi/for-next]
[also build test ERROR on mkp-scsi/for-next tip/perf/core v5.7-rc4 next-20200507]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Bart-Van-Assche/Fix-qla2xxx-endianness-annotations/20200507-135245
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 54b35c066417d4856e9d53313f7e98b354274584)
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <l...@intel.com>

All errors (new ones prefixed by >>):

In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
^
In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
In file included from include/trace/events/qla.h:44:
In file included from include/trace/define_trace.h:95:
>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
^
In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
In file included from include/trace/events/qla.h:44:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:155:
>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
^
In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
In file included from include/trace/events/qla.h:44:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:222:
>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
^
In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
In file included from include/trace/events/qla.h:44:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:402:
>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
^
In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
In file included from include/trace/events/qla.h:44:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:453:
>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
^
In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
In file included from include/trace/events/qla.h:44:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:533:
>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
^
In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
In file included from include/trace/events/qla.h:44:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:727:
>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
^
In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
In file included from include/trace/events/qla.h:44:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:792:
>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
^
In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
In file included from include/trace/events/qla.h:44:
In file included from include/trace/define_trace.h:103:
In file included from include/trace/perf.h:90:
>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
^
In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
In file included from include/trace/events/qla.h:44:
In file included from include/trace/define_trace.h:104:
In file included from include/trace/bpf_probe.h:114:
>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
^
11 errors generated.

vim +13 include/trace/events/qla.h

11
12 #pragma GCC diagnostic push
> 13 #pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
14

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuil...@lists.01.org
.config.gz

Nick Desaulniers

unread,
May 7, 2020, 6:00:34 PM5/7/20
to kbuild test robot, Bart Van Assche, Martin K . Petersen, James E . J . Bottomley, kbuil...@lists.01.org, clang-built-linux, linux...@vger.kernel.org, Daniel Wagner, Himanshu Madhani, Hannes Reinecke, Rajan Shanmugavelu, Joe Jin, Nilesh Javali, Quinn Tran, Arnd Bergmann
Hi Bart,
These compiler specific pragma's are not toolchain portable. You'll
need to wrap them in:
#ifndef __clang__
preprocessor macros, or I think we have a pragma helper in tree that
helps with compiler specific pragmas. IIRC it uses _Pragma to define
pragmas in macros.
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-li...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/202005080353.y49Uwj18%25lkp%40intel.com.



--
Thanks,
~Nick Desaulniers

Bart Van Assche

unread,
May 7, 2020, 7:16:35 PM5/7/20
to Nick Desaulniers, kbuild test robot, Martin K . Petersen, James E . J . Bottomley, kbuil...@lists.01.org, clang-built-linux, linux...@vger.kernel.org, Daniel Wagner, Himanshu Madhani, Hannes Reinecke, Rajan Shanmugavelu, Joe Jin, Nilesh Javali, Quinn Tran, Arnd Bergmann
On 2020-05-07 15:00, Nick Desaulniers wrote:
> On Thu, May 7, 2020 at 12:18 PM kbuild test robot <l...@intel.com> wrote:
>> All errors (new ones prefixed by >>):
>>
>> In file included from drivers/scsi/qla2xxx/qla_dbg.c:77:
>>>> include/trace/events/qla.h:13:32: error: unknown warning group '-Wsuggest-attribute=format', ignored [-Werror,-Wunknown-warning-option]
>> #pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
>> ^
>
> Hi Bart,
> These compiler specific pragma's are not toolchain portable. You'll
> need to wrap them in:
> #ifndef __clang__
> preprocessor macros, or I think we have a pragma helper in tree that
> helps with compiler specific pragmas. IIRC it uses _Pragma to define
> pragmas in macros.
Hi Nick,

Thanks for the feedback. I will have a look at _Pragma() and see what
the best way is to suppress this warning.

Bart.

Arnd Bergmann

unread,
May 8, 2020, 5:25:24 PM5/8/20
to Bart Van Assche, Nick Desaulniers, kbuild test robot, Martin K . Petersen, James E . J . Bottomley, kbuil...@lists.01.org, clang-built-linux, linux-scsi, Daniel Wagner, Himanshu Madhani, Hannes Reinecke, Rajan Shanmugavelu, Joe Jin, Nilesh Javali, Quinn Tran
The __diag_ignore() macro in linux/compiler.h should work for this.

Arnd

Bart Van Assche

unread,
May 8, 2020, 6:29:41 PM5/8/20
to Arnd Bergmann, Nick Desaulniers, kbuild test robot, Martin K . Petersen, James E . J . Bottomley, kbuil...@lists.01.org, clang-built-linux, linux-scsi, Daniel Wagner, Himanshu Madhani, Hannes Reinecke, Rajan Shanmugavelu, Joe Jin, Nilesh Javali, Quinn Tran
Thanks Arnd, that's good to know. Is using __diag_ignore() mandatory in
this case? The following construct seems to work fine with both gcc and
clang:

#define QLA_MSG_MAX 256

+#pragma GCC diagnostic push
+#ifndef __clang__
+#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
+#endif
+
DECLARE_EVENT_CLASS(qla_log_event,
TP_PROTO(const char *buf,
struct va_format *vaf),
@@ -27,6 +32,8 @@ DECLARE_EVENT_CLASS(qla_log_event,
TP_printk("%s %s", __get_str(buf), __get_str(msg))
);

+#pragma GCC diagnostic pop
+
DEFINE_EVENT(qla_log_event, ql_dbg_log,
TP_PROTO(const char *buf, struct va_format *vaf),
TP_ARGS(buf, vaf)

Bart.

Arnd Bergmann

unread,
May 9, 2020, 4:00:18 AM5/9/20
to Bart Van Assche, Nick Desaulniers, kbuild test robot, Martin K . Petersen, James E . J . Bottomley, kbuil...@lists.01.org, clang-built-linux, linux-scsi, Daniel Wagner, Himanshu Madhani, Hannes Reinecke, Rajan Shanmugavelu, Joe Jin, Nilesh Javali, Quinn Tran
On Sat, May 9, 2020 at 12:29 AM Bart Van Assche <bvana...@acm.org> wrote:
>
> >> Thanks for the feedback. I will have a look at _Pragma() and see what
> >> the best way is to suppress this warning.
> >
> > The __diag_ignore() macro in linux/compiler.h should work for this.
>
> Thanks Arnd, that's good to know. Is using __diag_ignore() mandatory in
> this case? The following construct seems to work fine with both gcc and
> clang:
>
> #define QLA_MSG_MAX 256
>
> +#pragma GCC diagnostic push
> +#ifndef __clang__
> +#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
> +#endif
> +
> DECLARE_EVENT_CLASS(qla_log_event,
> TP_PROTO(const char *buf,
> struct va_format *vaf),
> @@ -27,6 +32,8 @@ DECLARE_EVENT_CLASS(qla_log_event,
> TP_printk("%s %s", __get_str(buf), __get_str(msg))
> );
>
> +#pragma GCC diagnostic pop
> +
> DEFINE_EVENT(qla_log_event, ql_dbg_log,
> TP_PROTO(const char *buf, struct va_format *vaf),
> TP_ARGS(buf, vaf)

__diag_push(), __diag_ignore(), and __diag_pop() are just
shortcuts for open-coded #pragma plus #ifdef, they do
exactly the same thing here. I think it would be best to be
consistent and use the macros, but it works either way.

I actually have patches to introduce yet another syntax as part
of a larger rework, but that is still WiP.

Arnd
Reply all
Reply to author
Forward
0 new messages