Sorry, bad format.
#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);
}
------------------ Original ------------------
From: "ntysdd" <ntysdd@qq.com>;
Date: Tue, Aug 16, 2022 08:32 PM
To: "tinycc-devel"<tinycc-devel@nongnu.org>;
Subject: miscompilation for code snippet
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.