acqn
afdf398a0b
Fixed repeated diagnosis when reading EOF in certain cases.
2024-01-15 23:56:11 +08:00
acqn
38dac907e8
Cleanup for symbol types and flags.
2024-01-10 04:51:59 +08:00
acqn
3215d377ea
More accurate diagnostic messages on wrong missing declaration specifiers.
2023-12-10 15:46:48 +08:00
acqn
a1a060c291
Declaration specifier flags cleanup.
2023-12-10 15:43:24 +08:00
acqn
79b4690077
Fixed missing diagnostics on empty enum/struct/union declareations without tag names.
...
Improved error recovery with local declarations and _Static_assert.
2023-12-10 15:43:24 +08:00
Bob Andrews
401bcaa5ff
Merge pull request #2237 from acqn/CGType
...
[cc65] Renamed type facility functions for deciding code generation type flags
2023-10-26 19:50:10 +02:00
acqn
5fd9169904
Renamed type facility functions for deciding code generation type flags.
2022-10-12 13:10:17 +08:00
acqn
e10b5fd79b
Renamed a few functions and struct used for declaration parser.
2022-11-08 14:42:52 +08:00
Bob Andrews
680aacd4a7
Merge pull request #1907 from acqn/InputLineInfo
...
[cc65] Renamed some misleading functions relevent with input file info
2022-11-05 18:45:17 +01:00
acqn
8a7f566387
Fixed support for storage class specifiers after type specifiers.
2022-11-03 21:46:42 +08:00
acqn
e9413567d7
Renamed several functions relevent with input file info.
2022-11-02 14:16:15 +08:00
acqn
9eab36b95a
Fixed block-scope extern declarations visibility.
...
Fixed missing file-scope static function codegen output in a rare care.
2022-09-30 14:32:08 +08:00
acqn
2324bd62f6
If __A__,__AX__ or __EAX__ is used, post-inc/dec within the same statement will not modify it.
...
Moved testcase from src/test/todo to src/test/val plus minor improvement on portability.
2021-06-08 14:16:14 +08:00
acqn
fdded33097
Made it easier to support 0-size structs in the future.
2020-08-15 06:27:11 +08:00
acqn
21858b52e7
Separated data initializer stuff from declaration stuff.
2022-01-03 13:10:32 +08:00
Greg King
325ff9667e
Used (size_t), instead of (long) where converting between pointers and integers.
...
(long) still is 32 bits on 64-bit Windows!
2021-12-12 19:40:43 -05:00
acqn
18ae09f682
Less excessive errors with failed array declarations.
2021-05-14 10:48:17 +02:00
acqn
5c43d1e04f
Changed codegen for postfix inc/dec operations by deferring them till sequence points.
...
This usually allows faster & smaller code.
Note that deferred operations must still be called at sequence points even if the whole expressions containing them had constant values.
2020-10-20 22:01:55 +02:00
acqn
6b64b43395
Made local static data use a separated label pool from the code label pool.
2020-08-31 09:12:03 +02:00
acqn
504aee3835
Merge branch 'master' into StaticConst
2020-08-27 06:27:23 +08:00
acqn
1957dc7a5c
Disallowed arrays of incomplete types.
...
Fixed diagnostics on incomplete local arrays.
2020-08-26 22:14:51 +02:00
acqn
3ea3887c77
Fixed warnings on const comparison.
...
Warnings on expressions with no effects.
Fixed const ternary.
Fixed ternary with struct/union types as the true/false-branch expressions.
2020-08-20 07:52:06 +08:00
acqn
13ed557b92
Fixed compatibility checking of function declarations by using the composite types of them.
2020-08-14 18:33:54 +02:00
acqn
4dfc1a5ded
Using a dedicated SC_FICTITIOUS flag in case of parsing errors.
2020-08-12 15:01:31 +02:00
acqn
bde5be6793
Improved error message on initializing extern variables inside functions.
2020-08-12 15:01:31 +02:00
acqn
d68cd90e47
Function declaration in functions cannot have storage classes other than 'extern'.
2020-08-07 10:16:33 +02:00
acqn
8cdffc1944
No storage for unsuccessfully parsed variables.
2020-08-07 10:16:33 +02:00
Jesse Rosenstock
3df6c383c0
Add support for static_assert
...
Add C11's _Static_assert and static_assert macro.
This is like #error, but is handled at a later stage
of translation, so it is possible to check sizes of
types, values of enums, etc.
https://en.cppreference.com/w/c/language/_Static_assert
https://port70.net/~nsz/c/c11/n1570.html#6.7.10
2020-07-30 19:17:11 +02:00
acqn
78342fa82c
Fix for "auto" variables made "static" with the "-Cl" options.
2020-07-20 15:01:47 +02:00
acqn
2108489523
Fix for Issue #1075 and #1077 .
2020-07-18 12:54:29 +02:00
Greg King
a6b04f6e97
Changed most "backticks" (grave accents) into apostrophes.
...
Quotations that are embraced by tick marks now look better, in most fonts.
2019-01-05 14:57:12 -05:00
laubzega
02a914625b
Formatting fixes.
2018-10-02 18:49:53 +02:00
laubzega
c797b3b376
Proper warnings for "risky" gotos.
2018-10-02 18:49:53 +02:00
Laubzega
a4b6bb63c0
Minor changes after review.
2018-10-02 18:49:53 +02:00
Laubzega
581c46c213
Add checks for risky goto statements.
2018-10-02 18:49:53 +02:00
Greg King
0390c34e88
Changed multi-line C comments into another style.
...
The left side doesn't look unbalanced.
2014-06-30 16:51:07 -04:00
Oliver Schmidt
4185caf855
Normalized code.
2014-03-04 01:11:19 +01:00
Oliver Schmidt
85885001b1
Removed (pretty inconsistently used) tab chars from source code base.
2013-05-09 13:57:12 +02:00
uz
fd679d92d0
Fixed a problem: When a struct or unit was declared with a tag name, it was
...
possible to use the opposite type with the tag name. That is "struct a" after
declaring "union a" and vice versa.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5980 b7a2c559-68d2-44c3-8de9-860c34a00d81
2013-02-02 22:31:26 +00:00
uz
cd7e65f97e
Fixed an uniniitalized variable which caused ranom error messages on static
...
local variables.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5650 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-04-22 21:38:31 +00:00
uz
faf58a8220
Fixed an error when parsing local variables: Variables must be inserted into
...
the symbol table *before* the optional initializer is parsed, because they
might be referenced in the intializer.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5648 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-04-22 18:08:45 +00:00
uz
724d1b9160
Fixed an error: When determining where to place initialized data, the compiler
...
didn't look "deep enough" into nested arrays to determine the constness
correctly.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5622 b7a2c559-68d2-44c3-8de9-860c34a00d81
2012-03-24 14:28:59 +00:00
uz
64b597017a
Fix the check for constant static local data, which was wrong when the data
...
was an array. It should go into RODATA, not DATA.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4669 b7a2c559-68d2-44c3-8de9-860c34a00d81
2010-05-27 19:47:13 +00:00
uz
7687489a08
Fixed a bug in the last change. For variables that have no initializer, no
...
storage was allocated if -Cl (static locals) was in effect.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4390 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-26 10:17:17 +00:00
uz
bd45df7cad
Rearranged/duplicated optimization steps to generate better code in a few
...
cases.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4387 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-23 10:03:46 +00:00
uz
814be2524b
Restructured parts of locals.c. This will also fix a problem where arrays with
...
unspecified size but an initializer would cause an error when -Cl (static
locals) was in effect.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4385 b7a2c559-68d2-44c3-8de9-860c34a00d81
2009-10-23 09:22:17 +00:00
uz
24c6e1ce5b
Move some storage class handling and checking for implicit into from locals.c
...
and compile.c into ParseDecl() (declare.c).
git-svn-id: svn://svn.cc65.org/cc65/trunk@3867 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 18:20:12 +00:00
uz
841ea0e686
Transfer the storage class flags from struct DeclSpec into struct Declaration.
...
git-svn-id: svn://svn.cc65.org/cc65/trunk@3866 b7a2c559-68d2-44c3-8de9-860c34a00d81
2008-08-03 18:00:05 +00:00
cuz
fd7e66f24c
Fixed an error.
...
git-svn-id: svn://svn.cc65.org/cc65/trunk@3784 b7a2c559-68d2-44c3-8de9-860c34a00d81
2007-07-03 16:01:51 +00:00
cuz
5c1bc2d740
Output warnings for implicit int types if std >= C99.
...
git-svn-id: svn://svn.cc65.org/cc65/trunk@3361 b7a2c559-68d2-44c3-8de9-860c34a00d81
2005-01-09 18:03:55 +00:00