[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] Fixes to bugs in `type_to_str` and `compare_types`; patch
From: |
Petr Skočík |
Subject: |
[Tinycc-devel] Fixes to bugs in `type_to_str` and `compare_types`; patches to CLI options |
Date: |
Mon, 12 Nov 2018 18:00:49 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
Hi, I ran into some tinycc bugs best demonstrated by:
int main(){
(void)_Generic(&(int[2]){0}, int(*)[4]:0); //shouldn't compile
but it does
return _Generic(&(int[2]){0}, int(*)[2]:0, int(*)[4]:0);
//reports a `type match twice` error even though int(*)[2] and
int(*)[4] are
//different types
//also `int(*)[2]` shouldn't be rendered as `int *[2]`
}
My shot at the fixes is at https://github.com/pskocik/tinycc. It's
separated into addition of failing tests and fixes to those tests.
I've also thrown in a separate patch that allows `tcc -o -` to be
treated as "write output to stdout".
(I had problems with -o /dev/stdout on some Cygwin IIRC) and another one
that makes libc accept `-l lib` in addition
to `-llib` (because gcc/clang do and POSIX specifically wants it).
I welcome criticism.
Best regards,
Petr S.
- [Tinycc-devel] Fixes to bugs in `type_to_str` and `compare_types`; patches to CLI options,
Petr Skočík <=