Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2870497pxb; Sun, 28 Feb 2021 16:45:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKehxM7bBQRJPCjqsZr2OB4U3pi1bU/v9JyY9GEhaHZMuV0zDCBUxPX0Flt6i82SeZFalT X-Received: by 2002:a17:906:39a:: with SMTP id b26mr5273810eja.158.1614559510892; Sun, 28 Feb 2021 16:45:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614559510; cv=none; d=google.com; s=arc-20160816; b=BiIk//1Plbg+6z2D2iDN7qfgWK0/Bxe/FEo6UtvDOzeX8FnW5u/qGquwztRnYM4I79 ZXGU69Aju4y+Pcpq0M605mcdvsF/0FQN4afGs6FkRB0NMD0+6Uit/K1wKCUrIdNKlNRB XeKHHF2iaoH8IU1TBfRZvIV2d7fKudC8R4PJCzQlAaF0QiUfCzQNb7Z3KtYlljw2lAjp UGjirIrL3QhCwJCcyRvQUB33c8FZ9kqJZqaAVUqytYWma14Rd4OnpEAlJeoUJopIBWM0 NhbkdBdUkgP2AE7umlExmA6wxTde6fviKOOzku7YTpudS04kgSYSNbA/jBF1OUwWa+xN XFVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hYl5yZ67XPPXJBjZ3ChyGvfn2enthXOBJf/j62FmLk8=; b=s9dMfoXJmtp3b5jXpxq8fOPH/KD2GwNvYpf4aVZj8NXGKhpwlUgwHIVEvrB/Lbzjoh j+pb5MReHq8kHY6PFB8DvKyHeQHO/fztzlQcjgcog7l2Bhpe7yAiBObGUOIyxZSglMck BSEE7yBWNXYXsoDjRHMatFrwS1hhagJBqQzXlDS1FrIkQ7ka5e6peFSo8CxMw6hArlSB 9rbDe2f4r35masiC6b4uvMpWMvUqpwJ5jE4YK0TPa4r18IAVwSk9vv9N24p+xDmnhkIx 98gMmTY0B/CjznatEUR6A47zC+YmdY9PSq4qnFiGNK4z7q7UAFHaBeduoLPcrTNau2qH Bjsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hgrq06bx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id f7si10458098eja.553.2021.02.28.16.44.48; Sun, 28 Feb 2021 16:45:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hgrq06bx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231264AbhCAAag (ORCPT + 99 others); Sun, 28 Feb 2021 19:30:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230214AbhCAAaf (ORCPT ); Sun, 28 Feb 2021 19:30:35 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28186C061756; Sun, 28 Feb 2021 16:29:55 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id w9so2352145edt.13; Sun, 28 Feb 2021 16:29:55 -0800 (PST) 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; bh=hYl5yZ67XPPXJBjZ3ChyGvfn2enthXOBJf/j62FmLk8=; b=hgrq06bxM7WCL+R5T3iRLyNUPmd9T6fFk2Th5JaKyIuNaXEQJGJ340aoJOuJ9Ozgb6 DVuAmiBma43jiRsHOvwF6MNYmGTSNB5nwkPZ5JH9p0EOx8uDcdaEZ3vJEW6P0s22rovi df8ZNfiN/ATdsY/jcHKRTCouJVi0oeqKQj/qcKfnCGJYx0cDczwFxtBHXwJdl9l8pTvT SdPwo5VRJ1jsGj7F9pX/5X+bRi7tezdwig1Q1SJriVUih3JdxURxVsZqwVgxGCxAjfq/ OqC8Vrptf26sptdg3LgzX1eLVwN5oc1gXfZ/KvkvDxxaZ+yyOEIwscmtbuY/DdK8x9Be O+cA== 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; bh=hYl5yZ67XPPXJBjZ3ChyGvfn2enthXOBJf/j62FmLk8=; b=tFe/0FCakhy0g/B/QafLEBGsWdesRPjYOHsC75tDoR/grUu7RDAlbQgQrpU3wg2SZg 2UVePiBb0q3fx7eqe0Va2h0wu5sNaFm4SJmx3IRl3bXMPS9w7CtmPPSGxyFgTyBL7k4S iZYPsMfrecv4/DNS1+0FUU+0x9WpShhDmFAPyzvQkvMdDksNo5mfG1/3T1NTVAy7eAOI +HFEX3402xTZJk8IWgqSOLZl1HZK3COCxhnOM0UaxLvmAXMjR74OnXUku8X87mGPT5KR 6Xv7k46AP/TwCgh760mH9eKqO47oGdYK9/QrorCxMQcnz5GnT5PcGTr6coMCQ1PHh6wk Hhzg== X-Gm-Message-State: AOAM533fC6au3R85EaaqBrQ/SpdSqj2M2u4XFODBzKYDGPTx/1DhYscm Y/FFCRZyxEUTQDGOIsSk+P8= X-Received: by 2002:a05:6402:946:: with SMTP id h6mr14356827edz.188.1614558593957; Sun, 28 Feb 2021 16:29:53 -0800 (PST) Received: from mail ([2a02:a03f:b7fe:f700:a098:f2e1:a530:fb8]) by smtp.gmail.com with ESMTPSA id z13sm12905687edc.73.2021.02.28.16.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Feb 2021 16:29:53 -0800 (PST) Date: Mon, 1 Mar 2021 01:29:52 +0100 From: Luc Van Oostenryck To: Alexey Dobriyan Cc: Linus Torvalds , Linux Kernel Mailing List , Andrew Morton , Sparse Mailing-list Subject: Re: [PATCH 00/11] pragma once: treewide conversion Message-ID: <20210301002952.hdn5fngwfeo5nhce@mail> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 28, 2021 at 10:34:46PM +0300, Alexey Dobriyan wrote: > > gcc does > > open "/" + "whatever between quotes" > fstat > > so that "1.h" and "./1.h" differ When I try the following with GCC 10.2: $ cat header.h #pragma once #include "./header.h" .. plenty of stuff .. $ strace -f gcc -E header.h I see that the file is opened 4 times (3 times with the name "header.h" and once with "./header.h"). Each of these open is followed by a fstat(). More annoyingly, the file is also read 4 times (3 times entirely and once only the fist 4096 bytes). When the equivalent is done with an include guard instead, the file is only read twice (once with each names) and read twice (entirely). -- Luc