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

113 Commits

Author SHA1 Message Date
Bob Andrews
998dfd6fa7
Merge pull request #2370 from acqn/VisibilityFix
[cc65] Fixed visibility of undeclared functions and objects
2024-01-22 18:31:47 +01:00
acqn
0b06c34dfc Added primitive support for the ISO C99 inline feature as well as the __inline__ extension.
No inlining is actually done but that part is not required by the standard.
2024-01-14 00:08:41 +08:00
acqn
3d0dc58153 Fixed visibility of undeclared functions and objects. 2024-01-13 00:46:14 +08:00
acqn
38dac907e8 Cleanup for symbol types and flags. 2024-01-10 04:51:59 +08:00
Bob Andrews
9e3d1e1027
Merge pull request #2309 from acqn/Diagnostics
[cc65] Added warning on static functions that are used but not defined
2023-12-31 19:15:48 +01:00
acqn
a5746227dc Added warning on static functions that are used but not defined. 2023-12-14 21:27:48 +08:00
acqn
1e4d1b4311 Fixed function declarator parser when a parameter has a function type.
Ensured check on parameter lists without types in non-definition declarations.
2023-12-14 02:34:03 +08:00
acqn
3215d377ea More accurate diagnostic messages on wrong missing declaration specifiers. 2023-12-10 15:46:48 +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
acqn
c0a2021d9a Fixed endlessly repeated disgnostics when there are some certain patterns of syntax errors in a struct/union declaration. 2023-11-30 00:35:30 +08:00
acqn
7574e36e95 Improved error recovery with function declarations.
Fixed some rare cases when a single file-scope error could get reapeated endlessly until the maximum total count of errors allowed is reached.
2023-11-27 20:39:15 +08:00
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