<div dir="ltr">how I unsubscribe to this mailing list ?<br><br>Thanks</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-23 22:11 GMT+02:00 Larry Baker <span dir="ltr"><<a href="mailto:baker@usgs.gov" target="_blank">baker@usgs.gov</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Lisandro,<div><br></div><div>As a matter of personal taste, I prefer that empty strings be used as initializers for C strings.  One of the things I dislike extremely about C (and, one of the reasons I think it is so easy in C to write bad code) is its mixing of integers and pointers and integers and chars.  Even though { 0 } is identical to { "" } when initializing C strings, I find the latter more informative.  I know the C standard specifies that strings are terminated by the null character, which is elsewhere specified to be a byte with all bits equal to zero.  However, "" <i>is</i> the literal empty string, whereas 0 (or '\0') is the underlying implementation of the empty string.  This is also why I prefer to use the C99 NULL macro constant to initialize pointers with the <i>nil</i> pointer as opposed to 0 (which gets implicitly cast to a nil pointer of the correct size), the implementation of the nil pointer.  As I said, though, this is all just a matter of taste -- there is no difference in the correctness of the code.</div>
<div><br><div>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;border-collapse:separate;text-transform:none;font-size:medium;white-space:normal;font-family:'Helvetica Neue';word-spacing:0px">Larry Baker<br>
US Geological Survey<br>650-329-5608<br><a href="mailto:baker@usgs.gov" target="_blank">baker@usgs.gov</a><br><br><br></span>
</div>
<br><div><div>On 23 Apr 2014, at 3:20 AM, Lisandro Dalcin wrote:</div><br><blockquote type="cite"><div>On 23 April 2014 00:55, Rob Latham <<a href="mailto:robl@mcs.anl.gov" target="_blank">robl@mcs.anl.gov</a>> wrote:<br>
<blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On 04/22/2014 04:04 AM, Lisandro Dalcin wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite"><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite">The following simple tests segfaults. A quick fix would be to return<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">an empty string in MPIR_Err_get_dynerr_string() (file dynerrutil.c),<br>
</blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I don't muck around in this code very often, so after thinking about it for<br></blockquote>
<blockquote type="cite">a bit, and coming up with another way to do it, I opened a ticket so i could<br></blockquote><blockquote type="cite">get a second (third, I guess) opinion:<br></blockquote><blockquote type="cite"><br>
</blockquote><blockquote type="cite"><a href="https://trac.mpich.org/projects/mpich/ticket/2067" target="_blank">https://trac.mpich.org/projects/mpich/ticket/2067</a><br></blockquote><blockquote type="cite"><br></blockquote>
<br>IMHO your patch complicates things too much, I'm still in support of<br>this slightly refined version that removes the usage of empty string<br>constants (Rob, could you upload this patch to the ticket?):<br><br>$ git diff<br>
diff --git a/src/mpi/errhan/dynerrutil.c b/src/mpi/errhan/dynerrutil.c<br>index 943e8c3..2e3bb27 100644<br>--- a/src/mpi/errhan/dynerrutil.c<br>+++ b/src/mpi/errhan/dynerrutil.c<br>@@ -48,6 +48,7 @@ static const char<br>*(user_class_msgs[ERROR_MAX_NCLASS]) = { 0 };<br>
 static const char *(user_code_msgs[ERROR_MAX_NCODE]) = { 0 };<br> static int  first_free_class = 0;<br> static int  first_free_code  = 1;  /* code 0 is reserved */<br>+static const char empty_error_string[1] = { 0 };<br>
<br> /* Forward reference */<br> const char *MPIR_Err_get_dynerr_string( int code );<br>@@ -297,11 +298,13 @@ const char *MPIR_Err_get_dynerr_string( int code )<br>     if (errcode) {<br>  if (errcode < first_free_code) {<br>
     errstr = user_code_msgs[errcode];<br>+    if (!errstr) errstr = empty_error_string;<br>  }<br>     }<br>     else {<br>  if (errclass < first_free_class) {<br>     errstr = user_class_msgs[errclass];<br>+    if (!errstr) errstr = empty_error_string;<br>
  }<br>     }<br><br><br><span class="HOEnZb"><font color="#888888"><br>-- <br>Lisandro Dalcin<br>---------------<br>CIMEC (UNL/CONICET)<br>Predio CONICET-Santa Fe<br>Colectora RN 168 Km 472, Paraje El Pozo<br>3000 Santa Fe, Argentina<br>
Tel: <a href="tel:%2B54-342-4511594" value="+543424511594" target="_blank">+54-342-4511594</a> (ext 1016)<br>Tel/Fax: <a href="tel:%2B54-342-4511169" value="+543424511169" target="_blank">+54-342-4511169</a><br><span><error-string.diff></span></font></span></div>
</blockquote></div><br></div></div></blockquote></div><br></div>