From: Matthias Braun Date: Mon, 17 Dec 2007 15:47:05 +0000 (+0000) Subject: testprogs for bugs, more TODO ideas X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=3c5f1f8338ee0d769a9b6f2e0c0ed1da3eb98cda;p=cparser testprogs for bugs, more TODO ideas [r18783] --- diff --git a/TODO b/TODO index 6aca31e..9258ebb 100644 --- a/TODO +++ b/TODO @@ -5,6 +5,8 @@ Refactoring: Lexer: - Add preprocessor code - proper handling of different file encodings, parsing non-ascii strings +- We could save some space by holding source positions in a separate (somehow + compressed table) and only storing pointers to it on the AST. Parser: - the expect macros abort functions directly. This leads to some functions @@ -16,6 +18,8 @@ Parser: an own module and replacable - Support some attributes. noreturn, unused, printf, scanf, packed would be interesting candidates +- SourcePositions could be stored selectively on expressions that really need + them. ast2firm: - output source file positions for panics... diff --git a/parsetest/cp_error005.c b/parsetest/cp_error005.c index 85d521f..f94f029 100644 --- a/parsetest/cp_error005.c +++ b/parsetest/cp_error005.c @@ -1,7 +1,7 @@ extern char ofname[]; char ofname[1024]; -unsigned s(void) +int main(void) { - return sizeof(ofname); + return sizeof(ofname) == 1024; } diff --git a/parsetest/shouldfail/paramredef.c b/parsetest/shouldfail/paramredef.c new file mode 100644 index 0000000..c64a90e --- /dev/null +++ b/parsetest/shouldfail/paramredef.c @@ -0,0 +1,6 @@ + +int func(int x) { + int x; + + return x; +}