Re: [PATCH] RDMA/core: Fix a violation of the C standard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2018-07-04 at 08:27 +0300, Leon Romanovsky wrote:
> On Mon, Jul 02, 2018 at 10:28:22AM -0700, Bart Van Assche wrote:
> > This patch avoids that sparse reports the following:
> > 
> > drivers/infiniband/core/uverbs_std_types_cq.c:206:1: error: directive in argument list
> > drivers/infiniband/core/uverbs_std_types_cq.c:209:1: error: directive in argument list
> > 
> > Additionally, this patch also avoids that sparse warns about defined
> > but not used functions with CONFIG_INFINIBAND_EXP_LEGACY_VERBS_NEW_UAPI=n.
> > 
> > Fixes: 185899ee8d00 ("IB/uverbs: Enable ioctl() uAPI by default for new verbs")
> > Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxx>
> > Cc: Matan Barak <matanb@xxxxxxxxxxxx>
> > Cc: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> > ---
> >  drivers/infiniband/core/uverbs_std_types_cq.c | 12 +++++++++---
> >  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> Bart,
> 
> The patch looks good for me.
> Just for my general knowledge, can you point which part of C standard
> the original code violated?

Hello Leon,

>From ISO/IEC 9899:201x Committee Draft (N1570), section "6.10.3.4 Rescanning
and further replacement": "The resulting completely macro-replaced preprocessing
token sequence is not processed as a preprocessing directive even if it resembles
one, but all pragma unary operator expressions within it are then processed as
specified in 6.10.9 below."

See also http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf.

Bart.

��.n��������+%������w��{.n�����{���fk��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux