[mpich-devel] Issue with MPI_Error_string() for user-defined codes/clases

Lisandro Dalcin dalcinl at gmail.com
Thu Apr 24 01:34:59 CDT 2014


On 23 April 2014 23:11, Larry Baker <baker at usgs.gov> wrote:
> Lisandro,
>
> 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, "" is the literal empty string, whereas 0 (or '\0')
> is the underlying implementation of the empty string.

Are you talking about this single line:?

static const char empty_error_string[1] = { 0 };

I guess you are proposing to change it to:

static const char empty_error_string[1] = "";

Please note {""} is an array of strings. Perhaps you meant {'\0'},
i.e. the null char literal?

Please confirm your concerns were related to that single line of my
patch, so I can update the trac ticket.


-- 
Lisandro Dalcin
---------------
CIMEC (UNL/CONICET)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1016)
Tel/Fax: +54-342-4511169


More information about the devel mailing list