220 14146 <bdd66089-f184-4793-abae-6c00737291d0@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Germinolegrand <germinolegrand@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: #pragma once
Date: Thu, 23 Oct 2014 02:04:00 -0700 (PDT)
Lines: 154
Approved: news@gmane.org
Message-ID: <bdd66089-f184-4793-abae-6c00737291d0@isocpp.org>
References: <3d0ab5b0-73d9-434a-9ae4-cd47d8275590@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_125_1669189462.1414055040845"
X-Trace: ger.gmane.org 1414055051 20796 80.91.229.3 (23 Oct 2014 09:04:11 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 23 Oct 2014 09:04:11 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCD6BLGH7YNBBAMJUORAKGQEJ4GYPBY@isocpp.org Thu Oct 23 11:04:05 2014
Return-path: <std-proposals+bncBCD6BLGH7YNBBAMJUORAKGQEJ4GYPBY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yh0-f69.google.com ([209.85.213.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCD6BLGH7YNBBAMJUORAKGQEJ4GYPBY@isocpp.org>)
	id 1XhEJO-0003HS-Nv
	for gclcip-std-proposals@m.gmane.org; Thu, 23 Oct 2014 11:04:02 +0200
Original-Received: by mail-yh0-f69.google.com with SMTP id c41sf1774136yho.4
        for <gclcip-std-proposals@m.gmane.org>; Thu, 23 Oct 2014 02:04:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=DK0sYKQzh/rkqHdZajqLqH+5v2nPaDnjRoyrivDymrY=;
        b=bF+Fv+Ni8ETir9wpsVH/rVgNcE/kD7ag2O5Grzi8vNKUUCfbAsVru2sp3NayrqCIEI
         4+coE8Pf1USD8MzbMlbUoA5A/6fZxMr/gnBr/AnDj3+WUHHDiWlPHQgsSFd9Eh8ZwFVE
         yiGXPnI6OevdJ4zmgBU7ss2KyG4O8lMg6O8GEbx4YxUb57QKdyx685For0g72T9xq/D/
         a0N2KvfKfvf+anGrkUA2gA/+nBA3nxzhNSuB1bvWUTupL6GHImgnFp33TC6kfXtmqTeb
         WlZlC3JRviS1/MoScfnU/Ws3pjGL9/DWdfbJDOKwXBcxg1IPKBfghZsmRQ55A2TRbtUc
         ySDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=DK0sYKQzh/rkqHdZajqLqH+5v2nPaDnjRoyrivDymrY=;
        b=QL2xsv0skT+lLlq8S0Mjbm1wuANMaGZwU0pp1vBp/sY8kP9th5n/HlaO+Dj1yMUH6A
         I4rVDM1yOCTz+hBLFUq2WHSe1ar6EUvCqLf/et2JTsPtNPl0st+Mfvjxdf4h0V84G3Ix
         4tzYGs7iwt5ANVAR82ItyHij0vioJtT2LqwLuxaOhCsaUUJ45FkxjpdYhL7+4Z4C7qkL
         R2mkKb++EBqVM2iJcJlBjnsBZsE5rcZ2zBwUNy7HnCyIgc59KLktK2RjSBapP4Q8QlhU
         F8mNbhAa5Ow6d4xf3i2F3GIct0BJStRefpSnKJqCyzw8wuO9G69Rjn9nvRyJhZw2iHC0
         QciA==
X-Gm-Message-State: ALoCoQkP5V3SrNVvi/zPX0/+fYi7CsqhjXs58Sg4v1nzqMHaCJ1tpnKkaAtQSHAwWC7c67CL8KPK
X-Received: by 10.52.17.170 with SMTP id p10mr2515275vdd.6.1414055041802;
        Thu, 23 Oct 2014 02:04:01 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.106.7 with SMTP id d7ls1096536qgf.50.gmail; Thu, 23 Oct
 2014 02:04:01 -0700 (PDT)
X-Received: by 10.140.19.208 with SMTP id 74mr12349qgh.19.1414055041273;
        Thu, 23 Oct 2014 02:04:01 -0700 (PDT)
In-Reply-To: <3d0ab5b0-73d9-434a-9ae4-cd47d8275590@isocpp.org>
X-Original-Sender: germinolegrand@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:14146
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14146>

------=_Part_125_1669189462.1414055040845
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Seriously, I'm fed up with debugging those kind of errors no compiler can=
=20
even diagnose properly ! Just helped a (not so) beginner stuck with this=20
one :

#ifndef CSCWRITER_H_# define CSVWRITER_H_


Erreur 88 error C2995: 'CSV::Writer &CSV::operator <<(CSV::Writer &,const T=
=20
&)' : mod=C3=A8le de fonction d=C3=A9j=C3=A0 d=C3=A9fini CSVWriter.hxx 12

When you have a lot of experience you can at least think to verify those=20
sort of stuff, but hey, when you have under 2 years experience this means=
=20
hours of trying to debug a link error that's in fact a quite unvisible typo=
=20
in a header guard.

I myself also encounter errors myself when i copy a header to start another=
=20
one (without having to recode all the #include and all the namespace=20
a{namespaceb b{ boilerplate), and thanks to murphy I forget to change the=
=20
header guard name, and I do not run into any problem until i eventually=20
include both headers indirectly in one compile unit. If you just wrote the=
=20
second, you often remember to watch the header guards for this error, but=
=20
when you did it two weeks ago, have a good day.


*"It's complicated to implement from a compiler point of view so let the=20
programmer type a lot of super-murphy piece of code instead."*
Seriously ? Are we talking about C or ... ?

Header guards are not superior to anything the compiler can do with a=20
#pragma once equivalent, it's only a trade-off. And i would trade easily=20
sneaky link errors due to preprocessing issues for safety and simplicity.

No matter how hard it is to implement, since it's perfectly feasible (as an=
=20
ultimate resort, just compare the files content).

Although #pragma once would be nice since it's in large use, #once would at=
=20
least solve half the problem.

Le mardi 21 octobre 2014 21:29:21 UTC+2, Myriachan a =C3=A9crit :
>
> I think that #pragma once should be standardized - at least=20
> partially/optionally/conditionally-supported.  Every major compiler=20
> implements it with identical or nearly-identical semantics.
>
> Defining what it means for a file to be a repeat is rather simple: On=20
> platforms supporting symlinks and hard links, use unique inode numbers (+=
=20
> device if needed).  On other platforms, use the filename.  Compilers may=
=20
> assume that files don't change while compiling (i.e. if the filename=20
> matches, it can be assumed to be identical).  On platforms where there=20
> exist special links to the same or parent directory, like "./" or "../" o=
n=20
> NT and POSIX, this assumption can be extended to collapse these.
>
> By the way, why don't _Pragma and #line support concatenating multiple=20
> strings in their respective string parameters?
>
> Melissa
>

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_125_1669189462.1414055040845
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Seriously, I'm fed up with debugging those kind of errors =
no compiler can even diagnose properly ! Just helped a (not so) beginner st=
uck with this one :<br><br><pre><span style=3D"color: black"><span style=3D=
"color: #339933;">#ifndef CSCWRITER_H_</span>
<span style=3D"color: #339933;"># define CSVWRITER_H_<br></span></span></pr=
e><br><div class=3D"citation">Erreur	88	error C2995: 'CSV::Writer=20
&amp;CSV::operator &lt;&lt;(CSV::Writer &amp;,const T &amp;)'&nbsp;: mod=C3=
=A8le=20
de fonction d=C3=A9j=C3=A0 d=C3=A9fini	CSVWriter.hxx	12<br><br>When you hav=
e a lot of experience you can at least think to verify those sort of stuff,=
 but hey, when you have under 2 years experience this means hours of trying=
 to debug a link error that's in fact a quite unvisible typo in a header gu=
ard.<br><br>I myself also encounter errors myself when i copy a header to s=
tart another one (without having to recode all the #include and all the nam=
espace a{namespaceb b{ boilerplate), and thanks to murphy I forget to chang=
e the header guard name, and I do not run into any problem until i eventual=
ly include both headers indirectly in one compile unit. If you just wrote t=
he second, you often remember to watch the header guards for this error, bu=
t when you did it two weeks ago, have a good day.<br><br><i>"It's complicat=
ed to implement from a compiler point of view so let the programmer type a =
lot of super-murphy piece of code instead."<br></i></div>Seriously ? Are we=
 talking about C or ... ?<br><br>Header guards are  not superior to anythin=
g the compiler can do with a #pragma once equivalent, it's only a trade-off=
.. And i would trade easily sneaky link errors due to preprocessing issues f=
or safety and simplicity.<br><br>No matter how hard it is to implement, sin=
ce it's perfectly feasible (as an ultimate resort, just compare the files c=
ontent).<br><br>Although #pragma once would be nice since it's in large use=
, #once would at least solve half the problem.<br><br>Le mardi 21 octobre 2=
014 21:29:21 UTC+2, Myriachan a =C3=A9crit&nbsp;:<blockquote class=3D"gmail=
_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;p=
adding-left: 1ex;"><div dir=3D"ltr">I think that <span style=3D"font-family=
:courier new,monospace">#pragma once</span> should be standardized - at lea=
st partially/optionally/<wbr>conditionally-supported.&nbsp; Every major com=
piler implements it with identical or nearly-identical semantics.<br><br>De=
fining what it means for a file to be a repeat is rather simple: On platfor=
ms supporting symlinks and hard links, use unique inode numbers (+ device i=
f needed).&nbsp; On other platforms, use the filename.&nbsp; Compilers may =
assume that files don't change while compiling (i.e. if the filename matche=
s, it can be assumed to be identical).&nbsp; On platforms where there exist=
 special links to the same or parent directory, like "./" or "../" on NT an=
d POSIX, this assumption can be extended to collapse these.<br><br>By the w=
ay, why don't <span style=3D"font-family:courier new,monospace">_Pragma</sp=
an> and <span style=3D"font-family:courier new,monospace">#line</span> supp=
ort concatenating multiple strings in their respective string parameters?<b=
r><br>Melissa<br></div></blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_125_1669189462.1414055040845--

.
