Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1311370ybg; Fri, 18 Oct 2019 15:41:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqySO29LBFg2AuRiHXGwuiSv9QXpBNMibqkXU5hFRnl5FICZs9RuLnFyY+R/yIclgVIcuOx3 X-Received: by 2002:a17:906:360e:: with SMTP id q14mr10876516ejb.313.1571438512079; Fri, 18 Oct 2019 15:41:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571438512; cv=none; d=google.com; s=arc-20160816; b=GQLeq//3tFKtU1NjsFoCeL4uQT/inzLQgIenOMk5Nt1T1sBz5CX2tyapA3IDBlT5XS EPxDmPnDbkGayhw+HsdhdcJG2Y8bf7Pj+9dvduQRHOsTra8bh3DSENwomw/iBvFLv637 W49wDQIyB/yL113fbNwNj4wREE6zt6dW84vB19RfKj68F43TUSLUjv4xO46M+Ia9vvPB 18ye6CZ+LVM7tfTt6sAHAdWF/x6VqbE1xCrwV2NxJfS0xmjLTKsuN8qfe8H1poLkDAxq HEEc7m9u+hCV3p7l3cGgh/hVAtzGIv+q8omeRMigCpO5knTo/TSealXHgf1Fx2kXDR84 kJzQ== 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=rgI0YB4AiPdp5L4RaTennbKUpcmOoav7alTjyjJ79iU=; b=AawGdEWZ/EnYFM/5AUkR+hLoBehEx1DMJa7kbgapG7fMvUE6RnEg0NRsfWbmEs87qr y1HpBrSb7BZV4okLKJtZhlLpPYxWJL5PYdx/j0F9kfAYK85k4m1A3eTRFIoNw5ZnCemd H6/Lmb8RquU96dEo5Z5+e9TSMhoKEiWu2YN6J3b52lJ8NqcLhof0RX/HoSrgGO+xXdpQ uoXYK7sIpCVh2MzacAKesEL46gmdAUMkERvz+v75eRKE9W85HtOqItgSBldMHNhIyHew B7mxHSQii6GQVDVVJ2+f1eGyasFf8t5RCBsX9K6DFfyuflBO2g89qppA8qQiomWDaOCS uTJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=akYzP0Yn; 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 s9si4374308eju.298.2019.10.18.15.41.29; Fri, 18 Oct 2019 15:41:52 -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=akYzP0Yn; 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 S2391434AbfJRF2o (ORCPT + 99 others); Fri, 18 Oct 2019 01:28:44 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:53972 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731644AbfJRF2n (ORCPT ); Fri, 18 Oct 2019 01:28:43 -0400 Received: by mail-wm1-f68.google.com with SMTP id i16so4738789wmd.3 for ; Thu, 17 Oct 2019 22:28:42 -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=rgI0YB4AiPdp5L4RaTennbKUpcmOoav7alTjyjJ79iU=; b=akYzP0YnEV3LrHKI0x27ywf2tmPVjk5x+F9QSkw4eiudLUi0e5ydkNp+wz57+hk7c/ YhLmWqBjsUx4THeIYoeSis2gBMXbrC4+sfWFUa5epCvTglU2oSR/grY3CGsHHrmLFtxG rwXnSf4SBth6z6DcwFfBDU5jMoiArJ4oo0BSlTFSR98OedCI00w/ZPfqZakpcMuulg4s YiYYda+GqmSJ+eZ1c1u/fZq1OUDVSR8roXl71NpIc8YFVna7+hzir80BlG6zWFsLF53h XXRmAiQzlLjrauOR1nqwwgELHsk1xCnUspABX12unK3nwhYsiKYw/0kBlOHyh0keYwkv BmUA== 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=rgI0YB4AiPdp5L4RaTennbKUpcmOoav7alTjyjJ79iU=; b=q87xPUrTZ1FsEY6Y5Pip/zZlra5WVrm9Yhgc8Uatd2R89AOXiVvpKI4rIgJ5VFoQbO JNr3fbHfn8aR1F3CYPq1zMP/t0GyX14iMMgkMiFzZAISS9jRtrwfRGm2vbnn/mjAGNID Ud/7IPqqQjq4zSab4vr6JgAobrTv4wqwIOmlSNEyEqbC0PnyiNlGbqT4Cf3Z1QSNcQin JryFmRRYNRDTKCTnTG0LISen1cqpnThYcCFpOle8QzpmmHjpIAEpO07F4R08FyOvZG3r DQAXXW49vclnWKO6LjiOmDN03DNvCZ+re5JxC6hSrhKXeIHIuZg8UNMgvCHQQbkzcCFX eV+w== X-Gm-Message-State: APjAAAWvdbM4RRAi7sicKddnbWCDaES8tNFVEE9wrECpUKVSPB6+EbD6 cDAd6K45ouXp4Hb3JpRqOzCZIg1y X-Received: by 2002:a7b:cf0d:: with SMTP id l13mr5601891wmg.47.1571376521764; Thu, 17 Oct 2019 22:28:41 -0700 (PDT) Received: from ltop.local ([2a02:a03f:40ac:ce00:f882:d2a3:f943:89a4]) by smtp.gmail.com with ESMTPSA id o9sm4346618wrh.46.2019.10.17.22.28.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Oct 2019 22:28:41 -0700 (PDT) Date: Fri, 18 Oct 2019 07:28:40 +0200 From: Luc Van Oostenryck To: Paul Walmsley Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/8] riscv: init: merge split string literals in preprocessor directive Message-ID: <20191018052839.efpqhxkqsjoqtdks@ltop.local> References: <20191018004929.3445-1-paul.walmsley@sifive.com> <20191018004929.3445-4-paul.walmsley@sifive.com> <20191018040237.3eyrfrty72r63pkz@ltop.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 17, 2019 at 09:38:18PM -0700, Paul Walmsley wrote: > On Fri, 18 Oct 2019, Luc Van Oostenryck wrote: > > > On Thu, Oct 17, 2019 at 05:49:24PM -0700, Paul Walmsley wrote: > > > sparse complains loudly when string literals associated with > > > preprocessor directives are split into multiple, separately quoted > > > strings across different lines: > > > > ... > > > > > #ifndef __riscv_cmodel_medany > > > -#error "setup_vm() is called from head.S before relocate so it should " > > > - "not use absolute addressing." > > > +#error "setup_vm() is called from head.S before relocate so it should not use absolute addressing." > > > #endif > > > > Using a blacslash should do the trick : > > #error "blablablablablablablablablablablabla" \ > > "and blablabla again" > > Or if need I cn fix Sparse if needed and desiable. > > Thanks for the kind offer! > > The backslashless syntax is pretty horrible to my eyes. As far as I can > tell from a brief glance, the instance fixed by this patch was the only > instance of its kind in the kernel. The existing kernel precedents appear > to be to simply use a single long line. Example: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/compiler-gcc.h#n3 > > So, from a kernel point of view, we should just fix this specific > instance. It doesn't seem worth changing sparse for such a rare case. > > On the other hand, gcc seems to support the non-backslashed syntax. So if > the intention is for sparse to follow the gcc practice, and to be used > beyond the kernel, maybe it's worth aligning sparse to gcc? Only if > you're bored, I suppose... I'll first see what is acceptable for the point of view of the standard (and maybe some justifications from GCC). -- Luc