Michael Beck [Wed, 17 Sep 2008 14:52:31 +0000 (14:52 +0000)]
nested function example
[r22040]
Christoph Mallon [Wed, 17 Sep 2008 14:47:40 +0000 (14:47 +0000)]
Small simplification.
[r22039]
Michael Beck [Wed, 17 Sep 2008 12:51:33 +0000 (12:51 +0000)]
do not record empty declarations by default
[r22036]
Michael Beck [Wed, 17 Sep 2008 12:40:52 +0000 (12:40 +0000)]
- type property expressions are NOT self-initializer
[r22035]
Christoph Mallon [Wed, 17 Sep 2008 08:55:51 +0000 (08:55 +0000)]
Always return a non-null pointer from parse_array_declarator() to avoid dereferencing a null pointer later on.
[r22029]
Christoph Mallon [Wed, 17 Sep 2008 07:50:51 +0000 (07:50 +0000)]
The element type of an array shall not be an incomplete or function type.
[r22028]
Christoph Mallon [Wed, 17 Sep 2008 07:29:23 +0000 (07:29 +0000)]
Still record the element type of arrays and the return type of functions, even if they are invalid.
[r22027]
Christoph Mallon [Tue, 16 Sep 2008 18:38:09 +0000 (18:38 +0000)]
Warn about type qualifiers in the return type of function types.
[r22020]
Christoph Mallon [Tue, 16 Sep 2008 18:11:08 +0000 (18:11 +0000)]
Do not warn about the return type of main(), if it is the error type.
[r22017]
Christoph Mallon [Tue, 16 Sep 2008 18:06:30 +0000 (18:06 +0000)]
Use the real error type instead of ATOMIC_TYPE_INVALID, when parsing type specifiers, to avoid strange errors/warnings later on.
[r22016]
Christoph Mallon [Tue, 16 Sep 2008 18:02:07 +0000 (18:02 +0000)]
Avoid segfault when encountering a parse error while parsing __declspec in type specifiers.
[r22015]
Christoph Mallon [Tue, 16 Sep 2008 17:54:43 +0000 (17:54 +0000)]
Do not warn about excess initialisers, when trying to initialise an incomplete compound variable.
[r22014]
Christoph Mallon [Tue, 16 Sep 2008 17:53:24 +0000 (17:53 +0000)]
Slightly simplify printing binary operators.
[r22013]
Christoph Mallon [Tue, 16 Sep 2008 12:38:38 +0000 (12:38 +0000)]
Use fputc() instead of fputs() to print a single char.
[r22006]
Christoph Mallon [Tue, 16 Sep 2008 12:37:10 +0000 (12:37 +0000)]
Print no " " between the ")" and the "{" of a compound literal.
[r22005]
Christoph Mallon [Tue, 16 Sep 2008 10:48:48 +0000 (10:48 +0000)]
abort() instead of exit(1) in case of anchor token leaks.
[r22001]
Christoph Mallon [Tue, 16 Sep 2008 10:09:34 +0000 (10:09 +0000)]
When printing AST for asm statements first print outputs, then inputs.
[r21998]
Christoph Mallon [Tue, 16 Sep 2008 09:39:36 +0000 (09:39 +0000)]
Improve parse_va_start():
- reference expressions never have no declaration, at least there is an error declaration
- do not return an invalid expression, when the second argument is a reference, but not the last parameter
- if the second parameter is invalid, still expect the ).
[r21997]
Christoph Mallon [Tue, 16 Sep 2008 09:06:10 +0000 (09:06 +0000)]
Make parsing of statements more robust in case of parser errors by avoiding endless loops, because no token gets consumed.
[r21996]
Christoph Mallon [Tue, 16 Sep 2008 07:50:06 +0000 (07:50 +0000)]
Plug anchor token leak in parse_statement_expression().
[r21995]
Christoph Mallon [Tue, 16 Sep 2008 07:19:52 +0000 (07:19 +0000)]
Plug two more anchor token underflows.
[r21994]
Christoph Mallon [Tue, 16 Sep 2008 07:16:38 +0000 (07:16 +0000)]
Fix the first anchor token leak (actually an underflow).
[r21993]
Christoph Mallon [Tue, 16 Sep 2008 07:15:53 +0000 (07:15 +0000)]
Add code to detect anchor token leaks.
[r21992]
Christoph Mallon [Tue, 16 Sep 2008 06:38:51 +0000 (06:38 +0000)]
Create a few less invalid expressions on parse errors.
[r21991]
Christoph Mallon [Tue, 16 Sep 2008 05:56:19 +0000 (05:56 +0000)]
Indentation.
[r21990]
Christoph Mallon [Tue, 16 Sep 2008 05:54:45 +0000 (05:54 +0000)]
Print \n after $invalid statement$.
[r21989]
Michael Beck [Tue, 16 Sep 2008 02:51:35 +0000 (02:51 +0000)]
reverted 21986-21986, spec failed
[r21988]
Michael Beck [Tue, 16 Sep 2008 02:26:09 +0000 (02:26 +0000)]
- more simplification and unification of compound/enum types
[r21987]
Michael Beck [Tue, 16 Sep 2008 02:09:35 +0000 (02:09 +0000)]
- when parsing compound types, do NOT destroy old declarations if
a new one with the same name is found, always create a new one
- handle enums analog
- do not record "anonymous declarations" in the AST
[r21986]
Michael Beck [Tue, 16 Sep 2008 02:07:18 +0000 (02:07 +0000)]
- do not print {} for incomplete types
[r21985]
Michael Beck [Tue, 16 Sep 2008 00:11:23 +0000 (00:11 +0000)]
- renamed is_empty to is_empty_range
- typo fixed
[r21984]
Christoph Mallon [Mon, 15 Sep 2008 19:25:01 +0000 (19:25 +0000)]
Function types only are compatible if their calling convention is the same, no matter whether they have unspecified parameter lists.
[r21983]
Christoph Mallon [Mon, 15 Sep 2008 19:21:21 +0000 (19:21 +0000)]
Remove redundant test from is_type_real() (is_type_float() checks this, too).
[r21982]
Michael Beck [Mon, 15 Sep 2008 15:23:12 +0000 (15:23 +0000)]
some wrong bitfields
[r21981]
Michael Beck [Mon, 15 Sep 2008 15:21:51 +0000 (15:21 +0000)]
- implemented semantic checks for bitfield
[r21980]
Michael Beck [Mon, 15 Sep 2008 14:57:42 +0000 (14:57 +0000)]
more work on type size
[r21978]
Christoph Mallon [Mon, 15 Sep 2008 14:35:35 +0000 (14:35 +0000)]
Do not initialise the variables declared in a for statement, if the initialisation is not reachable.
[r21976]
Christoph Mallon [Mon, 15 Sep 2008 14:12:00 +0000 (14:12 +0000)]
In strict mode do not generate an implicit function declaration, but an error declaration. This prevents stray warnings about incompatible return types later on.
[r21973]
Christoph Mallon [Mon, 15 Sep 2008 13:12:28 +0000 (13:12 +0000)]
Assert that no typerefs are passed to get_unqualified_type().
[r21968]
Christoph Mallon [Mon, 15 Sep 2008 12:50:12 +0000 (12:50 +0000)]
Get unqualified types before doing anything in semantic_arithmetic().
[r21967]
Christoph Mallon [Mon, 15 Sep 2008 09:26:22 +0000 (09:26 +0000)]
Build AST for [] even if none of the operands has pointer type. This prevents a segfault in the AST printer. Also always set a return type, even if the ] is missing.
[r21962]
Christoph Mallon [Mon, 15 Sep 2008 09:15:06 +0000 (09:15 +0000)]
Parse the unlikely case, that someone writes "variable * ..." at the beginning of a expression statement, correctly.
[r21961]
Christoph Mallon [Mon, 15 Sep 2008 08:47:29 +0000 (08:47 +0000)]
Spell the option -Wpointer-arith, not -Wpointer_arith.
[r21957]
Christoph Mallon [Mon, 15 Sep 2008 07:56:36 +0000 (07:56 +0000)]
Fix warn_div_by_zero(): The result of the division might be int and the divisor non-int for /=.
[r21956]
Christoph Mallon [Mon, 15 Sep 2008 07:36:41 +0000 (07:36 +0000)]
Spell the option -Wdiv-by-zero, not -Wdiv_by_zero.
[r21955]
Christoph Mallon [Mon, 15 Sep 2008 07:29:36 +0000 (07:29 +0000)]
For an array access being an object with constant address, the array reference may be object with constant address.
[r21954]
Christoph Mallon [Mon, 15 Sep 2008 07:21:37 +0000 (07:21 +0000)]
DeMorganise.
[r21953]
Christoph Mallon [Sun, 14 Sep 2008 21:49:41 +0000 (21:49 +0000)]
Handle the case when array access results in an address constant.
[r21952]
Christoph Mallon [Sun, 14 Sep 2008 21:18:15 +0000 (21:18 +0000)]
Correct and simplify the logic for -Wconversion.
[r21951]
Christoph Mallon [Sun, 14 Sep 2008 18:29:21 +0000 (18:29 +0000)]
Fix warning message.
[r21950]
Christoph Mallon [Sun, 14 Sep 2008 18:21:03 +0000 (18:21 +0000)]
Prevent errors about non-constant case labels in some common cases of prior errors while parsing the expression.
[r21949]
Christoph Mallon [Sun, 14 Sep 2008 17:50:19 +0000 (17:50 +0000)]
Prevent stray error messages by pretending invalid references are address constants.
[r21948]
Christoph Mallon [Sun, 14 Sep 2008 17:48:29 +0000 (17:48 +0000)]
Handle the error type in descend_into_subtype().
[r21947]
Christoph Mallon [Sun, 14 Sep 2008 17:47:08 +0000 (17:47 +0000)]
Handle the error type in get_qualified_type().
[r21946]
Christoph Mallon [Sun, 14 Sep 2008 17:10:02 +0000 (17:10 +0000)]
Fix off-by-one error in source position in diagnostic messages in parse_reference().
[r21945]
Christoph Mallon [Sun, 14 Sep 2008 16:58:33 +0000 (16:58 +0000)]
Pretend the error type is compatible with every type, to suppress stray errors. Also prevent some warnings later on when a error declaration was generated and a proper declaration follows.
[r21944]
Christoph Mallon [Sun, 14 Sep 2008 15:45:52 +0000 (15:45 +0000)]
Create AST for select expressions even if the LHS has incomplete type.
[r21943]
Michael Beck [Sun, 14 Sep 2008 15:30:43 +0000 (15:30 +0000)]
- Ugly fix: MSVC runtime does not support long double printing, cast to double yet
[r21942]
Christoph Mallon [Sun, 14 Sep 2008 15:16:20 +0000 (15:16 +0000)]
Handle typerefs in get_qualified_type().
[r21941]
Christoph Mallon [Sun, 14 Sep 2008 15:12:27 +0000 (15:12 +0000)]
Fix parsing of function declarations with redundant parentheses around the declarator name.
[r21940]
Christoph Mallon [Sun, 14 Sep 2008 15:01:15 +0000 (15:01 +0000)]
Fix printing of function types, which return function pointers: The parameter lists got swapped.
[r21939]
Christoph Mallon [Sun, 14 Sep 2008 12:00:20 +0000 (12:00 +0000)]
The result of a select expression is never a constant pointer (rather address), but always an object (it could be a object with pointer type, but this is still an object, not an addresss).
[r21938]
Christoph Mallon [Sun, 14 Sep 2008 11:12:10 +0000 (11:12 +0000)]
The result of an array access never is a constant expression.
[r21937]
Michael Beck [Sun, 14 Sep 2008 03:13:48 +0000 (03:13 +0000)]
- implemented local labels
[r21936]
Michael Beck [Sun, 14 Sep 2008 02:29:06 +0000 (02:29 +0000)]
- fixed printing of labels
[r21935]
Michael Beck [Sun, 14 Sep 2008 01:20:43 +0000 (01:20 +0000)]
- use the intel math library if compiled by the intel compiler
[r21934]
Michael Beck [Sun, 14 Sep 2008 00:58:04 +0000 (00:58 +0000)]
- add missing cases
[r21933]
Michael Beck [Sun, 14 Sep 2008 00:51:19 +0000 (00:51 +0000)]
- implemented computed goto
[r21932]
Christoph Mallon [Sat, 13 Sep 2008 18:34:55 +0000 (18:34 +0000)]
Replace some fprintf()s by the simpler fput{c,s}().
[r21931]
Michael Beck [Sat, 13 Sep 2008 18:12:13 +0000 (18:12 +0000)]
- prints correctly computed goto
- removed (old?) debugging output to stderr
[r21930]
Michael Beck [Sat, 13 Sep 2008 18:09:19 +0000 (18:09 +0000)]
- started implementation of size and alignment for types
- implemented -Wpacked, -Wpadded
[r21929]
Christoph Mallon [Sat, 13 Sep 2008 12:33:42 +0000 (12:33 +0000)]
Add get_qualified_type() and solve several problem with missing qualifiers, which lead to accepting incorrect code.
[r21928]
Christoph Mallon [Sat, 13 Sep 2008 11:20:31 +0000 (11:20 +0000)]
Remove dead code.
[r21927]
Christoph Mallon [Sat, 13 Sep 2008 11:20:23 +0000 (11:20 +0000)]
Preserve type qualifiers in parse_select_expression().
[r21926]
Christoph Mallon [Sat, 13 Sep 2008 11:02:05 +0000 (11:02 +0000)]
Small cleanup in parse_select_expression(), print unskipped type.
[r21925]
Christoph Mallon [Sat, 13 Sep 2008 10:26:59 +0000 (10:26 +0000)]
Prevent null pointer access, when printing error about parameter of incomplete type, if the parameter has no name.
[r21924]
Christoph Mallon [Sat, 13 Sep 2008 10:20:44 +0000 (10:20 +0000)]
Prevent warning about incompatible types when initializing a function like a variable. Only show the error message (which is also slightly improved).
[r21923]
Christoph Mallon [Sat, 13 Sep 2008 10:07:50 +0000 (10:07 +0000)]
Reject initialisation of k&r parameter declarations and correct warnings about redundant declarations.
[r21922]
Christoph Mallon [Sat, 13 Sep 2008 05:49:40 +0000 (05:49 +0000)]
Remove the parameter finished_declaration, which is the same for all callers, from parse_anonymous_declaration_rest().
[r21921]
Michael Beck [Sat, 13 Sep 2008 00:03:47 +0000 (00:03 +0000)]
- implemented -Wold-style-definition
[r21920]
Michael Beck [Fri, 12 Sep 2008 23:47:13 +0000 (23:47 +0000)]
testcase for -Wtraditional
[r21919]
Michael Beck [Fri, 12 Sep 2008 23:45:34 +0000 (23:45 +0000)]
- implemented most cases of -W traditional (preprocessor missing)
- implemented most cases of -Wconversion
[r21918]
Michael Beck [Fri, 12 Sep 2008 22:54:57 +0000 (22:54 +0000)]
added is_type_complex()
[r21917]
Michael Beck [Fri, 12 Sep 2008 22:38:48 +0000 (22:38 +0000)]
add %u specifier
[r21916]
Michael Beck [Fri, 12 Sep 2008 21:46:45 +0000 (21:46 +0000)]
- simplified nested #ifdef's
[r21915]
Michael Beck [Fri, 12 Sep 2008 21:45:15 +0000 (21:45 +0000)]
- implemented -Winit-self
[r21914]
Michael Beck [Fri, 12 Sep 2008 21:23:37 +0000 (21:23 +0000)]
- typo fixed
[r21912]
Christoph Mallon [Fri, 12 Sep 2008 20:26:44 +0000 (20:26 +0000)]
Make program logic a bit clearer by using a flag.
[r21911]
Christoph Mallon [Fri, 12 Sep 2008 20:14:57 +0000 (20:14 +0000)]
Slightly improve diagnostic message when accidently using . instead of ->.
[r21910]
Christoph Mallon [Fri, 12 Sep 2008 20:02:38 +0000 (20:02 +0000)]
Do not split string literals.
[r21909]
Christoph Mallon [Fri, 12 Sep 2008 20:02:24 +0000 (20:02 +0000)]
Use given storage class as declared storage class in create_error_declaration().
[r21908]
Christoph Mallon [Fri, 12 Sep 2008 19:46:47 +0000 (19:46 +0000)]
Remove the unnecessary attribute symbol from struct select_expression_t.
[r21907]
Christoph Mallon [Fri, 12 Sep 2008 19:44:24 +0000 (19:44 +0000)]
Create AST for select expressions even if the LHS is unknown or has the wrong type.
[r21906]
Christoph Mallon [Fri, 12 Sep 2008 19:11:29 +0000 (19:11 +0000)]
Create a declaration, when accessing a non-existent compound entry, so the AST contains something sensible.
[r21905]
Christoph Mallon [Fri, 12 Sep 2008 18:30:06 +0000 (18:30 +0000)]
Check whether the operand of ++/-- is an lvalue.
[r21904]
Christoph Mallon [Fri, 12 Sep 2008 18:19:48 +0000 (18:19 +0000)]
Correct precedence of call expressions for printing.
[r21903]
Christoph Mallon [Fri, 12 Sep 2008 18:01:06 +0000 (18:01 +0000)]
Correct precedence for printing ?:.
[r21902]
Christoph Mallon [Fri, 12 Sep 2008 17:21:15 +0000 (17:21 +0000)]
Do not split string literals.
[r21901]
Christoph Mallon [Fri, 12 Sep 2008 17:16:14 +0000 (17:16 +0000)]
Handle __try and __leave in check_{,un}reachable().
[r21900]
Christoph Mallon [Fri, 12 Sep 2008 14:35:41 +0000 (14:35 +0000)]
Create a few less invalid statements on parse errors.
[r21899]