Commit Graph

305 Commits

Author SHA1 Message Date
acqn 26945c32ac Fixed function parameters declared as function types rather than function pointers. 2022-08-24 15:30:52 +08:00
acqn 624e5025b0 Fixed parsing wide char constants. 2022-08-17 22:28:00 +08:00
acqn 78e80eb942 Fixed superfluous warning on pointer types comparing a non-void pointer to a void pointer. 2022-08-09 13:13:33 +08:00
Bob Andrews 2c742ffc1c
Merge pull request #1800 from acqn/PPFix
[cc65] Preprocessor fixes
2022-07-28 01:48:41 +02:00
acqn 066a5e0fec Fixed #pragma charmap for string literals. 2022-07-24 16:38:41 +08:00
acqn 16a8a64746 Use a dedicated expression parser for the preprocessor. 2022-07-21 11:10:02 +08:00
Bob Andrews 6b0afe0834
Merge pull request #1785 from acqn/Effectless
[cc65] Avoid generating asm from C code that has no observable effects
2022-07-19 17:38:03 +02:00
Bob Andrews c802980d6a
Merge pull request #1784 from acqn/Diagnostics
[cc65] Slight improvements on diagnostics
2022-07-19 17:37:42 +02:00
acqn f5dacda69b NoCodeConstExpr() fix to avoid exessive error messages. 2021-05-16 19:08:43 +08:00
acqn 2d014383cd Replaced certain usage of "(New-)PointerTo()" with "AddressOf()". 2021-06-08 00:43:26 +08:00
acqn 924fcf5d06 Replaced several occurance of PtrConversion() with StdConversion().
Variadic arguments of functions should be default-promoted.
2021-06-08 09:32:58 +08:00
acqn e9545d68ee Minor clean-ups and typo fixes. 2021-04-17 11:43:03 +08:00
acqn 21858b52e7 Separated data initializer stuff from declaration stuff. 2022-01-03 13:10:32 +08:00
acqn 2d96f79bc7 Added and used new utility type functions for bit-fields.
Fixed GetUnderlyingTypeCode() for bit-fields with widths > 16.
2021-12-01 09:45:17 +08:00
mrdudz 3c1bb85b8e remove dangling spaces 2022-04-17 16:07:09 +02:00
acqn c8956ce19b Fixed signed long comparisons with smaller unsigned types. 2022-03-03 20:24:14 +08:00
Bob Andrews 0587d9f5d4
Merge pull request #1675 from acqn/ShiftFix
[cc65] Fixed bitwise shift with numeric constant operand(s)
2022-03-01 19:50:21 +01:00
Jeff Tranter 2bf8be5b3b Fix some commonly made spelling errors in comments. 2022-02-21 15:44:31 -05:00
acqn 2bda128ef1 Fixed LimitExprValue() for 64-bit long env. 2022-02-26 23:02:51 +08:00
acqn 25a35d6b59 Fixed result type of certain operations, which was broken with the bit-field fix. 2021-06-10 21:54:32 +02:00
acqn 5adb29ce31 Made "bit-field-ness" a type property instead of a SymbolEntry or ExprDesc property.
Fixed integer promotion and result type in certain operations.
Fixed bit-fields 'op=' and postfix inc/dec operators.
2021-06-09 08:03:12 +02:00
acqn dcacba472a Moved ArithmeticConvert() from cc65/expr.c to cc65/datatype.c.
Reorganized a few functions in cc65/datatype.c.
Added SignedType() and UnsignedType() for future usage.
Made LimitExprValue() external so that it can be used more often.
2021-06-09 08:03:12 +02:00
acqn 1450f146a5 Fixed '[]', '()' '.' and '->' operators following a postfix increment/decrement. 2021-05-16 20:43:49 +02:00
acqn dfba8d77ca Error messages shouldn't raise warnings about unused expressions by themselves. 2021-05-14 10:48:17 +02:00
mrdudz 18f94d1fe0 rework to use a magic value instead of a flag, as suggested by Oliver 2021-05-11 14:00:49 +02:00
mrdudz c9f242e566 Extend #pragma wrapped-call to support "bank" argument 2021-05-05 14:42:29 +02:00
acqn 71bd6415d6 No more unnecessary jump-over labels generated for logical OR false cases. 2021-04-24 23:53:26 +02:00
acqn 9cea9ce5e2 Made the code more constness-correct with 'Type' usage. 2021-04-19 15:36:55 +02:00
acqn 24d36854d2 Minor cleanups with array element qualifiers. 2021-04-19 15:36:55 +02:00
acqn bfb7c936aa Preparation for constness-correction. 2021-04-19 15:36:55 +02:00
acqn 6e61093e79 Fixed pointer subtraction in certain very rare cases. 2021-04-17 11:14:37 +02:00
acqn bd8eae67f1 Fixed local struct field access via the address of the struct. 2021-04-05 15:49:54 +02:00
acqn 1a3628df1a Fixed the term 'argument' vs 'parameter' in function parser. 2021-04-03 17:50:46 +02:00
acqn 91fd30611a Fixed ICE on error cases such as '&func + int a'. 2021-04-03 17:45:52 +02:00
acqn b802efde54 Fixed ternary result type detection with pointer types.
Fixed pointer type comparison and conversion, especially regarding qualifiers.
Improved diagnostics about type comparison and conversion.
Reorganized some type-comparison/conversion functions.
2021-03-30 19:41:20 +02:00
acqn f273b1ebcb Fixed crash with non-inlined __fastcall__ function invocation with no arguments. 2021-03-26 11:02:46 +08:00
acqn 3755e4a863 Replaced checking for __fastcall__ aginst AutoCDecl etc. with IsFastcallFunc(). 2021-03-24 14:35:44 +08:00
acqn 3c2e7ce41c More reliable test for true/false with addresses for AND, OR and ternary operators.
Minor comment typo fix.
2021-03-20 01:39:32 +01:00
acqn 325b7b4ab3 Enabled 'a ? b, c : d'. 2021-03-20 00:09:47 +01:00
acqn a51d6d40de Ternary fix for some obscure cases. 2021-03-20 00:09:47 +01:00
acqn 6974c1ff12 Fixed and cleaned up codegen logic with arithmetic conversion in addition and subtraction. 2021-03-19 16:35:03 +01:00
acqn 8eeaaa3f36 Made certain types of comparison between addresses in constant expressions work. 2021-03-16 22:29:20 +01:00
acqn 99c7fe0ada Reusing code from parseadd() for ArrayRef().
Now index[ptr] works in constant expressions.
Fixed codegen for cast type in constant expressions.
Calls on swapstk in 'i[ptr]' is avoided when possible.
2021-03-16 22:29:20 +01:00
acqn f5972dfd08 Made int+pointer work in constant expressions.
Fixed codegen for cast type addition in constant expressions.
Calls on swapstk in 'i+ptr' is avoided when possible.
2021-03-16 22:29:20 +01:00
acqn aa6fdf58b8 Addresses in constant subtraction expressions now work.
Fixed codegen for cast type subtraction in constant expressions.
2021-03-16 22:29:20 +01:00
acqn 3caceb8174 Fixed result type in certain contant expression addition cases. 2021-02-26 19:45:46 +01:00
acqn f2eed38fc8 Fixed expression type of the result of numeric constant comparison. 2021-02-26 19:45:46 +01:00
acqn ea0c634e12 Improved codegen for unsigned char type comparison with numeric constants. 2021-02-23 22:06:21 +01:00
acqn d628772cd1 Fixed signed char type comparison with unsigned numeric constants. 2021-02-23 22:06:21 +01:00
acqn f1c715c455 Fixed a bug that pointer subtraction results from two absolute addresses are calculated as unsigned long. 2021-02-22 14:14:59 -05:00