int main(void)
{
size_t a = 20;
unsigned int b = 0;
b = a;
return 0;
}
no header files are included.
i wrote this in cmd
clang -std=c89 -W -Wall -pedantic-errors *.c
why does it compile and run without problems?
I am using clang 13.0.1. (LLVM-13.0.1-win32.exe)




The behavior you describe does not happen with clang on linux systems, but it does with the x64 version of MSVC as can be verified on the Godbolt compiler explorer.
It looks like
size_tis a built-in type for this compiler.The compiler accepts this built-in to be redefined as long as the definition is
Anything else causes an error. As commented by Jonathan Leffler, C11 and later allows you to define a
typedefmore than once as long as the definitions are the same (and not for a variably-modified type).