This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: Support for Pascal strings


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]