1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-26 20:29:34 +00:00
Commit Graph

102 Commits

Author SHA1 Message Date
Bob Andrews
f7cf14bf58
Merge pull request #2246 from acqn/ArrayFix
[cc65] Fixes for nested unspecified-length/flexible arrays
2023-10-29 12:10:30 +01:00
acqn
85e63e99a6 Fixed regression: array element of incomplete type. 2023-10-27 21:51:45 +08:00
acqn
20c3e994c6 Fixed compiling with pragmas in the middle of declarations or statements. 2023-10-04 21:22:04 +08:00
acqn
0028b14071 The type category in a function definition cannot be inherited from a typedef. 2023-10-05 17:48:16 +08:00
acqn
eb595b1f5f Improved error recovery with K&R-style function declarations. 2022-11-12 12:28:27 +08:00
acqn
e10b5fd79b Renamed a few functions and struct used for declaration parser. 2022-11-08 14:42:52 +08:00
acqn
8a7f566387 Fixed support for storage class specifiers after type specifiers. 2022-11-03 21:46:42 +08:00
acqn
a2dfa7c721 More consistent names for SymEntry functions. 2022-10-12 13:10:17 +08:00
acqn
d1e84a6dae Avoided unnecessary BSS name duplication for tentative global variables. 2022-10-11 14:23:21 +08:00
acqn
2cda47cd36 More descriptive names for SymEntry usage. 2022-10-11 14:14:48 +08:00
acqn
43d2fd2a96 Added support for the popular __COUNTER__ macro. 2022-07-24 23:19:05 +08:00
acqn
0063f73f8a Fixed __FILE__ and __LINE__ macros for preprocessor. 2022-07-24 23:19:05 +08:00
Bob Andrews
03421694b2
Merge pull request #1817 from acqn/PPFix
[cc65] More preprocessor fixes
2022-08-19 21:37:16 +02:00
acqn
3fbefdef45 Fixed warning on forward declaration of enums.
Fixed the issue that global static variables put on zeropage were missing optimization.
2022-08-19 18:48:52 +08:00
acqn
f8d08b1e1a More post-C99 predefined macros. 2022-07-26 21:40:19 +08:00
acqn
2f357ba9b2 Preprocessor directives can now appear in the argument list of function-like macro calls.
#pragma PP-tokens can now be macro replaced.
#include header names directly enclosed in <> are free of macro replacement.
Preprocess-only mode (-E) now outputs with #line as source info.
Moved testcases for #760 and #1357.
Added testcase for #1643.
2022-07-26 21:10:38 +08:00
acqn
60c1290468 Fixed the bug that preprocessor could run past the end of included files.
Fixed the wrong filename and 0 line number in disgnostics when a preprocessor error occurred at the end of a file.
Fixed diagnostics for missing #endif.
2022-07-26 21:10:26 +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
acqn
18ae09f682 Less excessive errors with failed array declarations. 2021-05-14 10:48:17 +02:00
acqn
896f463a23 Used more specific pointers instead of the "arbitary attribute pointer" used in type strings. 2021-04-19 15:36:55 +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
262c4235df Symbols in ZP segments will use '.exportzp' instead of '.export' if exported. 2020-10-11 23:05:20 +02:00
acqn
d02b12fa6c Made local code/data labels really local to the functions where they live in. 2020-09-18 09:02:16 +02:00
acqn
1957dc7a5c Disallowed arrays of incomplete types.
Fixed diagnostics on incomplete local arrays.
2020-08-26 22:14:51 +02:00
acqn
f206833a20 Alternative fix for Issue #1167. 2020-08-17 20:31:02 +02: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
43efc256f1 Changed error/warning messages not using the term 'tentative' according to PR reviews. 2020-08-07 10:16:33 +02:00
acqn
b2d3b8379c Warning about forward declaration of enum types in non-cc65 modes. 2020-08-07 10:16:33 +02:00
acqn
8cdffc1944 No storage for unsuccessfully parsed variables. 2020-08-07 10:16:33 +02:00
acqn
fdef067629 Fixed tentative definition of variables of incomplete types that may be completed later.
Tenative arrays that never get completed are now assumed each to have one element.
2020-08-07 10:16:33 +02:00
acqn
fdd120db49 Enabled to output errors and warnings about tentative definitions. 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
65081aebed Made able to recognize global declarations of static arrays. Fixed Issue #975. 2020-07-21 18:23:52 +02:00
acqn
0250c87ac6 Fixed SC_* type masks by making them all bitwise-exclusive. 2020-07-21 18:23:52 +02:00
acqn
07a5324a81 Fixed Issue #1028 by outputing local literals when exiting the function scope. 2020-06-01 22:37:40 +02:00
Greg King
a0db846a97 Allowed old-style (K and R) function declarations to be fastcall.
That lets them match old-style definitions.  It avoids "Type conflict" error messages.  It allows shorter function calls.

Fixed the types of some variables in "test/ref/otccex.c".  It avoids crashes on 64-bit Windows (32-bit Windows with 64-bit pointers).
2019-07-22 09:26:23 -04:00
Greg King
644d623d31 Reset the name of the "current bss segment" before writing bss variables into the output Assembly file.
Then, cc65 can notice a single "#pragma bss-name()" at the beginning of the variables list.
2019-05-18 12:16:52 -04: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
Greg King
d3ccc289c1 Stopped cc65 from putting redundant .segment directives into its Assembly output. 2017-06-16 21:53:50 -04:00
Oliver Schmidt
02daf9f8b5 So far the built-in inlining of several known standard function was always (!) enabled and the option -Os enabled additional, potentially unsafe inlining of some of those functions.
There were two aspects of this behavior that were considered undesirable:
- Although the safe inlining is in general desirable it should only be enabled if asked for it - like any other optimization.
- The option name -Os implies that it is a safe option, the potentially unsafe inlining should have a more explicit name.

So now:
- The option -Os enables the safe inlining.
- The new option --eagerly-inline-funcs enables the potentially unsafe inlining (including the safe inlining).

Additionally was added:
- The option --inline-stdfuncs that does like -Os enable the safe inlining but doesn't enable optimizations.
- The pragma inline-stdfuncs that works identical to --inline-stdfuncs.
- The pragma allow-eager-inline that enables the potentially unsafe inlining but doesn't include the safe inlining. That means that by itself it only marks code as safe for potentially unsafe inlining but doesn't actually enable any inlining.
2017-04-03 23:20:26 +02:00
Piotr Fusik
8e35a82c91 Fix regression of #pragma bss-name
Closes #409
2017-03-21 22:35:25 +01:00
Piotr Fusik
5988ec37cd Revert "Disallow global variable declarations with an initializer."
This reverts commit 1f12a06f7c.
2017-02-15 18:51:27 +01:00
Piotr Fusik
31f19fbc65 Issue an error for duplicate global variables.
Previously it was an assembler error.
2017-02-13 21:10:21 +01:00
Piotr Fusik
730d01a25f Global uninitialized variable is only a tentative definition.
Closes #204
2017-02-13 21:04:45 +01:00
Piotr Fusik
1f12a06f7c Disallow global variable declarations with an initializer.
E.g.
extern int i = 42;
2017-02-13 19:41:05 +01: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