cparser
12 years agodo not add searchpath stuff into parse_headername
Matthias Braun [Tue, 19 Jul 2011 10:29:27 +0000 (12:29 +0200)]
do not add searchpath stuff into parse_headername

12 years agofix preprocessing token registration
Matthias Braun [Mon, 18 Jul 2011 17:51:54 +0000 (19:51 +0200)]
fix preprocessing token registration

12 years agoupdate preprocessor tests
Matthias Braun [Mon, 18 Jul 2011 17:32:12 +0000 (19:32 +0200)]
update preprocessor tests

12 years agoadapt preprocessor to coding standards
Matthias Braun [Mon, 18 Jul 2011 17:13:03 +0000 (19:13 +0200)]
adapt preprocessor to coding standards

12 years agopreprocessor: cleanup, use new input functions
Matthias Braun [Mon, 18 Jul 2011 17:10:38 +0000 (19:10 +0200)]
preprocessor: cleanup, use new input functions

12 years agofactor out input-reading code from lexer.c into input.c
Matthias Braun [Mon, 18 Jul 2011 13:56:14 +0000 (15:56 +0200)]
factor out input-reading code from lexer.c into input.c

12 years agoremove support for compiler-builtin c-code (it was broken anyway and never produced...
Matthias Braun [Mon, 18 Jul 2011 12:55:18 +0000 (14:55 +0200)]
remove support for compiler-builtin c-code (it was broken anyway and never produced faster code)

12 years agoadapt to firm taking of parameter address changes
Matthias Braun [Wed, 23 Mar 2011 18:06:14 +0000 (19:06 +0100)]
adapt to firm taking of parameter address changes

12 years agoGCC compatibility: Parse attributes after labels in C mode.
Christoph Mallon [Sat, 30 Jul 2011 08:27:58 +0000 (10:27 +0200)]
GCC compatibility: Parse attributes after labels in C mode.

- This is necessary to compile 403.gcc.
- TODO: Process the attributes and not just ignore them.

12 years agoIncrease size of anchor token counters.
Christoph Mallon [Fri, 29 Jul 2011 08:59:10 +0000 (10:59 +0200)]
Increase size of anchor token counters.

This is necessary if there is deep nesting like in 403.gcc.

12 years agoRemove unused macro.
Christoph Mallon [Fri, 29 Jul 2011 08:59:01 +0000 (10:59 +0200)]
Remove unused macro.

12 years agouse bool flag instead of UNARY_CAST_IMPLICIT
Matthias Braun [Thu, 28 Jul 2011 12:08:13 +0000 (14:08 +0200)]
use bool flag instead of UNARY_CAST_IMPLICIT

this also fixes constexpr6.c

12 years agofix a few warnings reported by cparser
Matthias Braun [Thu, 14 Jul 2011 08:27:07 +0000 (10:27 +0200)]
fix a few warnings reported by cparser

12 years ago-Winit-self is useless (and produces wrong warnings), remove it and make it a compati...
Matthias Braun [Thu, 14 Jul 2011 08:24:57 +0000 (10:24 +0200)]
-Winit-self is useless (and produces wrong warnings), remove it and make it a compatibility nop-switch

12 years agoSupport maximum field width in scanf() check.
Christoph Mallon [Fri, 8 Jul 2011 11:53:45 +0000 (13:53 +0200)]
Support maximum field width in scanf() check.

12 years agoRemove dead assignment.
Christoph Mallon [Fri, 8 Jul 2011 11:52:12 +0000 (13:52 +0200)]
Remove dead assignment.

12 years agoSupport '*' (suppress assignment) in scanf() check.
Christoph Mallon [Fri, 8 Jul 2011 11:46:36 +0000 (13:46 +0200)]
Support '*' (suppress assignment) in scanf() check.

12 years agoscanf({"%c","%lc"}) requieres a pointer to {char,wchar_t}, not {int,wint_t}.
Christoph Mallon [Fri, 8 Jul 2011 11:43:29 +0000 (13:43 +0200)]
scanf({"%c","%lc"}) requieres a pointer to {char,wchar_t}, not {int,wint_t}.

12 years agoRemove duplicate test.
Christoph Mallon [Fri, 8 Jul 2011 11:36:26 +0000 (13:36 +0200)]
Remove duplicate test.

Doing the test later on is sufficient.
The code inbetween does nothing when encountering '\0'.

12 years agoReduce code duplication.
Christoph Mallon [Fri, 8 Jul 2011 10:10:51 +0000 (12:10 +0200)]
Reduce code duplication.

12 years agoOoops, streq is the right function here.
Sebastian Buchwald [Fri, 8 Jul 2011 11:41:56 +0000 (13:41 +0200)]
Ooops, streq is the right function here.

12 years agoOops, fixed compile error.
Sebastian Buchwald [Fri, 8 Jul 2011 11:29:05 +0000 (13:29 +0200)]
Oops, fixed compile error.

12 years agoUse an example from the list above.
Sebastian Buchwald [Fri, 8 Jul 2011 08:10:19 +0000 (10:10 +0200)]
Use an example from the list above.

12 years agoDo not parse meaningless fno-... options.
Sebastian Buchwald [Fri, 8 Jul 2011 07:42:15 +0000 (09:42 +0200)]
Do not parse meaningless fno-... options.

This affects:
- showing the help text
- enabling floating points models

12 years agoAdded missing help entry.
Sebastian Buchwald [Fri, 8 Jul 2011 07:41:14 +0000 (09:41 +0200)]
Added missing help entry.

12 years agoConsistently use upper case in help text.
Sebastian Buchwald [Fri, 8 Jul 2011 07:08:28 +0000 (09:08 +0200)]
Consistently use upper case in help text.

12 years agoReplaced n't by not.
Sebastian Buchwald [Fri, 8 Jul 2011 07:06:35 +0000 (09:06 +0200)]
Replaced n't by not.

12 years agoImproved help message.
Sebastian Buchwald [Thu, 7 Jul 2011 11:16:52 +0000 (13:16 +0200)]
Improved help message.

12 years agoOne help entry for -ffp-precise is sufficient.
Sebastian Buchwald [Thu, 7 Jul 2011 11:16:00 +0000 (13:16 +0200)]
One help entry for -ffp-precise is sufficient.

12 years agoFixed error message.
Sebastian Buchwald [Thu, 7 Jul 2011 10:43:43 +0000 (12:43 +0200)]
Fixed error message.

12 years agoProperly handle %{h,hh}{d,u} in the printf format checker.
Christoph Mallon [Thu, 7 Jul 2011 12:13:16 +0000 (14:13 +0200)]
Properly handle %{h,hh}{d,u} in the printf format checker.

12 years agoWarn that the '0' flag is ignored, if the precision is present in a format specification.
Christoph Mallon [Thu, 7 Jul 2011 12:12:18 +0000 (14:12 +0200)]
Warn that the '0' flag is ignored, if the precision is present in a format specification.

12 years agoParse __extension__ like GCC: It must not appear in declaration specifiers.
Christoph Mallon [Tue, 5 Jul 2011 09:36:28 +0000 (11:36 +0200)]
Parse __extension__ like GCC: It must not appear in declaration specifiers.

12 years agoParse __extension__ like GCC: It must not appear at the start of parameter declarations.
Christoph Mallon [Tue, 5 Jul 2011 09:37:47 +0000 (11:37 +0200)]
Parse __extension__ like GCC: It must not appear at the start of parameter declarations.

12 years agoParse __extension__ like GCC: It must not appear in typeof().
Christoph Mallon [Tue, 5 Jul 2011 09:35:37 +0000 (11:35 +0200)]
Parse __extension__ like GCC: It must not appear in typeof().

12 years agoParse __extension__ like GCC: Compound entry declarations may start with it.
Christoph Mallon [Tue, 5 Jul 2011 09:52:14 +0000 (11:52 +0200)]
Parse __extension__ like GCC: Compound entry declarations may start with it.

12 years agoParse __extension__ like GCC: External declarations may start with it.
Christoph Mallon [Tue, 5 Jul 2011 09:51:24 +0000 (11:51 +0200)]
Parse __extension__ like GCC: External declarations may start with it.

12 years agoAdd PUSH_EXTENSION()/POP_EXTENSION() to reduce code duplication.
Christoph Mallon [Tue, 5 Jul 2011 09:41:22 +0000 (11:41 +0200)]
Add PUSH_EXTENSION()/POP_EXTENSION() to reduce code duplication.

12 years agoC99: Declarations are not allowed as inner statements (they are no statements in...
Christoph Mallon [Thu, 30 Jun 2011 04:39:16 +0000 (06:39 +0200)]
C99: Declarations are not allowed as inner statements (they are no statements in C99).

12 years agoWrap switching scopes in the macros PUSH_SCOPE() and POP_SCOPE().
Christoph Mallon [Wed, 29 Jun 2011 07:28:51 +0000 (09:28 +0200)]
Wrap switching scopes in the macros PUSH_SCOPE() and POP_SCOPE().

12 years agoAssert in POP_PARENT() that the statement pushed in the corresponding PUSH_PARENT...
Christoph Mallon [Wed, 29 Jun 2011 07:20:22 +0000 (09:20 +0200)]
Assert in POP_PARENT() that the statement pushed in the corresponding PUSH_PARENT() is still on top.

12 years agoConsistently use PUSH_PARENT()/POP_PARENT().
Christoph Mallon [Wed, 29 Jun 2011 07:18:27 +0000 (09:18 +0200)]
Consistently use PUSH_PARENT()/POP_PARENT().

This corrects having the wrong parent after parsing an inner function.

12 years agoTurn POP_PARENT into a function-like macro for visual consistency.
Christoph Mallon [Wed, 29 Jun 2011 06:46:00 +0000 (08:46 +0200)]
Turn POP_PARENT into a function-like macro for visual consistency.

12 years agoImprove error handling: Do not jump to the error_label if expect() finally finds...
Christoph Mallon [Mon, 27 Jun 2011 14:08:05 +0000 (16:08 +0200)]
Improve error handling: Do not jump to the error_label if expect() finally finds the expected token after dropping some others.

12 years agoRecord correct source position for compound literals.
Christoph Mallon [Mon, 27 Jun 2011 13:04:58 +0000 (15:04 +0200)]
Record correct source position for compound literals.

12 years agoDo not redundantly set the source position again after allocate_expression_zero(...
Christoph Mallon [Mon, 27 Jun 2011 12:46:38 +0000 (14:46 +0200)]
Do not redundantly set the source position again after allocate_expression_zero() did it.

12 years agoSimplify is_octal_digit().
Christoph Mallon [Mon, 27 Jun 2011 09:18:13 +0000 (11:18 +0200)]
Simplify is_octal_digit().

12 years agoPrevent endless loop parse_compound_type_entries().
Christoph Mallon [Mon, 27 Jun 2011 09:10:06 +0000 (11:10 +0200)]
Prevent endless loop parse_compound_type_entries().

12 years agoCorrect off-by-one-token error when allocating attributes.
Christoph Mallon [Mon, 27 Jun 2011 05:17:32 +0000 (07:17 +0200)]
Correct off-by-one-token error when allocating attributes.

12 years agoRecord the position of attributes.
Christoph Mallon [Mon, 27 Jun 2011 05:15:58 +0000 (07:15 +0200)]
Record the position of attributes.

The mechanism is there, some warning messages show the position, but recording it was missing in allocate_attribute_zero().

12 years agoCorrect token encoding: wide string literals L"" and -> shared the same enum value
Christoph Mallon [Mon, 27 Jun 2011 04:57:37 +0000 (06:57 +0200)]
Correct token encoding: wide string literals L"" and -> shared the same enum value

- This resulted in wrong error messages when an unexpected -> was found in the input.
- Remove the magic 265 (used explicitly by ->) by reordering the tokens.

12 years agoAdd missing TYPE_REFERENCE to get_type_struct_size().
Christoph Mallon [Mon, 27 Jun 2011 04:52:34 +0000 (06:52 +0200)]
Add missing TYPE_REFERENCE to get_type_struct_size().

12 years agoCorrect off-by-one-token error in parse_return().
Christoph Mallon [Mon, 27 Jun 2011 04:50:56 +0000 (06:50 +0200)]
Correct off-by-one-token error in parse_return().

12 years agoRemove ancient assignments to source_position in parse_subexpression().
Christoph Mallon [Sat, 25 Jun 2011 08:47:03 +0000 (10:47 +0200)]
Remove ancient assignments to source_position in parse_subexpression().

These are obsolete (and wrong) since allocate_expression_zero() sets the source_position.

12 years agoMerge branch 'makefilefix'
Andreas Zwinkau [Fri, 24 Jun 2011 14:00:58 +0000 (16:00 +0200)]
Merge branch 'makefilefix'

12 years agoRemove firm_cmdline from Makefile
Andreas Zwinkau [Fri, 24 Jun 2011 14:00:08 +0000 (16:00 +0200)]
Remove firm_cmdline from Makefile

12 years agoSimplify daisy-chaining parameters in make_function_type().
Christoph Mallon [Fri, 24 Jun 2011 06:15:52 +0000 (08:15 +0200)]
Simplify daisy-chaining parameters in make_function_type().

12 years agoMake type_obst static and remove unnecessary pointer indirection.
Christoph Mallon [Fri, 24 Jun 2011 05:55:33 +0000 (07:55 +0200)]
Make type_obst static and remove unnecessary pointer indirection.

12 years agoRemove duplicate allocate_parameter().
Christoph Mallon [Fri, 24 Jun 2011 05:53:58 +0000 (07:53 +0200)]
Remove duplicate allocate_parameter().

12 years agoUse allocate_type_zero() to reduce code duplication.
Christoph Mallon [Fri, 24 Jun 2011 05:46:51 +0000 (07:46 +0200)]
Use allocate_type_zero() to reduce code duplication.

12 years agoInline allocate_ast() into its only caller (allocate_ast_zero()).
Christoph Mallon [Thu, 23 Jun 2011 08:46:11 +0000 (10:46 +0200)]
Inline allocate_ast() into its only caller (allocate_ast_zero()).

12 years agoSimplify some do-while-0 macros.
Christoph Mallon [Wed, 22 Jun 2011 06:34:10 +0000 (08:34 +0200)]
Simplify some do-while-0 macros.

12 years agoImplement -f[no-]diagnostics-show-option.
Christoph Mallon [Wed, 22 Jun 2011 05:44:19 +0000 (07:44 +0200)]
Implement -f[no-]diagnostics-show-option.

12 years ago"For example" is "e.g." (exempli gratia), not "i.e." (id est), which means "that...
Christoph Mallon [Wed, 22 Jun 2011 05:29:15 +0000 (07:29 +0200)]
"For example" is "e.g." (exempli gratia), not "i.e." (id est), which means "that is".

13 years agoMake warning switch parsing compatible to GCC: -W[no-][error=]warning.
Christoph Mallon [Tue, 21 Jun 2011 20:22:54 +0000 (22:22 +0200)]
Make warning switch parsing compatible to GCC: -W[no-][error=]warning.

13 years agoFix regression: A format argument went missing.
Christoph Mallon [Tue, 21 Jun 2011 16:07:43 +0000 (18:07 +0200)]
Fix regression: A format argument went missing.

13 years agoImprove diagnostic handling: Add [-Wfoo] and -Werror-foo.
Christoph Mallon [Tue, 21 Jun 2011 13:43:56 +0000 (15:43 +0200)]
Improve diagnostic handling: Add [-Wfoo] and -Werror-foo.

- Print the name of the warning switch at the end of each warning message, e.g. [-Wfoo]
- Every warning can now be turned into an error with -Werror-foo.

13 years agoDo not generate warnings for implicit declarations in record_entity().
Christoph Mallon [Tue, 21 Jun 2011 12:35:50 +0000 (14:35 +0200)]
Do not generate warnings for implicit declarations in record_entity().

13 years agoReduce code duplication.
Christoph Mallon [Tue, 21 Jun 2011 12:20:27 +0000 (14:20 +0200)]
Reduce code duplication.

The duplicate contained a bug, of course: The shown position was wrong.

13 years agoAdd %N and %#N for printing entities to diagnosticf().
Christoph Mallon [Tue, 21 Jun 2011 09:20:25 +0000 (11:20 +0200)]
Add %N and %#N for printing entities to diagnosticf().

13 years agoSort format specifiers in comment for diagnosticf() and add missing variants.
Christoph Mallon [Tue, 21 Jun 2011 09:13:29 +0000 (11:13 +0200)]
Sort format specifiers in comment for diagnosticf() and add missing variants.

13 years agoReduce code duplication in semantic_comparison().
Christoph Mallon [Tue, 21 Jun 2011 09:03:02 +0000 (11:03 +0200)]
Reduce code duplication in semantic_comparison().

13 years agoRemove unnecessary goto.
Christoph Mallon [Fri, 17 Jun 2011 11:12:33 +0000 (13:12 +0200)]
Remove unnecessary goto.

13 years agorename is_address_constant to is_linker_constant, document functions
Matthias Braun [Tue, 21 Jun 2011 12:04:50 +0000 (14:04 +0200)]
rename is_address_constant to is_linker_constant, document functions

13 years agofix is_address_constant EXPR_SELECT case
Matthias Braun [Tue, 21 Jun 2011 12:03:15 +0000 (14:03 +0200)]
fix is_address_constant  EXPR_SELECT case

13 years agoadd missing EXPR_SELECT case in is_address_constant
Matthias Braun [Mon, 20 Jun 2011 17:24:02 +0000 (19:24 +0200)]
add missing EXPR_SELECT case in is_address_constant

13 years agofix cparser warnings
Matthias Braun [Fri, 17 Jun 2011 19:15:53 +0000 (21:15 +0200)]
fix cparser warnings

13 years agofix a bunch of warnings (reported by cparser)
Matthias Braun [Wed, 15 Jun 2011 17:03:21 +0000 (19:03 +0200)]
fix a bunch of warnings (reported by cparser)

13 years agoadd -Wmissing-declarations to -Wall
Matthias Braun [Wed, 15 Jun 2011 13:33:50 +0000 (15:33 +0200)]
add -Wmissing-declarations to -Wall

13 years agoquery firm backend for machine_size and long double size
Matthias Braun [Wed, 15 Jun 2011 13:00:28 +0000 (15:00 +0200)]
query firm backend for machine_size and long double size

13 years agoremove strange warning
Matthias Braun [Wed, 15 Jun 2011 12:57:04 +0000 (14:57 +0200)]
remove strange warning

A warning which notifies me that I use a GNU extension is strange.
If I don't want to use them I can do -std=c99 and turn the situation
into an error. When I do use them I don't(!) want to see a warning.

13 years agofix some cparser warnings
Matthias Braun [Wed, 15 Jun 2011 12:56:20 +0000 (14:56 +0200)]
fix some cparser warnings

13 years agoMake error correction more robust when the parser encounters a storage class where...
Christoph Mallon [Fri, 17 Jun 2011 07:15:17 +0000 (09:15 +0200)]
Make error correction more robust when the parser encounters a storage class where it only expected a typename.

13 years agoImprove error message for invalid types in array access.
Christoph Mallon [Fri, 17 Jun 2011 04:54:28 +0000 (06:54 +0200)]
Improve error message for invalid types in array access.

13 years agoCorrect wrong positions in error/warning messages.
Christoph Mallon [Thu, 16 Jun 2011 16:43:46 +0000 (18:43 +0200)]
Correct wrong positions in error/warning messages.

13 years agos/threat/treat/.
Christoph Mallon [Fri, 17 Jun 2011 04:09:28 +0000 (06:09 +0200)]
s/threat/treat/.

13 years agoRemove unnecessary goto.
Christoph Mallon [Fri, 17 Jun 2011 04:04:38 +0000 (06:04 +0200)]
Remove unnecessary goto.

13 years agoMark a label as used when it is actually used, not later on in the label checker.
Christoph Mallon [Fri, 17 Jun 2011 03:45:07 +0000 (05:45 +0200)]
Mark a label as used when it is actually used, not later on in the label checker.

13 years agoLet get_label() handle consuming the label identifier instead of all its callers.
Christoph Mallon [Thu, 16 Jun 2011 21:00:26 +0000 (23:00 +0200)]
Let get_label() handle consuming the label identifier instead of all its callers.

13 years agoClean up get_label().
Christoph Mallon [Thu, 16 Jun 2011 20:15:01 +0000 (22:15 +0200)]
Clean up get_label().

13 years agoPass the symbol to allocate_entity_zero() instead of setting it later on.
Christoph Mallon [Thu, 16 Jun 2011 17:27:47 +0000 (19:27 +0200)]
Pass the symbol to allocate_entity_zero() instead of setting it later on.

13 years agoPass the namespace to allocate_entity_zero() instead of setting it later on.
Christoph Mallon [Thu, 16 Jun 2011 17:07:58 +0000 (19:07 +0200)]
Pass the namespace to allocate_entity_zero() instead of setting it later on.

13 years agoDo not bail out on simple typo of put/get in parse_attribute_ms_property().
Christoph Mallon [Thu, 16 Jun 2011 14:22:21 +0000 (16:22 +0200)]
Do not bail out on simple typo of put/get in parse_attribute_ms_property().

13 years agoRemove unnecessary error message.
Christoph Mallon [Thu, 16 Jun 2011 14:46:16 +0000 (16:46 +0200)]
Remove unnecessary error message.

If this case is entered, there was an error message that the declarator is abstract before.

13 years agoSimplify format string in error message.
Christoph Mallon [Thu, 16 Jun 2011 14:08:44 +0000 (16:08 +0200)]
Simplify format string in error message.

13 years agoRemove if (type != NULL), which due to prior program logic cannot be false.
Christoph Mallon [Thu, 16 Jun 2011 13:47:33 +0000 (15:47 +0200)]
Remove if (type != NULL), which due to prior program logic cannot be false.

13 years agoCorrect off-by-one error when checking whether the end of the GNU attribute list...
Christoph Mallon [Thu, 16 Jun 2011 13:29:40 +0000 (15:29 +0200)]
Correct off-by-one error when checking whether the end of the GNU attribute list was reached.

13 years agoDo not unnecessarily bail out early when encountering certain parse errors.
Christoph Mallon [Thu, 16 Jun 2011 12:32:17 +0000 (14:32 +0200)]
Do not unnecessarily bail out early when encountering certain parse errors.

13 years agoCorrect off-by-one-token error in warning.
Christoph Mallon [Thu, 16 Jun 2011 09:31:29 +0000 (11:31 +0200)]
Correct off-by-one-token error in warning.

13 years agoHandle the initial memset() of the declaration specifier struct in parse_declaration_...
Christoph Mallon [Thu, 16 Jun 2011 05:22:20 +0000 (07:22 +0200)]
Handle the initial memset() of the declaration specifier struct in parse_declaration_specifiers().