the support for the macro GCC_MAJOR is gone since 2017, and it's fairly doubtful that anyone serious is using gcc 2.95. Also adds a test for the ternary ops typing rules: 'x?bool:bool' has to promote to int.
Unified · Split
| @@ -3,8 +3,6 @@ · 2 unmodified lines | ||
| 3 | 3 | */ |
| 4 | 4 | #include "config.h" |
| 5 | 5 | |
| 6 | −#if GCC_MAJOR >= 3 | |
| 7 | − | |
| 8 | 6 | /* Unfortunately, gcc version < 3 does not handle that! */ |
| 9 | 7 | #define ALL_ISOC99 |
| 10 | 8 | |
| @@ -14,7 +12,11 @@ · 3 unmodified lines | ||
| 14 | 12 | /* gcc 2.95.3 does not handle correctly CR in strings or after strays */ |
| 15 | 13 | #define CORRECT_CR_HANDLING |
| 16 | 14 | |
| 17 | −#endif | |
| 15 | +/* __VA_ARGS__ and __func__ support */ | |
| 16 | +#define C99_MACROS | |
| 17 | + | |
| 18 | +/* deprecated and no longer supported in gcc 3.3 */ | |
| 19 | +//#define ACCEPT_CR_IN_STRINGS | |
| 18 | 20 | |
| 19 | 21 | #ifndef __TINYC__ |
| 20 | 22 | typedef __SIZE_TYPE__ uintptr_t; |
| @@ -37,12 +39,6 @@ typedef __SIZE_TYPE__ uintptr_t; · 16 unmodified lines | ||
| 37 | 39 | #define LONG_DOUBLE_LITERAL(x) x ## L |
| 38 | 40 | #endif |
| 39 | 41 | |
| 40 | −/* deprecated and no longer supported in gcc 3.3 */ | |
| 41 | −//#define ACCEPT_CR_IN_STRINGS | |
| 42 | − | |
| 43 | −/* __VA_ARGS__ and __func__ support */ | |
| 44 | −#define C99_MACROS | |
| 45 | − | |
| 46 | 42 | /* test various include syntaxes */ |
| 47 | 43 | |
| 48 | 44 | #define TCCLIB_INC <tcclib.h> |
| @@ -2118,7 +2114,7 @@ void c99_bool_test(void) · 2069 unmodified lines | ||
| 2118 | 2114 | { |
| 2119 | 2115 | #ifdef BOOL_ISOC99 |
| 2120 | 2116 | int a; |
| 2121 | − _Bool b; | |
| 2117 | + _Bool b, b2; | |
| 2122 | 2118 | |
| 2123 | 2119 | printf("bool_test:\n"); |
| 2124 | 2120 | printf("sizeof(_Bool) = %d\n", sizeof(_Bool)); |
| @@ -2128,6 +2124,9 @@ void c99_bool_test(void) · 3 unmodified lines | ||
| 2128 | 2124 | printf("b = %d\n", b); |
| 2129 | 2125 | b++; |
| 2130 | 2126 | printf("b = %d\n", b); |
| 2127 | + b2 = 0; | |
| 2128 | + printf("sizeof(x ? _Bool : _Bool) = %d (should be sizeof int)\n", | |
| 2129 | + sizeof((volatile)a ? b : b2)); | |
| 2131 | 2130 | #endif |
| 2132 | 2131 | } |
| 2133 | 2132 | |