[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] parsing 0x1e+1 as 0x1e +1
From: |
Vincent Lefevre |
Subject: |
Re: [Tinycc-devel] parsing 0x1e+1 as 0x1e +1 |
Date: |
Wed, 27 Apr 2016 10:01:38 +0200 |
User-agent: |
Mutt/1.6.0-6619-vl-r87826 (2016-04-11) |
On 2016-04-27 07:17:47 +0300, Sergey Korshunoff wrote:
> A problem solved (as someone suggested on the list) by teaching tcc to
> recognize right exponent chars in next_nomacro1().(no any space chars
> after macro expansion). This is like pcc do. A test prgram:
>
> extern int printf(const char *format, ...);
> #define ACPI_TYPE_INVALID 0x1E
> #define NUM_NS_TYPES ACPI_TYPE_INVALID+1
> int array[NUM_NS_TYPES];
> #define n 0xe
> int main() {
> printf("n+1 = %d\n", n+1);
> }
>
> prints 15
> And preprocessor output is
> ...
> printf("n+1 = %d\n", 0x1e+1);.
I'm not sure I understand. This preprocessor output is obviously
incorrect as it cannot be taken as input to a compiler. There
should be a space between 0x1e and +1 (see for instance, the
output of "gcc -E", "clang -E" and "icc -E").
--
Vincent Lefèvre <address@hidden> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
- [Tinycc-devel] parsing 0x1e+1 as 0x1e +1, Sergey Korshunoff, 2016/04/27
- Re: [Tinycc-devel] parsing 0x1e+1 as 0x1e +1,
Vincent Lefevre <=
- Re: [Tinycc-devel] parsing 0x1e+1 as 0x1e +1, Edmund Grimley Evans, 2016/04/27
- Re: [Tinycc-devel] parsing 0x1e+1 as 0x1e +1, Sergey Korshunoff, 2016/04/27
- Re: [Tinycc-devel] parsing 0x1e+1 as 0x1e +1, Edmund Grimley Evans, 2016/04/27
- Re: [Tinycc-devel] parsing 0x1e+1 as 0x1e +1, Vincent Lefevre, 2016/04/27
- Re: [Tinycc-devel] parsing 0x1e+1 as 0x1e +1, Sergey Korshunoff, 2016/04/27
- Re: [Tinycc-devel] parsing 0x1e+1 as 0x1e +1, Vincent Lefevre, 2016/04/27
- Re: [Tinycc-devel] parsing 0x1e+1 as 0x1e +1, Sergey Korshunoff, 2016/04/27