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

213 Commits

Author SHA1 Message Date
acqn
d8a722b638 Improved diagnostics on multiple definition of struct/union types. 2023-12-09 17:34:01 +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
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
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
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
5332eeecc2 Fixed empty declarations in structs/unions. 2023-11-15 18:17:36 +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
d424883716 Fixed diagnostics on qualifiers of function return types. 2023-10-28 15:24:13 +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
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
acqn
74922afa7c Made the intension of functions in src/cc65/declare.c less confusing. 2023-10-12 17:31:49 +08: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
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
878264d948 Minor consistency improvement for AddEnumSym() usage. No impact. 2023-09-13 22:26:41 +08:00
acqn
3af77e7333 Improved error recovery in declarations with curly braces. 2022-11-12 12:28:29 +08:00
acqn
894ba49cb5 Improved error messages about missing type specifiers. 2022-11-12 12:28:24 +08:00
acqn
b0ef3572ea Improved error messages about missing identifiers. 2022-11-12 12:28:22 +08:00
acqn
a4a1230c62 Renamed some C type facility and fixed a few comments.
Added some new C type code facility.
Removed some unused type predicates.
2022-10-12 13:10:17 +08:00
Bob Andrews
ec2688b50e
Merge pull request #1910 from acqn/DeclFix
[cc65] Renamed a few functions and struct used for declaration parser
2022-11-11 21:41:04 +01:00
Bob Andrews
9c48c0ab8a
Merge pull request #1900 from acqn/Diagnostics
[cc65] Fixed endlessly repeated error messages when a declaration lacks a required identifier
2022-11-11 21:08:53 +01: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
991af3755b Added support for _Static_assert in unions. 2022-11-03 21:46:41 +08:00
Bob Andrews
7146dbc87d
Merge pull request #1879 from acqn/SymEntryFix
[cc65] SymEntry cleanups
2022-11-04 14:06:47 +01:00
acqn
aa5d44b2b0 Fixed endlessly repeated error messages when a declaration lacks a required identifier. 2022-11-02 23:58:20 +08:00
acqn
9b39c3f949 Fixed garbage enum tag name appeared in diagnostic messages if the enum tag declaration failed. 2022-11-02 23:58:18 +08: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
a2dfa7c721 More consistent names for SymEntry functions. 2022-10-12 13:10:17 +08:00
acqn
2cda47cd36 More descriptive names for SymEntry usage. 2022-10-11 14:14:48 +08:00
acqn
4f4487cb03 Added supports for long bit-fields. 2022-01-04 18:23:04 +08:00
acqn
21858b52e7 Separated data initializer stuff from declaration stuff. 2022-01-03 13:10:32 +08:00
mrdudz
3c1bb85b8e remove dangling spaces 2022-04-17 16:07:09 +02:00
acqn
6beb090193 Fixed anonymous bit-fields declared with typedef'ed type names. 2022-01-03 23:54:14 +08:00
acqn
38511843e5 Fixed crash with labels in non-function/block scopes. 2022-01-03 23:50:48 +08: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
1d7bf7355c Better function naming in declare.c.
Scalar initialization routines need only 'const Type*' as parameters.
2021-06-09 08:03:12 +02:00
acqn
18ae09f682 Less excessive errors with failed array declarations. 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
9cea9ce5e2 Made the code more constness-correct with 'Type' usage. 2021-04-19 15:36:55 +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
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
cb8fbf4772 Removed the non-existing-in-C "struct/union scope" for structs/unions.
Fixed handling of struct/union field declarations without identifiers, which do nothing.
2021-03-29 19:28:22 +02:00
acqn
2aad72af90 Removed trailing whitespaces. 2021-03-03 10:07:24 +01: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
Jesse Rosenstock
b931e65811 Fix ICE for bit-fields with typedef
Fixes #1267

Avoid ICE, but treat plain int bit-fields declared via typedef as
signed rather than unsigned.  It is more efficient to treat them
as unsigned, but this requires distinguishing int from signed int,
and this is curently not done.
2020-10-03 15:04:31 +02:00
Jesse Rosenstock
d0089aef95 Fix bit-field truncation warning message
Fix copy & paste bug with warning message.

struct X {
      signed int a : 3;
};
struct X g = { 5 };

Before:
s.c(4): Warning: Implicit truncation from 'int' to 'int : 3' in bit-field
initializer changes value from 5 to 5

After:
s.c(4): Warning: Implicit truncation from 'int' to 'int : 3' in bit-field
initializer changes value from 5 to -3

Fixes #1268
2020-09-26 17:41:45 -04:00