tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] report a bug


From: 837806295
Subject: [Tinycc-devel] report a bug
Date: Mon, 18 Mar 2024 20:36:17 +0800



hello, report a bug, my English is not good, hope you understand.

bug info
file: tccpp.c
function: parse_escape_string
line: 2010
------------------------------------------------------

do {
c = *p;
if (c >= 'a' && c <= 'f')
c = c - 'a' + 10;
else if (c >= 'A' && c <= 'F')
c = c - 'A' + 10;
else if (isnum(c))
c = c - '0';
----> else if (i > 0)
expect("more hex digits in universal-character-name");
else
goto add_hex_or_ucn;
n = n * 16 + c;
p++;
} while (--i);

it should be

else if (i >= 0)

------------------------------------------------------
the following code can show the problem:

#include <stdio.h>


int main(int argc, const char **argv)
{
int x = '\x';
printf("%d\n", x);

return 0;
}

------------------------------------------------------
in gcc, it should not be compiled??report error like:


main.c: In function ??main??:
main.c:6:13: error: \x used with no following hex digits
int x = '\x';


------------------------------------------------------
in tcc, it can be compiled. no error!


 

reply via email to

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