cparser
16 years agoDo no include -Wswitch-default in -Wall.
Christoph Mallon [Sun, 16 Dec 2007 08:21:52 +0000 (08:21 +0000)]
Do no include -Wswitch-default in -Wall.

[r18774]

16 years ago- fixed gcc compilation
Michael Beck [Sat, 15 Dec 2007 19:02:39 +0000 (19:02 +0000)]
- fixed gcc compilation
- fixed -Wsign-compare

[r18773]

16 years ago- implemented -Wsign-compare
Michael Beck [Sat, 15 Dec 2007 18:56:02 +0000 (18:56 +0000)]
- implemented -Wsign-compare
- recognize -Wshadow (semantic not implemented yet)

[r18772]

16 years agoImproved __alignof__: If expression represents a variable, return the alignment of...
Michael Beck [Sat, 15 Dec 2007 18:29:08 +0000 (18:29 +0000)]
Improved __alignof__: If expression represents a variable, return the alignment of this variable.

[r18771]

16 years ago- fixed _-alignof__ expression: it has the same syntax like sizeof ...
Michael Beck [Sat, 15 Dec 2007 18:14:42 +0000 (18:14 +0000)]
- fixed _-alignof__ expression: it has the same syntax like sizeof ...

[r18770]

16 years agoWarn about unused global static variables, too, and do not warn about unused static...
Christoph Mallon [Sat, 15 Dec 2007 16:44:30 +0000 (16:44 +0000)]
Warn about unused global static variables, too, and do not warn about unused static *inline* functions.

[r18769]

16 years agoRemove duplicates.
Christoph Mallon [Sat, 15 Dec 2007 15:41:07 +0000 (15:41 +0000)]
Remove duplicates.

[r18768]

16 years agoAccept -Wno-all, -Wno-extra and -Wno-unused like GCC.
Christoph Mallon [Sat, 15 Dec 2007 15:39:51 +0000 (15:39 +0000)]
Accept -Wno-all, -Wno-extra and -Wno-unused like GCC.

[r18767]

16 years ago- renamed is_type_floating() to is_type_float()
Michael Beck [Sat, 15 Dec 2007 13:57:38 +0000 (13:57 +0000)]
- renamed is_type_floating() to is_type_float()
- some doxygen docu added

[r18766]

16 years agofinished -Wunused-function
Michael Beck [Sat, 15 Dec 2007 04:14:15 +0000 (04:14 +0000)]
finished -Wunused-function

[r18765]

16 years agoimplemented -Wall, -Wextra, -Wunused, -Wunused-function with limited
Michael Beck [Sat, 15 Dec 2007 04:03:40 +0000 (04:03 +0000)]
implemented -Wall, -Wextra, -Wunused, -Wunused-function with limited
functionality

[r18764]

16 years agoimproved error output for function cases
Michael Beck [Sat, 15 Dec 2007 03:47:00 +0000 (03:47 +0000)]
improved error output for function cases

[r18763]

16 years agofinished -Wunused-parameter
Michael Beck [Sat, 15 Dec 2007 03:34:02 +0000 (03:34 +0000)]
finished -Wunused-parameter

[r18762]

16 years agoprelimiraries for -Wunused-parameter and -Wunused-variable:
Michael Beck [Sat, 15 Dec 2007 03:22:36 +0000 (03:22 +0000)]
prelimiraries for -Wunused-parameter and -Wunused-variable:
- mark used declarations
- add field to link declarations
- recognize options (no warnings yet)

[r18761]

16 years ago- fixed source position of binary expressions
Michael Beck [Sat, 15 Dec 2007 03:07:35 +0000 (03:07 +0000)]
- fixed source position of binary expressions
- added initialization for -Wunused-label
- switched some warnings off by default

[r18760]

16 years ago- implemented -Wunused-label
Michael Beck [Sat, 15 Dec 2007 02:49:56 +0000 (02:49 +0000)]
- implemented -Wunused-label

[r18759]

16 years ago- implemented Wfloat-equal
Michael Beck [Sat, 15 Dec 2007 02:30:37 +0000 (02:30 +0000)]
- implemented Wfloat-equal

[r18758]

16 years ago- renamed context_t to the more logical scope_t
Michael Beck [Fri, 14 Dec 2007 23:43:07 +0000 (23:43 +0000)]
- renamed context_t to the more logical scope_t
- improved -Wmain checks
- fixed icc warnings (jumping over initialization)

[r18757]

16 years agoImplement -Wmain.
Christoph Mallon [Fri, 14 Dec 2007 19:21:54 +0000 (19:21 +0000)]
Implement -Wmain.

[r18756]

16 years agoPrint the unskipped type in warnings.
Christoph Mallon [Fri, 14 Dec 2007 18:29:09 +0000 (18:29 +0000)]
Print the unskipped type in warnings.

[r18755]

16 years agoAlso do not warn about function declarations without a prior declaration. *sigh*
Christoph Mallon [Fri, 14 Dec 2007 18:19:45 +0000 (18:19 +0000)]
Also do not warn about function declarations without a prior declaration. *sigh*

[r18754]

16 years agoSimplify condition.
Christoph Mallon [Fri, 14 Dec 2007 18:14:40 +0000 (18:14 +0000)]
Simplify condition.

[r18753]

16 years agoDo not warn about no prior declaration for extern declarations.
Christoph Mallon [Fri, 14 Dec 2007 18:11:21 +0000 (18:11 +0000)]
Do not warn about no prior declaration for extern declarations.

[r18752]

16 years agoDo not warn about no prior declaration for non-global variables, enum entries and...
Christoph Mallon [Fri, 14 Dec 2007 18:08:18 +0000 (18:08 +0000)]
Do not warn about no prior declaration for non-global variables, enum entries and static thread local variables.

[r18751]

16 years agoDo not warn about an empty statement after a label, i.e. label:;.
Christoph Mallon [Fri, 14 Dec 2007 17:44:25 +0000 (17:44 +0000)]
Do not warn about an empty statement after a label, i.e. label:;.

[r18750]

16 years agoWarn when a non-static global variable has no prior declaration.
Christoph Mallon [Fri, 14 Dec 2007 17:28:16 +0000 (17:28 +0000)]
Warn when a non-static global variable has no prior declaration.

[r18749]

16 years agoadd option -l and -L, reorganize option handler
Michael Beck [Fri, 14 Dec 2007 17:24:40 +0000 (17:24 +0000)]
add option -l and -L, reorganize option handler

[r18748]

16 years agoDo not warn, if main() has no prior declaration or prototype.
Christoph Mallon [Fri, 14 Dec 2007 17:17:35 +0000 (17:17 +0000)]
Do not warn, if main() has no prior declaration or prototype.

[r18747]

16 years agomark_private works again
Matthias Braun [Fri, 14 Dec 2007 17:02:28 +0000 (17:02 +0000)]
mark_private works again

[r18746]

16 years agodisable cc optimisations for now until they are fixed
Matthias Braun [Fri, 14 Dec 2007 17:02:01 +0000 (17:02 +0000)]
disable cc optimisations for now until they are fixed

[r18745]

16 years agono need to pass expression type around in parse_sub_initializer
Matthias Braun [Fri, 14 Dec 2007 17:02:01 +0000 (17:02 +0000)]
no need to pass expression type around in parse_sub_initializer

[r18744]

16 years agoMake warning about statement without effect less aggressive for && and ||.
Christoph Mallon [Fri, 14 Dec 2007 16:54:15 +0000 (16:54 +0000)]
Make warning about statement without effect less aggressive for && and ||.

[r18743]

16 years agofix warnings, disable empty statement warning by default
Matthias Braun [Fri, 14 Dec 2007 16:52:36 +0000 (16:52 +0000)]
fix warnings, disable empty statement warning by default

[r18742]

16 years ago-W switches are not allowed to have a whitespace after -W
Matthias Braun [Fri, 14 Dec 2007 16:52:27 +0000 (16:52 +0000)]
-W switches are not allowed to have a whitespace after -W

[r18741]

16 years agoAdd -Wempty-statement, which warns about empty statements, i.e. lone ';'
Christoph Mallon [Fri, 14 Dec 2007 10:04:41 +0000 (10:04 +0000)]
Add -Wempty-statement, which warns about empty statements, i.e. lone ';'

[r18740]

16 years agoDo not crash, when the body of an switch statement is empty.
Christoph Mallon [Fri, 14 Dec 2007 09:50:38 +0000 (09:50 +0000)]
Do not crash, when the body of an switch statement is empty.

[r18739]

16 years agoImplement -Wunknown-pragmas.
Christoph Mallon [Fri, 14 Dec 2007 09:48:32 +0000 (09:48 +0000)]
Implement -Wunknown-pragmas.

[r18738]

16 years agoImplement -Wswitch-default.
Christoph Mallon [Fri, 14 Dec 2007 09:44:12 +0000 (09:44 +0000)]
Implement -Wswitch-default.

[r18737]

16 years agoConsider type qualifiers to avoid incorrect format warnings.
Christoph Mallon [Fri, 14 Dec 2007 07:21:18 +0000 (07:21 +0000)]
Consider type qualifiers to avoid incorrect format warnings.

[r18736]

16 years agoRemove stray \n.
Christoph Mallon [Fri, 14 Dec 2007 06:36:31 +0000 (06:36 +0000)]
Remove stray \n.

[r18735]

16 years agoFix r741.
Christoph Mallon [Thu, 13 Dec 2007 22:25:35 +0000 (22:25 +0000)]
Fix r741.

[r18734]

16 years agoImplement -Wmissing_prototypes.
Christoph Mallon [Thu, 13 Dec 2007 22:04:01 +0000 (22:04 +0000)]
Implement -Wmissing_prototypes.

[r18733]

16 years agoImplement -Wunused-value.
Christoph Mallon [Thu, 13 Dec 2007 21:51:13 +0000 (21:51 +0000)]
Implement -Wunused-value.

[r18732]

16 years agoRemove unused macro.
Christoph Mallon [Thu, 13 Dec 2007 16:40:13 +0000 (16:40 +0000)]
Remove unused macro.

[r18731]

16 years agoImplement a new agile warning framework.
Christoph Mallon [Thu, 13 Dec 2007 15:26:45 +0000 (15:26 +0000)]
Implement a new agile warning framework.

[r18730]

16 years agoRemove an unnecessary NULL test, because parse_compound_statement() never returns...
Christoph Mallon [Thu, 13 Dec 2007 09:59:18 +0000 (09:59 +0000)]
Remove an unnecessary NULL test, because parse_compound_statement() never returns NULL.

[r18729]

16 years agoWarn about empty statement expressions ({}).
Christoph Mallon [Thu, 13 Dec 2007 09:57:27 +0000 (09:57 +0000)]
Warn about empty statement expressions ({}).

[r18728]

16 years agoDo no crash on empty statement expressions ({}).
Christoph Mallon [Thu, 13 Dec 2007 09:51:08 +0000 (09:51 +0000)]
Do no crash on empty statement expressions ({}).

[r18727]

16 years agoRemove unnecessary temporary variables.
Christoph Mallon [Thu, 13 Dec 2007 09:38:48 +0000 (09:38 +0000)]
Remove unnecessary temporary variables.

[r18726]

16 years agoGenerate an error, if argument and parameter type are incompatible.
Christoph Mallon [Thu, 13 Dec 2007 08:48:33 +0000 (08:48 +0000)]
Generate an error, if argument and parameter type are incompatible.

[r18725]

16 years agoRemove unnecessary tests for the error type or at least push them in error paths.
Christoph Mallon [Thu, 13 Dec 2007 08:30:02 +0000 (08:30 +0000)]
Remove unnecessary tests for the error type or at least push them in error paths.

[r18724]

16 years agoUse the error type consistently.
Christoph Mallon [Thu, 13 Dec 2007 08:12:00 +0000 (08:12 +0000)]
Use the error type consistently.

[r18723]

16 years agotest for invalid array/function types at type construction not when the declaration...
Matthias Braun [Wed, 12 Dec 2007 22:45:50 +0000 (22:45 +0000)]
test for invalid array/function types at type construction not when the declaration is created.

[r18722]

16 years agomore tricky test
Matthias Braun [Wed, 12 Dec 2007 22:44:56 +0000 (22:44 +0000)]
more tricky test

[r18721]

16 years agouse type_error_type instead of NULL
Michael Beck [Wed, 12 Dec 2007 17:41:13 +0000 (17:41 +0000)]
use type_error_type instead of NULL

[r18720]

16 years agoUse semantic_assign() properly.
Christoph Mallon [Wed, 12 Dec 2007 17:28:31 +0000 (17:28 +0000)]
Use semantic_assign() properly.

[r18719]

16 years ago- functions returning arrays are not allowed
Michael Beck [Wed, 12 Dec 2007 17:23:00 +0000 (17:23 +0000)]
- functions returning arrays are not allowed
- enum types can be incomplete like coumpound types

[r18718]

16 years ago- create an error type
Michael Beck [Wed, 12 Dec 2007 16:48:37 +0000 (16:48 +0000)]
- create an error type
- improved declaration checking

[r18717]

16 years agoadd error if array of voids is declared
Michael Beck [Wed, 12 Dec 2007 15:51:33 +0000 (15:51 +0000)]
add error if array of voids is declared

[r18716]

16 years agoabort if preprocessing fails
Matthias Braun [Wed, 12 Dec 2007 15:27:55 +0000 (15:27 +0000)]
abort if preprocessing fails

[r18715]

16 years agotest for error directive
Michael Beck [Wed, 12 Dec 2007 15:27:58 +0000 (15:27 +0000)]
test for error directive

[r18714]

16 years agoDo not generate a warning about a redundant declaration for function definitions.
Christoph Mallon [Wed, 12 Dec 2007 15:09:16 +0000 (15:09 +0000)]
Do not generate a warning about a redundant declaration for function definitions.

[r18713]

16 years agoPrint original (unskipped) type in error message.
Christoph Mallon [Wed, 12 Dec 2007 15:07:17 +0000 (15:07 +0000)]
Print original (unskipped) type in error message.

[r18712]

16 years agoCleanup.
Christoph Mallon [Wed, 12 Dec 2007 15:05:39 +0000 (15:05 +0000)]
Cleanup.

[r18711]

16 years agofixed crash with unclosed string literal
Michael Beck [Wed, 12 Dec 2007 15:05:44 +0000 (15:05 +0000)]
fixed crash with unclosed string literal

[r18710]

16 years agoRemove redundant record_declaration() call.
Christoph Mallon [Wed, 12 Dec 2007 15:02:07 +0000 (15:02 +0000)]
Remove redundant record_declaration() call.

[r18709]

16 years agoHandle string literals with embedded \0 correctly.
Christoph Mallon [Wed, 12 Dec 2007 13:44:44 +0000 (13:44 +0000)]
Handle string literals with embedded \0 correctly.

[r18708]

16 years agodesignator test
Matthias Braun [Wed, 12 Dec 2007 11:07:18 +0000 (11:07 +0000)]
designator test

[r18707]

16 years agouse allocate_statement_zero for allocating statements
Matthias Braun [Wed, 12 Dec 2007 10:45:08 +0000 (10:45 +0000)]
use allocate_statement_zero for allocating statements

[r18706]

16 years agoAdd allocate_declaration_zero() for convenience.
Christoph Mallon [Wed, 12 Dec 2007 09:43:52 +0000 (09:43 +0000)]
Add allocate_declaration_zero() for convenience.

[r18705]

16 years agoPlug minor memory leak when an error occurs while parsing enum entries.
Christoph Mallon [Wed, 12 Dec 2007 09:19:07 +0000 (09:19 +0000)]
Plug minor memory leak when an error occurs while parsing enum entries.

[r18704]

16 years agoRemove unnecessary pointer/type indirection.
Christoph Mallon [Wed, 12 Dec 2007 09:16:36 +0000 (09:16 +0000)]
Remove unnecessary pointer/type indirection.

[r18703]

16 years agoImprove error messages slightly.
Christoph Mallon [Wed, 12 Dec 2007 09:08:21 +0000 (09:08 +0000)]
Improve error messages slightly.

[r18702]

16 years agoA statement_base_t is enough space for break and continue statements.
Christoph Mallon [Wed, 12 Dec 2007 08:19:30 +0000 (08:19 +0000)]
A statement_base_t is enough space for break and continue statements.

[r18701]

16 years agoRemove stray \n in warning message.
Christoph Mallon [Wed, 12 Dec 2007 08:05:20 +0000 (08:05 +0000)]
Remove stray \n in warning message.

[r18700]

16 years agoFix off-by-two-tokens error in the location of break and continue statements.
Christoph Mallon [Wed, 12 Dec 2007 08:01:49 +0000 (08:01 +0000)]
Fix off-by-two-tokens error in the location of break and continue statements.

[r18699]

16 years agoFix checking, whether break/continue is within a loop/switch.
Christoph Mallon [Wed, 12 Dec 2007 07:51:33 +0000 (07:51 +0000)]
Fix checking, whether break/continue is within a loop/switch.

[r18698]

16 years agomade error output for missing labels gcc like
Michael Beck [Wed, 12 Dec 2007 02:49:47 +0000 (02:49 +0000)]
made error output for missing labels gcc like

[r18697]

16 years ago- added check for multiple default labels
Michael Beck [Wed, 12 Dec 2007 02:39:50 +0000 (02:39 +0000)]
- added check for multiple default labels
- added check for undefined goto labels

[r18696]

16 years agomore cases to test added
Michael Beck [Wed, 12 Dec 2007 01:51:01 +0000 (01:51 +0000)]
more cases to test added

[r18695]

16 years agoadd missing test for default
Michael Beck [Wed, 12 Dec 2007 01:50:09 +0000 (01:50 +0000)]
add missing test for default

[r18694]

16 years agocheck that break and continue are inside switches and loops
Michael Beck [Wed, 12 Dec 2007 01:47:35 +0000 (01:47 +0000)]
check that break and continue are inside switches and loops

[r18693]

16 years agotest for wrong switches
Michael Beck [Wed, 12 Dec 2007 01:39:12 +0000 (01:39 +0000)]
test for wrong switches

[r18692]

16 years agoremoved superfluous &
Michael Beck [Wed, 12 Dec 2007 01:37:58 +0000 (01:37 +0000)]
removed superfluous &

[r18691]

16 years ago- check for case labels outside a switch statement
Michael Beck [Wed, 12 Dec 2007 01:35:44 +0000 (01:35 +0000)]
- check for case labels outside a switch statement
- add infrastructure for further case label checks

[r18690]

16 years ago2 test programs I had lying around here
Matthias Braun [Wed, 12 Dec 2007 00:03:09 +0000 (00:03 +0000)]
2 test programs I had lying around here

[r18689]

16 years agoimprovements and fixes to K&R style parameter parsing
Matthias Braun [Wed, 12 Dec 2007 00:02:12 +0000 (00:02 +0000)]
improvements and fixes to K&R style parameter parsing

[r18688]

16 years agooptions -w and -Wfatal-errors implemented
Michael Beck [Tue, 11 Dec 2007 23:48:16 +0000 (23:48 +0000)]
options -w and -Wfatal-errors implemented

[r18687]

16 years agoadd test for array subscript type char
Michael Beck [Tue, 11 Dec 2007 23:32:31 +0000 (23:32 +0000)]
add test for array subscript type char

[r18686]

16 years ago- renamed atomic_type_type_t to atomic_type_kind_t
Michael Beck [Tue, 11 Dec 2007 23:30:58 +0000 (23:30 +0000)]
- renamed atomic_type_type_t to atomic_type_kind_t
- add a warning if the array subscript type is char

[r18685]

16 years agoAdd missing skip_typeref().
Christoph Mallon [Tue, 11 Dec 2007 21:52:00 +0000 (21:52 +0000)]
Add missing skip_typeref().

[r18684]

16 years agoDo default promotion on the expression of switch()es.
Christoph Mallon [Tue, 11 Dec 2007 21:41:18 +0000 (21:41 +0000)]
Do default promotion on the expression of switch()es.

[r18683]

16 years ago-Werror implemented
Michael Beck [Tue, 11 Dec 2007 21:30:48 +0000 (21:30 +0000)]
-Werror implemented

[r18682]

16 years agoOnly push an enum into the environment, if it has a name.
Christoph Mallon [Tue, 11 Dec 2007 21:19:39 +0000 (21:19 +0000)]
Only push an enum into the environment, if it has a name.

[r18681]

16 years agoIgnore type declarations when handling local variables.
Christoph Mallon [Tue, 11 Dec 2007 21:11:30 +0000 (21:11 +0000)]
Ignore type declarations when handling local variables.

[r18680]

16 years agosome doxygen docu added
Michael Beck [Tue, 11 Dec 2007 21:10:37 +0000 (21:10 +0000)]
some doxygen docu added

[r18679]

16 years agoissue a warning if returning the address of a local variable
Michael Beck [Tue, 11 Dec 2007 21:07:44 +0000 (21:07 +0000)]
issue a warning if returning the address of a local variable

[r18678]

16 years agoCorrectly register declarations for compound types and enums.
Christoph Mallon [Tue, 11 Dec 2007 21:04:01 +0000 (21:04 +0000)]
Correctly register declarations for compound types and enums.

[r18677]

16 years agoissue an error if the address of a register variable is taken.
Michael Beck [Tue, 11 Dec 2007 19:23:59 +0000 (19:23 +0000)]
issue an error if the address of a register variable is taken.

[r18676]

16 years agofixed output of warnings count
Michael Beck [Tue, 11 Dec 2007 19:20:56 +0000 (19:20 +0000)]
fixed output of warnings count

[r18675]