Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5374437ybi; Tue, 4 Jun 2019 05:51:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQv+XHpOBanBBYZgolbibIBhRz4jxN6+geve+SKA16BcYKOPnBgxy7zmTyRxX2m7F03Ccz X-Received: by 2002:a63:5d54:: with SMTP id o20mr33438618pgm.97.1559652677828; Tue, 04 Jun 2019 05:51:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559652677; cv=none; d=google.com; s=arc-20160816; b=fgxaNjphz2+x/PKo55FYEL7RDovCOg7lFcsRXX7eV8Fg5i3NjHEh6t9c6/+zgBZgwX QV4jmMPe59fg7OPdi3zRRhXcjFY3wUjTulmn+wji23bJI8qQy9hgPjkCimZyerorv+i3 ZCL3UBRcULfeg5Yk1pBgV0WNicwCG+dX4MFmroiIrbrTUCgaItClpFDqvyUhquBw9T7h SwaB5rVqkx0bnVxiTGq9tpvoKyBVh14quAGJmcz7nMpAOOBchgUP5MXvdBTE1gjMfR2f nJHVzo1hR0MSSZTCUbS3q7VwnaPDne7V28/Voiiy2oODz4oF8Cx2fVUNsEQY4CJYI73b SZmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=H21/n5ZeA1Sd3QqC5U97OCEIy4trQ6PmVFi/VT4QN+4=; b=i+kY9BkqKnE9s8P6564YuP1jsmydCfRqiEHd/1kkcIaAund0o+hD4y6351zfvfI+DM zj8oHVn89RG2MiK1VuS38BlkgC9256CrBAyZFz9DDhJCKHTk3z9upsRSNz//TcB+1Bjx gb4oX0aGSMoys5a44/4xBWNusN6mLHSrvixM9Nne3xq/uAxzUXDKrYwHD9ZYOoVS5P16 8Y5KUOpIo2QhXfIEavlM8+E4r7P+lCK11j5vW2V9fkljLPtQS9W/yfR9EgFKCfvXH9il XlYRLpeMCSxDF68JX9SPEO1RkfZ+6UcTAWZ1+o9RBBElcD41xDr2PGajc5YGVFn7DV6z Xq9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=HYwodEMu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a190si24667397pfb.122.2019.06.04.05.51.00; Tue, 04 Jun 2019 05:51:17 -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=@nifty.com header.s=dec2015msa header.b=HYwodEMu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727772AbfFDMtB (ORCPT + 99 others); Tue, 4 Jun 2019 08:49:01 -0400 Received: from conssluserg-02.nifty.com ([210.131.2.81]:38774 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbfFDMtB (ORCPT ); Tue, 4 Jun 2019 08:49:01 -0400 Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com [209.85.217.42]) (authenticated) by conssluserg-02.nifty.com with ESMTP id x54CmnVr002530; Tue, 4 Jun 2019 21:48:50 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com x54CmnVr002530 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559652530; bh=H21/n5ZeA1Sd3QqC5U97OCEIy4trQ6PmVFi/VT4QN+4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=HYwodEMul5OlQzmwKhEX6b6C1LVY4TFC427YWZnAh8FpKOLhbGx3nkXMth/GG8vu2 /ge7aM6G/sHybQ+pNIcbuI8FxmcgcwZpYWkWGaYIUJZ5DwYtxgReCPxBybOnfwhUMd 3spDI9xYERz6OQKv8WTZQiXN7llNojzp6+LdN2w2XgwiOIe519QIgyi/IvNIGXNJOO OE84YjAYKvwfo6fEVcNQ33COgUHWK6EsY/UI7PdO9kNSx2E1YlSuqnsGX5kvuzmGzM 1whvXLCXmyCN0NJcZeWukuJEr5LjgNF4jQ1HDzP8BJHPKCmUoCd5Irc+i+8DBEhKbB zBsK14Sf9hL1g== X-Nifty-SrcIP: [209.85.217.42] Received: by mail-vs1-f42.google.com with SMTP id c24so13398068vsp.7; Tue, 04 Jun 2019 05:48:49 -0700 (PDT) X-Gm-Message-State: APjAAAXxL+TITY0bnE3OumKbASPm/GvMWMibydToHEFS6AiEJQjR6O2l nQ9qOQdShazob2DID7T10qqFc0L07V9YcaiWn0o= X-Received: by 2002:a67:b109:: with SMTP id w9mr5031632vsl.155.1559652528996; Tue, 04 Jun 2019 05:48:48 -0700 (PDT) MIME-Version: 1.0 References: <20190604111334.22182-1-yamada.masahiro@socionext.com> <8cf48e20064eabdfe150795365e6ca6f36032e9f.camel@perches.com> In-Reply-To: From: Masahiro Yamada Date: Tue, 4 Jun 2019 21:48:12 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] media: do not use C++ style comments in uapi headers To: Arnd Bergmann Cc: Joe Perches , Linux Media Mailing List , Mauro Carvalho Chehab , Thomas Gleixner , Greg KH , Randy Dunlap , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 4, 2019 at 8:55 PM Arnd Bergmann wrote: > > On Tue, Jun 4, 2019 at 1:23 PM Joe Perches wrote: > > > > On Tue, 2019-06-04 at 20:13 +0900, Masahiro Yamada wrote: > > > On the other hand, uapi headers are written in more strict C, where > > > the C++ comment style is forbidden. > > > > Is this a real problem for any toolchain? > > There is likely some code that is built with -Wpedandic -Werror --std=c89 > or similar. Since glibc allows this combination for its own headers, it seems > best to also allow it in kernel headers that may be included by libc headers > or by applications, at least where it does not hurt. > > Realistically though, we probably assume c99 or gnu89 in user space > headers anyway, since there is no 'long long' in earlier standards. > > Arnd In fact, I detected this issue by the following patch: https://patchwork.kernel.org/patch/10974669/ When I worked on it, I wondered which c-dialect flags should be used. This code: > # Unlike the kernel space, uapi headers are written in more strict C. > # - Forbid C++ style comments > # - Use '__inline', '__asm__' instead of 'inline', 'asm' > # > # -std=c90 (equivalent to -ansi) catches the violation of those. > # We cannot go as far as adding -Wpedantic since it emits too many warnings. > # > # REVISIT: re-consider the proper set of compiler flags for uapi compile-test. > > UAPI_CFLAGS := -std=c90 -Wpedantic -Wall -Werror=implicit-function-declaration Even "-std=c99 -Wpedantic" emits lots of warnings. I noticed one more thing. There are two ways to define fixed-width type. [1] #include , __u8, __u16, __u32, __u64 vs [2] #include , uint8_t, uint16_t, uint32_t, uint64_t Both are used in UAPI headers. IIRC, was standardized by C99. So, we have already relied on C99 in user-space too. -- Best Regards Masahiro Yamada