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


On Wed, Jun 20, 2001 at 04:35:44PM -0700, Ziemowit Laski wrote:
> Hi Mark, Zack, et al, 
> 
> On Wednesday, June 20, 2001, at 03:21 , Mark Mitchell wrote: 
> 
> 
> > Even though I am normally the most rabid anti-extensionist on this 
> > list, I am 
> > sympathetic to this particular extension.  I do think that it needs 
> > to have 
> > complete semantic documentation, which means answering the 
> > questions Joseph 
> > raised about what happens with `const char s[2] = "\pxy"' and such. 
> > 
>  
> Yes, I shall cook up an extend.texi patch and post it here for 
> everyone's  
> review shortly.  BTW, 'const char s[2] = "\pxy"' will not work, but  
> 'const unsigned char s[3] = "\pxy"'  or 'const unsigned char s[] = 
> "\pxy"' 
> will be fine. :) 

> 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 *'. 

Everyone seems to be confused about this.  Are or are not these things
null terminated?  If they are null terminated, they'd better require
one more byte than you're giving them.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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