1
0
mirror of https://github.com/cc65/cc65.git synced 2024-05-28 00:48:27 +00:00
Commit Graph

3881 Commits

Author SHA1 Message Date
Bob Andrews
4343eebe67
Merge pull request #2314 from acqn/PPFix
[cc65] Separated C preprocessor errors from other errors
2023-12-31 19:16:44 +01: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
Bob Andrews
0ece9449d7
Merge pull request #2307 from acqn/FuncDeclFix
[cc65] Fixed function declarator parser when a parameter has a function type
2023-12-31 19:11:25 +01:00
Bob Andrews
7297d2c8b6
Merge pull request #2310 from pm100/vs64
second try at fixing win64 build
2023-12-31 18:54:23 +01:00
paul moore
096bd0b633 bug 2319 2023-12-29 17:02:45 -08:00
acqn
b876a6b213 Fixed cc65 exitcode when there are only preprocessor errors. 2023-12-19 19:30:50 +08:00
acqn
cd7c688dff Separated C preprocessor errors from other errors. 2023-12-18 15:30:53 +08:00
paul moore
08341aae30 second try at fixing win64 build 2023-12-14 14:25:35 -08: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
f8fe1d1560 Fixed missing diagnosis on function parameter lists with trailing commas. 2023-12-13 22:57:32 +08:00
Bob Andrews
bc97bce8c1
Merge pull request #2297 from acqn/WrappedCall
[cc65] Fixed wrapped call when the function was defined before its later declaration gets wrapped with the pragma
2023-12-12 17:11:47 +01:00
acqn
befc9533c6 More accurate diagnostic messages on empty declarations without any type specifiers. 2023-12-10 20:21:50 +08:00
mrdudz
b1c1502494 MS compiler insists on those typecasts apparently 2023-12-11 00:35:07 +01:00
mrdudz
9985ee7f61 fix %hhn and %hn in the internal xvsnprintf function 2023-12-11 00:18:40 +01:00
Bob Andrews
cc5e9c38ca
Merge pull request #2296 from acqn/Diagnostics
[cc65] Fixed and improved diagnostics regarding type names and declarations
2023-12-10 22:32:33 +01:00
acqn
bbd542fac7 Fixed missing diagnosis on extra identifiers in type names. 2023-12-10 17:01:54 +08:00
Colin Leroy-Mira
07c71541f4 Fix #2262: Make sure there's no branching after the sequence
Also better check that arguments match
2023-12-10 09:45:15 +01:00
acqn
3215d377ea More accurate diagnostic messages on wrong missing declaration specifiers. 2023-12-10 15:46:48 +08:00
acqn
cadf8012f6 Improved error recovery with type cast and sizeof. 2023-12-10 15:43:24 +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
a16a6298e2
Merge pull request #2287 from acqn/Diagnostics
[cc65] Minor diagnostics improvements
2023-12-09 22:16:47 +01:00
Bob Andrews
92f869cdfb
Merge pull request #2288 from acqn/TypeFix
[cc65] Fixed an iteration bug in type composition
2023-12-09 22:15:24 +01:00
Bob Andrews
a956f6f9ed
Merge pull request #2289 from acqn/FuncDeclFix
[cc65] Fixed the issue that qualifiers of pointees of function parameters were ignored for type compatibility check
2023-12-09 22:14:41 +01:00
acqn
b66682a05b Fixed wrapped call when the function to wrap has already got defined before it is wrapped with the pragma. 2023-12-10 00:47:10 +08:00
Colin Leroy-Mira
2a2cc6cad6 Fix bug introduced in #2260
bne should have applied to A, not X, but adding a cmp #$00 before
makes the change less optimized than the existing.
2023-12-09 16:43:23 +01:00
acqn
d8a722b638 Improved diagnostics on multiple definition of struct/union types. 2023-12-09 17:34:01 +08:00
acqn
87f8893886 Avoided "Variable 'XXX' is defined but never used" error message resulted from an earlier error. 2023-12-09 17:33:46 +08:00
acqn
98ffc031d1 Fixed an iteration bug in type composition. 2023-12-09 14:35:00 +08:00
acqn
b7e7bb7489 Fixed the issue that qualifiers of pointees of function parameters were ignored for type compatibility check. 2023-12-09 14:34:37 +08:00
Bob Andrews
519a52d92c
Merge pull request #2209 from vrubleg/linecont
ca65: `.LINECONT` as a part of `.FEATURE`
2023-12-08 02:10:45 +01:00
Bob Andrews
66bfc31988
Merge pull request #2262 from colinleroy/optimize-long-assign
Optimize static long assignment a bit
2023-12-08 01:58:01 +01:00
Bob Andrews
09735b26c5
Merge pull request #2274 from acqn/UnionFix
[cc65] Fixed initialization of union when it has an anonymous bit-field as the first member declaration
2023-12-08 01:55:06 +01:00
Bob Andrews
c4575ec2c4
Merge pull request #2275 from acqn/BitfieldFix
[cc65] Fixed constness of bit-fields
2023-12-08 01:54:02 +01:00
Colin Leroy-Mira
63861766e1 Fix Makefile change 2023-12-01 14:22:30 +01:00
Colin Leroy-Mira
d8a3938f2b Optimize a bit static long assignation 2023-12-01 14:20:00 +01:00
acqn
47e7ed2f56 Fixed wrong "Mixed declarations and code are not supported in cc65" error message when it should be "Expression expected". 2023-11-30 00:36:13 +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
6434176909 Fixed constness of bit-fields. 2023-11-29 12:27:01 +08:00
Bob Andrews
5537b61e6a
Merge pull request #2272 from acqn/Diagnostics
[cc65] Improved diagnostics
2023-11-28 15:06:39 +01:00
Bob Andrews
2af16ee82b
Merge pull request #2271 from acqn/InternalFix
[cc65] Fixed assertion failure when there is an undeclared symbol used in a parameter list
2023-11-28 15:03:09 +01:00
Bob Andrews
97cfb8c67a
Merge pull request #2266 from acqn/StructFix
[cc65] Fixes for structs/unions
2023-11-28 15:00:58 +01:00
Bob Andrews
86b09f56a6
Merge pull request #2260 from colinleroy/optimize-substraction
Optimize integer decrements by 1
2023-11-28 14:40:51 +01:00
Bob Andrews
acf159adbc
Merge pull request #2269 from colinleroy/optimize_gt_255
Optimize unsigned int and long > 255
2023-11-28 14:36:39 +01:00
Bob Andrews
ad0b778008
Merge pull request #2265 from acqn/C99Main
[cc65] Enabled implicit "return 0" in C99 standard main function in default cc65 mode
2023-11-28 14:27:55 +01:00
Bob Andrews
7e6399d439
Merge pull request #2268 from picocomputer/master
add rp6502 target
2023-11-27 17:53:43 +01:00
acqn
546be1d5dd Fixed assertion failure when there is an undefined symbol used in a parameter list. 2023-11-27 20:42:50 +08:00
acqn
b99ebc1256 Fixed diagnostic messages about undeclared identifiers. 2023-11-27 20:39:15 +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
acqn
ac04394254 Fixed and improved diagnostics about declaration errors. 2023-11-27 20:39:15 +08:00
acqn
79214530e0 Maximum total count of errors before the compiler unconditionally bails out is now 200.
If more than 20 errors occur on the same source line, the compiler will immediately bail out.
2023-11-27 20:39:15 +08:00
Colin Leroy-Mira
3066b1f9b4 Optimize unsigned int and long > 255 2023-11-17 22:49:03 +01:00
rumbledethumps
b17c4d3434 add rp6502 target 2023-11-16 18:46:16 -08:00
acqn
3b7af398a9 Fixed initialization of union when it has an anonymous bit-field as the first member declaration. 2023-11-15 21:32:24 +08:00
acqn
f6c3a1b209 Removed the extra "'}' expected" error message following a "Excess elements in struct/union initializer" error message. 2023-11-15 21:17:05 +08:00
acqn
5332eeecc2 Fixed empty declarations in structs/unions. 2023-11-15 18:17:36 +08:00
Colin Leroy-Mira
076137f41b Optimize lda/sta/lda and friends 2023-11-13 10:32:09 +01:00
Colin Leroy-Mira
9242508abf Optimize substraction of 1 2023-11-13 10:31:48 +01:00
acqn
0eb38770bd Fixed const qualifiers on named structs/unions members that should prevent assignments to the whole structs/unions.
Added warning on ignored qualifiers on anonymous structs/unions.
2023-11-13 17:17:46 +08:00
Colin Leroy-Mira
cff611711b Optimize multiplication by zero 2023-11-06 11:04:00 +01:00
acqn
d424883716 Fixed diagnostics on qualifiers of function return types. 2023-10-28 15:24:13 +08:00
Evgeny Vrublevsky
c8df241337 Add line_continuations feature that works as .LINECONT but in a consistent way with other features. 2023-10-05 08:28:37 +03:00
Bob Andrews
12193790e5
Merge pull request #2199 from acqn/FAMFix
[cc65] Forbidden struct itself with flexible array member as struct member or array element
2023-10-05 03:21:31 +02:00
Bob Andrews
327281b869
Merge pull request #2200 from acqn/CompoundInitFix
[cc65] Fixed compound initialization with certain omitted enclosing curly braces
2023-10-05 03:20:33 +02:00
Bob Andrews
bdb13350e3
Merge pull request #2201 from acqn/Diagnostics
[cc65] Improved diagnostics
2023-10-05 03:19:31 +02:00
Evgeny Vrublevsky
148942ff1d Don't use hardcoded Visual Studio installation path in msbuild.cmd. 2023-09-23 14:26:09 +03:00
Evgeny Vrublevsky
d83354a8dd Fix default VS project settings. 2023-09-23 14:26:08 +03:00
acqn
13e1ed3e7b Fixed compound initialization with omitted enclosing curly braces when an array/struct/union to initialize is nested. 2023-09-22 10:29:52 +08:00
acqn
fc603129da A structure with a flexible array member shall not be a member of a structure or an element of an array according to the ISO C Standard. 2023-09-18 15:44:58 +08:00
acqn
39abd233fe Fixed check for conflicting extern vs no-linkage/static declarations in functions. 2023-09-17 23:47:22 +08:00
acqn
8e62cbf092 Improved checks on function return types. 2023-09-13 22:26:41 +08:00
Bob Andrews
f381d23001
Merge pull request #2236 from acqn/TypeFix
[cc65] Fixed some type-related bugs which don't have any impact yet
2023-10-29 12:37:07 +01: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
8e45a4c960 Fixed the bug that a union type containing a struct with a flexible array member was accepted as a struct member or array element type. 2023-10-27 23:46:10 +08:00
acqn
85e63e99a6 Fixed regression: array element of incomplete type. 2023-10-27 21:51:45 +08:00
Bob Andrews
94ef5856d0
Merge pull request #2235 from acqn/Cleanup
[cc65] Cleanups
2023-10-26 20:07:39 +02: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
Bob Andrews
16f6860f57
Merge pull request #2243 from acqn/StdFuncFix
[cc65] Inlined std functions fixes
2023-10-26 17:39:07 +02:00
Bob Andrews
10f709eeb7
Merge pull request #2234 from acqn/Diagnostics
[cc65] Minor fix for error recovery from duplicated struct members
2023-10-26 17:10:01 +02:00
Bob Andrews
316ae886d7
Merge pull request #2242 from acqn/SwitchFix
[cc65] Fixed type promotion of switch case values
2023-10-26 16:56:01 +02:00
Bob Andrews
a8d00bfaae
Merge pull request #2240 from acqn/BitwiseOpt
[cc65] New TOS optimization steps for 8-bit subtraction and bitwise operations
2023-10-26 16:53:37 +02:00
acqn
df392fc104 Fixed type promotion of switch case values. 2023-10-25 22:38:21 +08:00
acqn
a31b35b2a6 Fixed naming of local variables in CG_TypeOfBySize and CG_TypeOf. 2023-10-22 10:42:17 +08:00
acqn
70549e868e New optimizer steps to restore some possibly lost optimization with boolean due to the previous fix. 2023-10-21 23:56:13 +08:00
acqn
f321bb16e5 Fixed potential bugs with boolean branch optimizers when more than one jeq/jne follows. 2023-10-21 23:56:07 +08:00
acqn
79c52e742f Added new opts OptBoolUnary1/OptBoolUnary2 to remove unnecessary cmp + bcastax/bnegax,
as well as OptBoolUnary3 to "strength-reduce" certain bcastax/bnegax to boolne/booleq.
2023-10-21 23:56:04 +08:00
acqn
e5bbdfa995 Separated boolean optimizers from bitwise unary operator optimizers.
Renamed OptCmp6 to OptBoolCmp.
2023-10-21 23:56:01 +08:00
acqn
c52427fc65 Minor fix for error recovery from duplicated struct members. 2023-10-21 23:52:14 +08:00
acqn
178573a128 Fixed inlined strlen when it takes a string literal with extra characters after the first '\0'.
Added testcases.
2023-10-17 17:57:19 +08:00
acqn
8111946731 Fixed array subscript with a bit-field with patch by kugelfuhr. 2023-10-15 15:53:03 +08:00
acqn
7b0d1d9679 Added warning on concatenated string literals in _Pragma operations. 2023-10-13 14:54:54 +08:00
acqn
25832ef5fc Fixed timing of #pragma charmap.
Now it is immediately applied and affects almost all characters and string literals after it.
Exceptions:
- String literals as the message of a static assertion or inline assembler code (only the required one, not any optional formatted arguments) in an asm() expression are not translated with either #pragma charmap or target presets.
- String literals used for preprocessor directives or as the result of stringized macro arguments are never translated.
2023-10-13 16:32:06 +08:00
acqn
c6ead99b00 Fixed string literal concatenation with pragmas in between. 2023-10-13 16:32:05 +08:00
acqn
7b6f8249a0 General fixes for prerequisites for optimization on certain std functions.
Added utility functions for extracting expression info.
2023-10-11 22:29:15 +08:00
acqn
20c3e994c6 Fixed compiling with pragmas in the middle of declarations or statements. 2023-10-04 21:22:04 +08:00
Bob Andrews
2726192aaf
Merge pull request #2224 from acqn/DeclCleanUp
[cc65] Made functions in src/cc65/declare.c less confusing
2023-10-14 20:09:05 +02:00
acqn
74922afa7c Made the intension of functions in src/cc65/declare.c less confusing. 2023-10-12 17:31:49 +08:00
Bob Andrews
494bf10e80
Merge pull request #2216 from acqn/FuncDefFix
[cc65] Type category in a function definition cannot be inherited from a typedef
2023-10-08 18:58:29 +02:00
acqn
0028b14071 The type category in a function definition cannot be inherited from a typedef. 2023-10-05 17:48:16 +08:00