1 Return-Path: <Vladimir.Marek@Oracle.COM>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id EC7BB431FAF
\r
6 for <notmuch@notmuchmail.org>; Sat, 27 Apr 2013 03:13:45 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.299 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3, UNPARSEABLE_RELAY=0.001]
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id vTg4-tH3BV7L for <notmuch@notmuchmail.org>;
\r
17 Sat, 27 Apr 2013 03:13:45 -0700 (PDT)
\r
18 Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69])
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 5803D431FAE
\r
22 for <notmuch@notmuchmail.org>; Sat, 27 Apr 2013 03:13:45 -0700 (PDT)
\r
23 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237])
\r
24 by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with
\r
25 ESMTP id r3RADZBZ008948
\r
26 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
\r
27 Sat, 27 Apr 2013 10:13:35 GMT
\r
28 Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86])
\r
29 by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
\r
31 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL);
\r
32 Sat, 27 Apr 2013 10:13:33 GMT
\r
33 Received: from ubhmt101.oracle.com (ubhmt101.oracle.com [156.151.24.6])
\r
34 by userz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
\r
35 r3RADWFA020416; Sat, 27 Apr 2013 10:13:32 GMT
\r
36 Received: from pub.cz.oracle.com (/10.163.101.122)
\r
37 by default (Oracle Beehive Gateway v4.0)
\r
38 with ESMTP ; Sat, 27 Apr 2013 03:13:32 -0700
\r
39 Date: Sat, 27 Apr 2013 12:11:35 +0200
\r
40 From: Vladimir Marek <Vladimir.Marek@Oracle.COM>
\r
41 To: Tomi Ollila <tomi.ollila@iki.fi>
\r
42 Subject: Re: [PATCH] don't store temporary value returned from c_str()
\r
43 Message-ID: <20130427101134.GI10394@pub.cz.oracle.com>
\r
44 Mail-Followup-To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org,
\r
45 Vladimir Marek <vlmarek@volny.cz>
\r
46 References: <1366405933-17223-1-git-send-email-Vladimir.Marek@oracle.com>
\r
47 <m2sj2cjp2b.fsf@guru.guru-group.fi>
\r
49 Content-Type: text/plain; charset=utf-8
\r
50 Content-Disposition: inline
\r
51 In-Reply-To: <m2sj2cjp2b.fsf@guru.guru-group.fi>
\r
52 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
53 X-Source-IP: acsinet21.oracle.com [141.146.126.237]
\r
54 Cc: notmuch@notmuchmail.org, Vladimir Marek <vlmarek@volny.cz>
\r
55 X-BeenThere: notmuch@notmuchmail.org
\r
56 X-Mailman-Version: 2.1.13
\r
58 List-Id: "Use and development of the notmuch mail system."
\r
59 <notmuch.notmuchmail.org>
\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
63 List-Post: <mailto:notmuch@notmuchmail.org>
\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
67 X-List-Received-Date: Sat, 27 Apr 2013 10:13:46 -0000
\r
69 > > From: Vladimir Marek <vlmarek@volny.cz>
\r
71 > > This is causing problems when compiled by Oracle Studio. Memory pointed
\r
72 > > by (const char*)term was already changed once talloc_strdup was called.
\r
74 > If that changes, I'd like to understand why (and stated in the commit
\r
75 > message). If that is clear to everyone else I will withdraw the question --
\r
76 > I am not too familiar with these iterators magic... :D
\r
78 Well, a) standards says that
\r
80 A temporary bound to a reference parameter in a function call (5.2.2)
\r
81 persists until the completion of the full expression containing the call
\r
83 (you can find the message all over the net, but I can't find actual link
\r
84 to the standard :-/)
\r
87 b) Imagine the function c_str() looks like that:
\r
90 string::c_str(void) {
\r
93 strcpy (buf, this->internal_representation);
\r
98 char *my_tmp = string.c_str();
\r
102 printf(string.c_str());
\r
104 Hopefully I made the example right ...
\r