tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Empy preprocessor lexeme bug


From: Christian Jullien
Subject: Re: [Tinycc-devel] Empy preprocessor lexeme bug
Date: Mon, 3 May 2021 10:04:58 +0200

Indeed, I can reproduce with mob with this snippet:

#include <stdio.h>

#define CALL(f, ...) f(__VA_ARGS__)
#define CONST()      123

int
main() {
        printf("%d\n", CALL(CONST, ));

}

It works with clang and gcc but fails with tcc
[jullien@fedora64 ~]$ clang foo.c && ./a.out
123
[jullien@fedora64 ~]$ gcc foo.c && ./a.out
123
[jullien@fedora64 ~]$ tcc -v
tcc version 0.9.27 - 3564c47 (x86_64 Linux)
[jullien@fedora64 ~]$ tcc foo.c && ./a.out
foo.c:11: error: macro 'CONST' used with too many args

C.


-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange.fr@nongnu.org] On 
Behalf Of Christian Jullien
Sent: Sunday, May 02, 2021 18:44
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] Empy preprocessor lexeme bug

Hi it looks you're not using mod and 0.9.27 is quite old.
Now mob gives you short git hash code like:
$ tcc -v
tcc version 0.9.27 - 9b76a64 (ARM eabihf Linux)

Can you reproduce this with mod?
If you do, can you send us a minimal test case that exhibits the bug?
Does is also fails if you rename CONST => MYCONST as CONST is sometimes also 
defined by some includes/modules.

C.


-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange.fr@nongnu.org] On 
Behalf Of Temirkhan Myrzamadi
Sent: Sunday, May 02, 2021 15:49
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] Empy preprocessor lexeme bug

Take a look at the following code:

```
#define CALL(f, ...) f(__VA_ARGS__)
#define CONST()      123

// error: macro 'CONST' used with too many args
CALL(CONST, )
```

But `CONST()` work as expected. I think it's a bug because both
`CONST()` and `f(__VA_ARGS__)` are identical calls, where
`__VA_ARGS__` stands for the empty preprocessor lexeme, as in
`CONST()`.

```
$ tcc -v
tcc version 0.9.27 (x86_64 Linux)
```

(I am not sure where to post bugs, please let me know if this isn't the place.)

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel




reply via email to

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