Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1998368ybb; Fri, 29 Mar 2019 16:13:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyJs12SlZiZPBRuTmURx8O+vbHhD2YM7c7cs+5mxMNa0Bv23ll6NdqeHNav4k5Yy1clkob X-Received: by 2002:a62:458a:: with SMTP id n10mr50902849pfi.136.1553901210778; Fri, 29 Mar 2019 16:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553901210; cv=none; d=google.com; s=arc-20160816; b=GMOhA+vs57av3jVc/1p6ZcWny0JEHnxTuz/j/pDY+QBTB+2RzU1WcREjcDng4BapXQ MWuVA0SFszYjVtein6kdZx4OG+gfNqd+ZeH/AUhW/qSmjP7jtxAa+UuVcDbp2IvCBi0z Mp2rzPucQqmgb1S0ZtexGoYTyIo6ivcAxEYpbnoNpy8qBAOTEMvmbhuA4DJOxRvfrwpx as7jXcIhhQx7a+kSsklOCdIfi+pOTDiSxr+xBrFfY0AwNpQpCqR62r8R8NCVU9M78BYi Zh1YOXyDJoLLP2Zxcp25ddpxn7XL0eDobcGoCw9VBBvv0nI591hTvjKBOg+g5Y3+j6Fo Qv4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fDyGpF/9Mj1E7uZBT7JAO2NyCtHEAfKnCS3IefcEly8=; b=B78ah1UrrP0Fczv+MS/Hqf2Rnlo4V0DGLHeeC+Ef/i9uSDudT8aOwr8+NQH56ZvOx9 gW7nv4WobqXLX9V1cZ8N5QeMRld9B6R3wke6fZbAwDy0PngBLu8unr7KM0EaLJ+OFFnn fn76x3GLBxAUQQIcDidv9IvRyMdbjzDwBe8Fa0+gKHBX9w2deIlRemxBznIB8pwq76gz C3SLyurrDWOafZhXXq5nPgb0bMfOF98HDM5t8/VhMOUr+dWnqDsCMxd64dN3OLCGYeuM oqOErSDjT0yV320YykPCIDgKHOvQdVSOqTZLsS9vQ6pUeYInrHoiQAQ5SHJND34jjne9 fSMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FAzDjCxa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 59si2991664plp.100.2019.03.29.16.13.14; Fri, 29 Mar 2019 16:13:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FAzDjCxa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730035AbfC2XMh (ORCPT + 99 others); Fri, 29 Mar 2019 19:12:37 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:34292 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729919AbfC2XMg (ORCPT ); Fri, 29 Mar 2019 19:12:36 -0400 Received: by mail-ed1-f68.google.com with SMTP id x14so3426334eds.1; Fri, 29 Mar 2019 16:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fDyGpF/9Mj1E7uZBT7JAO2NyCtHEAfKnCS3IefcEly8=; b=FAzDjCxaxIvppDyOiUwcp6iYGSpET0iW7UPERR2Ro9RfL5FWkzTbM5gJcV3yuOtUWw iOtkPkFCqrKMrcxHKp+D3pRzAjsNEP1Fm0Y0Hs2XBe9DymgXEGQZRrsObj6ZGZe2N+jh i3p2dWZFhyFxm/siAKrxR/nTE03jU+onpHiP/1kmwoNR+arbpz/iX9qY3sqGkR9hQnvV bwamUlW+jzdkRFVsVGk/c1OjnNlX1ZnByhTAsqQ4Dr2qQzn6XcvTI9uHW2blbClUCQMT 9cd+3qn9BsuYRS4K5+qLldaJzr6ZeHCqIIayJD0LTm9P226uIZKgNMWY0/yNoU2DRLNI sEWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fDyGpF/9Mj1E7uZBT7JAO2NyCtHEAfKnCS3IefcEly8=; b=cm1QgYwbBuRdBfVIJ8jdbt9gvSMKOlntDo3mZ+dPFwftXlFJYJxx3lNPjBQ3a49EP8 kM1dkIu2fWUCxJ37TlzSJtR3sYsKLRbqUkYykeIKFsjlexajVi7DoZysuDsZFaLr5xzE W62vovEfmNB783kB4MNckn2HZ9z9Pjcdn9Suqqoz5xOHtgmnRP/RttcPQXDJ2slyo4QW Zl3nCKdrflIkc5O6OdsxgWmIzibRUdItjJwN/nSaF0a6a48bx0oD/p9tSR5EVQLco8Sc 35qL8ZI237YxroryGRWcJ8P6r46y3iqylXlEpg0Ck1Nk/tvUm65V2wrU8mcfO8oobc2D zviQ== X-Gm-Message-State: APjAAAVQK+MENhAGZGht3nm1+o3b4AdD11NAvNpEAr7Vla88kb390pml ovBBBcIJSgcnfsJEw5Ax9b35xNeT X-Received: by 2002:a17:906:5014:: with SMTP id s20mr28981200ejj.174.1553901154926; Fri, 29 Mar 2019 16:12:34 -0700 (PDT) Received: from ltop.local ([2a02:a03f:4079:2f00:a405:18aa:2541:8cdc]) by smtp.gmail.com with ESMTPSA id f5sm998586ede.94.2019.03.29.16.12.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Mar 2019 16:12:33 -0700 (PDT) Date: Sat, 30 Mar 2019 00:12:32 +0100 From: Luc Van Oostenryck To: Steven Rostedt Cc: Hariprasad Kelam , mingo@redhat.com, roopa@cumulusnetworks.com, davem@davemloft.net, linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org Subject: Re: [PATCH] trace: events: fix error directive in argument list Message-ID: <20190329231231.suwcypwnyunvysyd@ltop.local> References: <20190325195303.GA20629@hari-Inspiron-1545> <20190327115330.04b5b481@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190327115330.04b5b481@gandalf.local.home> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 27, 2019 at 11:53:30AM -0400, Steven Rostedt wrote: > On Tue, 26 Mar 2019 01:23:03 +0530 > Hariprasad Kelam wrote: > > > This patch fixes below spare errors. > > > > Sparse error: > > make C=2 CF=-D__CHECK_ENDIAN__ M=net/core > > ./include/trace/events/neigh.h:73:1: error: directive in argument list > > ./include/trace/events/neigh.h:78:1: error: directive in argument list > > ./include/trace/events/neigh.h:150:1: error: directive in argument list > > ./include/trace/events/neigh.h:155:1: error: directive in argument list > > > > I have nothing really against these patches, but why is the current > code considered wrong? > > Note, TRACE_EVENTS() are "special macros". They hold structure > definitions and full code inside the argument list. There should be no > reason that this is causing a warning. The problem is that #ifdefs at line 73 & 150 are inside TRACE_EVENT()'s invocation and this is undefined behaviour. From the standard: ... If there are sequences of preprocessing tokens within the list of arguments that would otherwise act as preprocessing directives, the behavior is undefined. [C90 6.8.3, C99 & C11 6.10.3p11] GCC can handle it (and sparse too) but yes sparse complains about it. -- Luc Van Oostenryck