Commit Graph

84 Commits

Author SHA1 Message Date
acqn 3d0dc58153 Fixed visibility of undeclared functions and objects. 2024-01-13 00:46:14 +08:00
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
acqn b876a6b213 Fixed cc65 exitcode when there are only preprocessor errors. 2023-12-19 19:30:50 +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
acqn bbd542fac7 Fixed missing diagnosis on extra identifiers in type names. 2023-12-10 17:01:54 +08: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
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
acqn 6434176909 Fixed constness of bit-fields. 2023-11-29 12:27:01 +08: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
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 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
acqn 51e304f10f Added check for total arguments size for variadic functions. 2023-09-18 16:44:04 +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
Bob Andrews 9c27084fa5
Merge pull request #2084 from bbbradsmith/numerical_constant_errors-int
Numerical constant errors and improvements (integer)
2023-05-06 21:36:59 +02:00
bbbradsmith 84eafb7f9c err test for struct with duplicate member 2023-05-03 21:09:03 -04:00
bbbradsmith b5f255f912 Test case for const-overflow warnings 2023-05-03 19:54:40 -04:00
bbbradsmith 49bd568113 error test for integer constant too large for internal representation 2023-05-03 17:55:02 -04:00
Bob Andrews 93b015660d
Merge pull request #1899 from acqn/TypeCmpFix
[cc65] Fixed compatibility checks on "pointer to pointer" vs "pointer to array" etc.
2022-11-18 19:04:35 +01:00
acqn 7b436e9823 Added tests for #1895 fix. 2022-11-13 01:01:24 +08:00
mrdudz 79fd078ae3 add check for line endings containing CR. 2022-11-03 18:27:10 +01:00
Bob Andrews 0eba33ee74
Merge pull request #1897 from acqn/TernaryFix
[cc65] Fixed errors in the conditional operator "? :" parser
2022-11-02 18:13:45 +01:00
acqn deb5e97732 Fixed diagnostic messages on enumerator overflow.
An enumerator that would be incremented greater than ULONG_MAX now causes an error.
2022-11-02 14:22:21 +08:00
acqn d84cc2d122 Fixed errors in the conditional operator "? :" parser. 2022-11-02 13:56:55 +08:00
mrdudz 0129622383 remove dangling spaces 2022-04-17 16:07:52 +02:00
mrdudz 8cacfa70d5 add missing newline to a bunch of files 2022-04-16 19:51:48 +02:00
mrdudz 010eea12a2 move test for issue #1211 into misc 2021-05-25 13:38:06 +02:00
mrdudz c11e389a94 move testcase for issue #1320 into test/misc 2020-11-20 17:25:10 +01:00
Greg King 2ffb6af5d9 Simplified a bug test. Gave it an appropriate description, 2020-11-17 08:15:34 -05:00
Jesse Rosenstock 68cb15d0f9 Add test case for #1320
From https://github.com/cc65/cc65/issues/1320#issuecomment-726866015
2020-11-17 09:45:02 +01:00
Jesse Rosenstock 81550ca1ee CS_MergeLabels: Keep labels referenced by data
Partial fix for ICE in #1211.  This may fix enough to allow #1049 to be
fixed.

When merging labels, keep the first label with a ref that has no JumpTo;
this is a data segment label, used by computed gotos.

The real fix is to track and rewrite labels in data, but this is more
involved.
2020-10-08 12:11:03 +02:00
mrdudz 5ba9d28488 test related to pr #1189 2020-09-24 16:16:16 +02:00
Jesse Rosenstock 4e4e4c2d21 Allow char bit-fields
These are not required to be supported (only int, signed int, and
unsigned int are required), but most compilers support it.

https://port70.net/~nsz/c/c89/c89-draft.html#3.5.2.1
https://port70.net/~nsz/c/c89/c89-draft.html#A.6.5.8

For consistency with other integral types, plain `char` bit-fields
are unsigned, regardless of the `--signed-chars` option.

Fixes #1047
2020-09-08 14:24:04 +02:00
acqn d68925c6a8 Bug #1113 was fixed long ago. 2020-08-25 22:34:25 +08:00
Jesse Rosenstock d38e5858f0 Add tests for #1211
CL_MoveRefs: Add CHECK (E->JumpTo != NULL) to make failure clearer.
2020-08-24 18:10:22 +02:00
Jesse Rosenstock 4b7cd491e3 Move #1209 test from err/ to misc/
misc/ is the correct place for tests that should compile
but do not.

Revert err/Makefile changes from #1210.
2020-08-24 18:07:31 +02:00
Jesse Rosenstock 23621f3299 Add test case for #1209
Change err/ tests to use cl65 and .prg instead of cc65 and .s
since this test only fails at the link stage.
2020-08-22 15:27:49 +02:00
mrdudz e6b8f4d715 move/fix bug264.c as suggested in issue #1122 2020-08-19 22:25:18 +02:00
mrdudz 0690a12ad2 change "the cc65 authors" to "The cc65 Authors" as per jmrs request 2020-08-18 22:41:42 +02:00
mrdudz 0c22d5011e added test related to pr #1190 2020-08-18 17:58:29 +02:00
mrdudz ab89c168de replace "Copyright 2020 Google LLC" by "Copyright 2020 the cc65 authors" 2020-08-18 17:47:35 +02:00
mrdudz 2663561c62 added test related to pr #1135 2020-08-18 00:41:35 +02:00
mrdudz 6d8860b9de added test related to issue #1145 2020-08-18 00:41:07 +02:00
mrdudz cf41fccc0a added test related to issue #1143 2020-08-18 00:40:29 +02:00
acqn 8b8561161c Moved #1098 bug tests from test/misc to test/err as they are fixed now. 2020-08-12 15:02:43 +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