220 29275 <nuqlkr$sg7$1@blaine.gmane.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: pragma once
Date: Wed, 26 Oct 2016 12:29:18 -0400
Lines: 98
Approved: news@gmane.org
Message-ID: <nuqlkr$sg7$1@blaine.gmane.org>
References: <CAGz9X0c=CNLVEGgJ7=GJ2W+7fsvN7h+tbiFyf5Cx3aab0Xb=rQ@mail.gmail.com>
 <ca5a8fe4-6a28-4552-89e8-35d2a8a9980d@isocpp.org>
 <5810C33B.9060503@gmail.com>
 <2908d573-f002-4b58-b0da-18420a816c16@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: blaine.gmane.org 1477920888 7742 195.159.176.226 (31 Oct 2016 13:34:48 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 31 Oct 2016 13:34:48 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.1.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC37LBFWUIFBBWEQ3XAAKGQEE4R6IAI@isocpp.org Mon Oct 31 14:34:41 2016
Return-path: <std-proposals+bncBC37LBFWUIFBBWEQ3XAAKGQEE4R6IAI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f197.google.com ([209.85.220.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC37LBFWUIFBBWEQ3XAAKGQEE4R6IAI@isocpp.org>)
	id 1c1Cj8-0006wD-Cr
	for gclcip-std-proposals@m.gmane.org; Mon, 31 Oct 2016 14:34:14 +0100
Original-Received: by mail-qk0-f197.google.com with SMTP id k201sf13814728qke.6
        for <gclcip-std-proposals@m.gmane.org>; Mon, 31 Oct 2016 06:34:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=to:from:subject:date:lines:message-id:references:mime-version
         :user-agent:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=B0BzBmTFl4WruWk6ddKSDK6MvD26qcAI1mh7hCv8ULE=;
        b=fMlqPKQK9oU2OrY4mdrtAWXxrBuH8akxhcNGanc8X77nUN7t9Q9xzUxmk0XfT6fU1b
         ShupPvRy19KDMG+KZIMAlg/CdFnDCy4YqAmUjqtYwlrLdW4AArLb+Fy10PRhFpZDWdo6
         VQbsxTNUyGxjstr8Ut4unxW3H2xXcDNftT3P75QXKy/q2WSJJ2Qi8NyqVRy0jEgpyKcq
         NkAtOq76fGEhQ0mkqARZYOsIAI+Nxm0kJ9Pym04zZ9H9cLZXyeJrksQFziIKYMA0K1yO
         9M+ulpnc62ZzC6l79GpByA6yX+bJoi8GYs75YAKOH31AtFe3Po5grXRE9Cb0Iv0rai2j
         Pw9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:user-agent:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=B0BzBmTFl4WruWk6ddKSDK6MvD26qcAI1mh7hCv8ULE=;
        b=IGCjRGEXSLfr9oU6ugUbZhjuM/FsQbyhP6Zv25VkImP9rTmeUT3zeBpr4aRkoWFlI2
         jUvwPEPlm/Bx5uZZPG0B5n4a/9Jh1bsUQ2H5aEyNSxDXVTn5KuE1MXe95G5jdjqwQeZI
         eJoNv57BjtDGl+pg8j2pAaldqYYzXBdbPqjjn8mmtJ00jewoulez6/Y8uZoNhYxLmrx9
         XGlzKnagXFjLEmk8PfvkWLv+8RwrbQoW8YNh0wjyvjV7mYyXNrX8vN2a86P+DqmN4ptY
         vFOajOd+Va34q5uuL1EZalzJdx+AJsdN+l0JJsuE/55JG0r9mellV6+xcnFMM5L9Pqp0
         aiTg==
X-Gm-Message-State: ABUngveIssLfC5qZBDBTbqmF5T0ngVDfOPChwd9Uo29WGErToypQiMKF9WZn4QBCOeNIMw==
X-Received: by 10.200.34.244 with SMTP id g49mr5317654qta.89.1477920857035;
        Mon, 31 Oct 2016 06:34:17 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.61.97 with SMTP id a88ls4411851otc.41.gmail; Mon, 31 Oct
 2016 06:34:16 -0700 (PDT)
X-Received: by 10.157.54.101 with SMTP id w92mr10204464otb.52.1477920856601;
        Mon, 31 Oct 2016 06:34:16 -0700 (PDT)
Original-Received: by 10.55.167.151 with SMTP id q145msqke;
        Wed, 26 Oct 2016 09:30:09 -0700 (PDT)
X-Received: by 10.25.137.68 with SMTP id l65mr2589801lfd.115.1477499408918;
        Wed, 26 Oct 2016 09:30:08 -0700 (PDT)
Original-Received: from blaine.gmane.org ([195.159.176.226])
        by mx.google.com with ESMTPS id g40si1877478lfi.366.2016.10.26.09.30.08
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 26 Oct 2016 09:30:08 -0700 (PDT)
Received-SPF: neutral (google.com: 195.159.176.226 is neither permitted nor denied by best guess record for domain of gclcip-std-proposals@m.gmane.org) client-ip=195.159.176.226;
Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1bzR55-0001he-Tw
	for std-proposals@isocpp.org; Wed, 26 Oct 2016 18:29:35 +0200
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 91
Original-X-Complaints-To: usenet@blaine.gmane.org
In-Reply-To: <2908d573-f002-4b58-b0da-18420a816c16@isocpp.org>
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 195.159.176.226 is neither permitted nor denied by best guess
 record for domain of gclcip-std-proposals@m.gmane.org) smtp.mailfrom=gclcip-std-proposals@m.gmane.org;
       dmarc=fail (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:29275
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29275>

On 2016-10-26 11:28, Hans Guijt wrote:
> On Wednesday, October 26, 2016 at 4:52:45 PM UTC+2, Matthew Woehlke wrote:
>> Please do your due diligence before making claims like this, or, for 
>> that matter, asking for "obvious" features. I can assure you, this is 
>> not the first time someone has asked to standardize #pragma once. 
> 
> So you are saying this is a common request from the community, which is not 
> being answered by the standards committee because ...?

....for the reasons I listed. (Which BTW are from memory. I apologize for
any fudging of the reasons, but *you* are the one trying to propose the
feature; I expect you to do the work identifying and addressing the
reasons why this exact request has historically been rejected.)

>> What should happen if you include the same header (same inode) via 
>> different names? What about if the compiler sees two identical include 
>> directives (same path, same <> vs. "") that resolve to different files 
>> with different contents? What about platforms with esoteric file 
>> systems, or *no* file system? 
> 
> This is an attempt at complication of a painfully simple feature.

No. These are questions that *need to be answered*.

> You don't want it, so you just ask meaningless questions that have
> trivial answers in the hope of convincing others it is all incredibly
> complicated, while it really isn't.

I am probably neutral. I am not personally opposed to it (other than my
awareness that it has problems), but I don't feel a particular need for
it, either. Rather, I am trying to point out the reasons *given by
others* that have previously caused this proposal to fail.

What I see here is that you a) haven't done your homework, b) refuse to
do your homework when others point this out, and c) resort to ad hominem
attacks on said others instead.

This strikes me as a good way to get people to ignore you entirely.

> I don't see a problem with including a file twice if a symlink
> exists; after all, you could just copy it and include it twice that
> way as well.

<irony>If you don't see a problem including a header twice, then
obviously we don't need #pragma once.</irony>

(Also see example below.)

> I have some trouble imagining how the same header 
> name could resolve to two different files during the same compilation.

  // foo/foo.cpp
  #include <cow.h> // /usr/include/cow/cow.h
  #include <pig.h> // /usr/include/pork/pig.h
  #include <bar/bar.h>
  #include "config.h" // foo/config.h

  // bar/bar.h
  #include "thirdparty/cow.h" // bar/thirdparty/cow/include/cow.h
  #include <hog.h> // -> /usr/include/pork/pig.h
  #include "config.h" // bar/config.h

  // foo/config.h
  ...

  // bar/config.h
  ...totally different content from foo/config.h...

I've shown three corner cases here:

- Different files, different include paths; content may or may not be
the same
- Different files, same include paths, different content
- Same files, different include paths

The first two are not especially contrived, and this is not necessarily
an exhaustive list. It is well specified how traditional include guards
will handle these cases. What about #pragma once?

Hand-waving is not a sufficient answer.

> The whole thing is completely trivial

It isn't. Please *do your homework* (and don't expect us to do it for
you), identify the issues that have previously prevented this from being
standardized, and come back when you have solutions to those problems.
Otherwise you are just wasting everyone's time rehashing an old proposal
that has already been rejected.

-- 
Matthew

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/nuqlkr%24sg7%241%40blaine.gmane.org.

.
