tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] miscompilation for code snippet


From: ntysdd
Subject: [Tinycc-devel] miscompilation for code snippet
Date: Tue, 16 Aug 2022 20:32:45 +0800

TCC gets different result than gcc or clang for code below
>
> #define G(x) _Generic((x),int*:"int*",void*:"void*")
>
> int printf(const char*, ...);
>
> int main()
> {
>         int y = 0;
>         const char *s = G(1?(void*)(y*0LL):&y);
>         printf("%s\n", s);
> }

expected
void*

actual
int*

Similar constructs are used in Linux kernel.

reply via email to

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