mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-28 04:00:06 +08:00
355897a920
When defining an array with non-explicit size, one would get "incompatible types for redefinition of 'array' if the array was already declared with a different size. For example: extern int array[2]; int array[] = {1}; would fail to compile with tcc. Instead the above is now equivalent to: int array[] = {1, 0};
26 lines
573 B
C
26 lines
573 B
C
#include <stdio.h>
|
|
|
|
extern int Array3[10];
|
|
int Array3[] = { 12, 34, };
|
|
int main()
|
|
{
|
|
int Count;
|
|
|
|
int Array[10] = { 12, 34, 56, 78, 90, 123, 456, 789, 8642, 9753 };
|
|
|
|
for (Count = 0; Count < 10; Count++)
|
|
printf("%d: %d\n", Count, Array[Count]);
|
|
|
|
int Array2[10] = { 12, 34, 56, 78, 90, 123, 456, 789, 8642, 9753, };
|
|
|
|
for (Count = 0; Count < 10; Count++)
|
|
printf("%d: %d\n", Count, Array2[Count]);
|
|
|
|
for (Count = 0; Count < 10; Count++)
|
|
printf("%d: %d\n", Count, Array3[Count]);
|
|
|
|
return 0;
|
|
}
|
|
|
|
/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
|