This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Support for Pascal strings
- To: Ziemowit Laski <zlaski at apple dot com>
- Subject: Re: PATCH: Support for Pascal strings
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Thu, 21 Jun 2001 07:05:59 +0100
- Cc: Mark Mitchell <mark at codesourcery dot com>, Stan Shebs <shebs at apple dot com>,"Joseph S. Myers" <jsm28 at cam dot ac dot uk>,Zack Weinberg <zackw at stanford dot edu>,"gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
Ziemowit Laski wrote:-
> The type is 'const unsigned char[strlen("\p...")]', where \p takes up
> one character. Pointing to this
> literal (in C++) requires a 'const unsigned char *'.
But you said earlier you want a terminating NUL.
sizeof ("foo") == 4
at present, so surely sizeof ("\pfoo") == 5 now, with "3" the leading
byte?
I think your string sizes are off by one, unless you expect the
compiler to magically allocate an extra byte of storage that somehow
avoids sizeof().
Neil.