tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] invalid escaped char


From: s duclos
Subject: Re: [Tinycc-devel] invalid escaped char
Date: Sat, 4 Oct 2003 10:32:15 -0700 (PDT)

Hi :)

I have no idea what this surrogate stuff is about :))

I'm trying to compile C code comming out of ooc
(Oberon-2 to C).

tcc exit when it hit the string while gcc continue.

I have been searching ISO C99 to find out what should
be done about that. At the moment I'm looking at
N869 (ISO C99 --January 18, 1999)


6.4.5 String literals
Syntax
   string-literal:
        "s-char-sequence opt "
       L"s-char-sequence opt "

   s-char-sequence:
        s-char
        s-char-sequence s-char

   s-char:
        any member of the source character set except
        the double-quote ", backslash \, or new-line  
              character escape-sequence



On the other hand I found this code in OpenDarwin:

#define kCFCharacterSetSurrogateHighShift (10)
#define kCFCharacterSetSurrogateBase (0x0010000UL)
#define kCFCharacterSetSurrogateHighStart (0xD800UL)
#define kCFCharacterSetSurrogateHighEnd (0xDBFFUL)
#define kCFCharacterSetSurrogateLowStart (0xDC00UL)
#define kCFCharacterSetSurrogateLowEnd (0xDFFFUL)

So maybe this is the correct way to do it from 
the ooc side !

I was just signaling that there is some grey stuff
over there if tcc is to be used as a drop-in
replacement for gcc :))

I'm cross posting to ooc list so that Micheal (the
ooc author) might want to add some light.

Micheal, the code I'm referring to is in:
/usr/local/lib/oo2c/obj/Object.oh:14:

#define Object__surrogateLow "\00"
#define Object__surrogateHigh "\ 00"
#define Object__surrogateEnd "\°00"
#define Object__surrogateLimit "\000\ 00"


thanks,

Sylvain.

 
      
--- Charlie Gordon <address@hidden> wrote:
> What is the problem ?
> 
> gcc and tcc both complain about the unknown (to me
> also) escape string.
> gcc is more cautious about not make absolute
> statements.  So it issues a
> warning about something it doesn't know.
> tcc could be a bit milder about it being "invalid"
> and not make that an
> error...
> 
> Can you explain what this surrogate stuff is all
> about, and what the hell it
> is supposed to mean in a C source file.
> 
> Charlie.
> 
> ----- Original Message -----
> From: "s duclos" <address@hidden>
> To: <address@hidden>
> Sent: Friday, October 03, 2003 9:40 PM
> Subject: [Tinycc-devel] invalid escaped char
> 
> 
> > Hi,
> >
> > Got this message:  invalid escaped char
> >
> > $ tcc -v
> > tcc version 0.9.19
> > $ cat test.c
> > #include <stdlib.h>
> > #define surrogateLow "\<90>00"
> > int main(){
> >     printf(surrogateLow "\n");
> >     return 1;
> > }
> > $ tcc test.c
> > test.c:2: invalid escaped char
> > $ gcc --version
> > gcc (GCC) 3.3.2 20030908 (Debian prerelease)
> > ...
> > $gcc test.c
> > test.c:4:12: warning: unknown escape sequence:
> '\220'
> > $./a.out
> >
> > $
> >
> >
> > The surrogateLow string in hex is "5c 90 30 30"
> >
> >
> > $ hexdump -C test.c
> > 00000000  23 69 6e 63 6c 75 64 65  20 3c 73 74 64
> 6c
> > 69 62  |#include <stdlib|
> > 00000010  2e 68 3e 0a 23 64 65 66  69 6e 65 20 73
> 75
> > 72 72  |.h>.#define surr|
> > 00000020  6f 67 61 74 65 4c 6f 77  20 22 5c 90 30
> 30
> > 22 0a  |ogateLow "\.00".|
> > 00000030  69 6e 74 20 6d 61 69 6e  28 29 7b 0a 20
> 20
> > 20 20  |int main(){.    |
> > 00000040  70 72 69 6e 74 66 28 73  75 72 72 6f 67
> 61
> > 74 65  |printf(surrogate|
> > 00000050  4c 6f 77 20 22 5c 6e 22  29 3b 0a 20 20
> 20
> > 20 72  |Low "\n");.    r|
> > 00000060  65 74 75 72 6e 20 31 3b  0a 7d 0a
> >      |eturn 1;.}.|
> > 0000006b
> >
> >
> > Thanks,
> >
> > Sylvain.
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product
> search
> > http://shopping.yahoo.com
> >
> >
> > _______________________________________________
> > Tinycc-devel mailing list
> > address@hidden
> >
> http://mail.nongnu.org/mailman/listinfo/tinycc-devel
> >
> 
> 
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/tinycc-devel


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]