Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp249501rwl; Tue, 11 Apr 2023 17:53:30 -0700 (PDT) X-Google-Smtp-Source: AKy350aYZurjHLJ2kSFfhgQhTBK5/8DTgy4Wh318p3rdcKJdg+a80MtfK8h2q/DHCt+qu+RH+02G X-Received: by 2002:a17:906:f2d5:b0:94e:1764:b0b5 with SMTP id gz21-20020a170906f2d500b0094e1764b0b5mr4189461ejb.69.1681260810659; Tue, 11 Apr 2023 17:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681260810; cv=none; d=google.com; s=arc-20160816; b=NCRc72pPAqv+/PplMrdWEHgFJS4pXbhNfSNjZsO1qr1/mssrlI38xyb3esKiCTPt4P Hpxg6t0gO59GpDPf3xXd/bHWoUJ+QyQRqg4pWwVzI/p76FrWbxKPJAttqZThYFhLgm8z 80CDYTy/6qFtFNcCOh4yW1QH+JPaPn3Gzen5TUJA8tqXo+tZWqkLqh9P1V66lqu7coRb SNJYqSFEXNVURPbe5S7IEEtQCddvrUNjvyRItNfptvF5zSPa7mq8VB9OWtFPZl2NfQk1 zpjJ9hrNssuMPajswB8cxlhPRI2WhHsIo6TIiUgHjav5ck5L4EFsqfRJ2KpkAQat0KmM dYng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=NBXRnTz2pt6vBVIMgjClEpENHcFCEvTGjcTcRVn3YH4=; b=zUtm5V4n/RLdNycKJavKZs4TDpKYvCUuWouW4OC1tliDPKU8q7MSD1kpHXVhWP5OA0 v3ahW0fABZpghDSlGOdJaYTaYNoFRmu9x+iG67EEYWdku6SQEjQxfHF7K5EpQuixFNh7 qgzlfQGiJT7qlerXDU0WVZhDFqmCiv+RFKeAec3KkFRytzyGkpJzyR+P1Gmnx3rDn9+h izxdEh0lHIXrQjwyXflmiujzs7cveRw0ToH3+usQjFGuHI/1vu/6kUMGKQMJbRYeJ2Z6 cHrBJ+Ix07/sSU0PkbEluve/rFpe5yVab4yVLQ7zYwULMlM9MrmRHLxUG1YQ3lEysMep pPZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=uFf8tLrI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l24-20020a17090615d800b008e1cbdcd3d1si225914ejd.97.2023.04.11.17.52.36; Tue, 11 Apr 2023 17:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=uFf8tLrI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbjDLAYM (ORCPT + 99 others); Tue, 11 Apr 2023 20:24:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjDLAYL (ORCPT ); Tue, 11 Apr 2023 20:24:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CA62BC; Tue, 11 Apr 2023 17:24:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A1C9A623FB; Wed, 12 Apr 2023 00:24:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0641C433EF; Wed, 12 Apr 2023 00:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1681259049; bh=nJI8/B7eg9JVcOqRr7nH0nG3Zqh+Z58VIDLD98553HI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=uFf8tLrIjK/gPzPxin8KfK7izbWHwWmbLJcPv+9w8re77Qp3yiVXrtD0cZasJQOEc AwjDUqiU+QjVKO9nI/uJCsD6XB+Bw8yKLPPWQEtfKYJKI+GQu805KFyY+0eMX8uFzB jXTGpmajcgpEh9YND8KhTdBnTy4OZKks3Wft3B5Q= Date: Tue, 11 Apr 2023 17:24:08 -0700 From: Andrew Morton To: Petr Vorel Cc: Kevin Brodsky , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Masahiro Yamada , Sam Ravnborg , Petr Vorel , Ruben Ayrapetyan Subject: Re: [PATCH RESEND] uapi/linux/const.h: Prefer ISO-friendly __typeof__ Message-Id: <20230411172408.46a5b13a6cab27dda0c822b2@linux-foundation.org> In-Reply-To: <20230411213946.GA1803920@pevik> References: <20230411092747.3759032-1-kevin.brodsky@arm.com> <20230411210537.GA1800481@pevik> <20230411213946.GA1803920@pevik> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 Apr 2023 23:39:46 +0200 Petr Vorel wrote: > > Hi Kevin, > > > > typeof is (still) a GNU extension, which means that it cannot be > > > used when building ISO C (e.g. -std=c99). It should therefore be > > > avoided in uapi headers in favour of the ISO-friendly __typeof__. > > > IMHO UAPI are built with -std=c90 -Wall -Werror=implicit-function-declaration > > (see usr/include/Makefile). > > But one or the other, you're right both require __typeof__. > > > "If you are writing a header file that must work when included in ISO C > > programs, write __typeof__ instead of typeof." > > https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Typeof.html > > > Reviewed-by: Petr Vorel > > Tested-by: Petr Vorel > > IMHO problem was introduced when -std=c90 was added (back then the code was in > include/uapi/linux/kernel.h). Well... what actually _is_ the problem? Presumably build issues under some circumstances. Could we please see an instance of those issues and a description of the circumstances under which they occur? > Fixes: d6fc9fcbaa65 ("kbuild: compile-test exported headers to ensure they are self-contained") Might need a cc:stable, depending on the answers to the above.