Just because you *can* create a malformed string with no delimiter does not 
mean that my statement about proper C behavior is untrue.

It is a true statement that "the z architecture stores integers in big-endian 
form." Nonetheless, I *can* create a little-endian integer on z. That does not 
make the statement untrue.

BTW, C++ gives an error for the s6[6] = "wombat" case.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Paul Gilmartin
Sent: Tuesday, September 04, 2012 6:47 AM
To: [email protected]
Subject: Re: The IBM zEnterprise EC12 announcment

On Tue, 4 Sep 2012 06:22:43 -0700, Charles Mills wrote:
>
>char[] delimits strings with '\0' in every implementation in the world, I
>think.
> 
It depends.  With gcc:

    char a6[ 6 ] = { 'w', 'o', 'm', 'b', 'a', 't' };
    char s6[ 6 ] = "wombat";

both compile with no error message, whereas:

    char s5[ 5 ] = "wombat";

gives:

    wombat.c:6: warning: initializer-string for array of chars is too long

so, apparently the \0 terminator is not mandatory.

-

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to