1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-01 13:41:34 +00:00
Commit Graph

133 Commits

Author SHA1 Message Date
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
acqn
88246f852d Removed RefineFuncDesc() as an unnecessary wrapper. 2024-01-01 15:04:50 +08: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
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
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
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
Bob Andrews
94ef5856d0
Merge pull request #2235 from acqn/Cleanup
[cc65] Cleanups
2023-10-26 20:07:39 +02:00
acqn
c52427fc65 Minor fix for error recovery from duplicated struct members. 2023-10-21 23:52:14 +08:00
acqn
39abd233fe Fixed check for conflicting extern vs no-linkage/static declarations in functions. 2023-09-17 23:47:22 +08:00
bbbradsmith
3b7be09a7f extern redeclared as static = error (C spec: undefined)
static redeclared as extern = warning (C spec: ignore extern)
See: #2111
2023-05-11 19:50:58 -04:00
bbbradsmith
56c715af40 Error for struct/union with a duplicate member #2015 2023-05-03 01:14:27 -04:00
acqn
1dccd1333b Added more type utility functions.
Changed result of GetBasicTypeName() for unknown types from "type" to "<type>".
2022-10-12 13:10:17 +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
acqn
e9413567d7 Renamed several functions relevent with input file info. 2022-11-02 14:16:15 +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
Bob Andrews
3aadf6c66e
Merge pull request #1867 from acqn/Diagnostics
[cc65] Diagnostics improvements
2022-10-16 18:26:26 +02:00
acqn
9eab36b95a Fixed block-scope extern declarations visibility.
Fixed missing file-scope static function codegen output in a rare care.
2022-09-30 14:32:08 +08:00
acqn
29c9cb3e00 Improved diagnostics on conflicting type declarations. 2022-09-29 19:38:32 +08:00
acqn
f9812930c1 More detailed diagnostic info about conflicted function types. 2021-03-30 16:47:57 +08:00
Bob Andrews
58de94edd4
Merge pull request #1560 from empathicqubit/master
Add --debug-tables <filename> option and output struct fields
2022-03-20 20:27:15 +01:00
acqn
6beb090193 Fixed anonymous bit-fields declared with typedef'ed type names. 2022-01-03 23:54:14 +08:00
Greg King
325ff9667e Used (size_t), instead of (long) where converting between pointers and integers.
(long) still is 32 bits on 64-bit Windows!
2021-12-12 19:40:43 -05:00
empathicqubit
fd8d51497c Add --debug-tables <filename> option and output struct and union fields 2021-09-29 05:20:44 +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
mrdudz
0fbf2af09d Fix the warning that is produced for unused functions 2021-05-08 01:03:43 +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
a1992702f8 Declarations of 'extern' object and function should be visible in the file scope. 2021-01-30 14:31:51 +01: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
Jesse Rosenstock
9a0e4a35e1 Fix enum bit-field ICE #1244
This previously resulted in an ICE:
cc65: Check failed: (Entry->Type->C & T_MASK_SIGN) == T_SIGN_SIGNED,
file 'cc65/symtab.c', line 874

This CHECK is in the code that deals with changing `int` bitfields to
`unsigned int`.

Work around this by treating enum bit-fields as having their signedness
specified, so this type change code does not get called.

Fixes #1244.
2020-09-07 11:21:23 +02:00
acqn
6b64b43395 Made local static data use a separated label pool from the code label pool. 2020-08-31 09:12:03 +02:00
acqn
df755df44d Warning about ESU types declared inside parameter list as they are invisble outside. 2020-08-29 16:37:16 +02:00
Jesse Rosenstock
ff535b8e1a Treat signed int bit-fields as signed
Prior to this PR, `int`, `signed int`, and `unsigned int`
bitfields are all treated as `unsigned int`.

With this PR, `signed int` will be treated as `signed int`,
and the others remain unsigned.

Since `Type` does not distinguish between `int` and `signed int`,
add an extra `int* SignenessSpecified` param to `ParseTypeSpec`
so we can tell these apart for bit-fields and treat plain `int : N`
as `unsigned int : N` since it is more efficient to zero-extend
than sign-extend.

Fixes #1095
2020-08-18 12:23:20 +02:00
acqn
f206833a20 Alternative fix for Issue #1167. 2020-08-17 20:31:02 +02:00
acqn
ebae994dc9 Fixed CHECK failure when calling functions defined with repeated parameter names.
Clarified the terms "parameter" vs "argument" in FunctionParamList().
2020-08-17 20:27:57 +02:00
acqn
b19bb14348 Fixed checking conflitcing declarations with external vs other linkage. 2020-08-14 18:33:54 +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
8a417ff039 Improved ESU declaration failure handling. 2020-08-14 18:15:31 +02:00
acqn
03b37cf712 Fixed type comparisons of typedefs and arrays. 2020-08-12 15:04:26 +02:00
acqn
b62b1650f5 Improved error messages on struct/union type multiple definitions. 2020-08-12 15:01:31 +02:00
acqn
0f1a5e0520 Set enum tag definition flags. 2020-08-09 22:12:36 +02:00
acqn
1dd899c7c9 Fixed non-file-scope multiple definition checking. 2020-08-09 22:12:36 +02:00
acqn
f59d6b8f6a Redefining enums/structs/unions of 0 size is no longer treated as declarations and thus forbidden. 2020-08-07 10:16:33 +02:00
acqn
7e68a24625 Clearer warning messages on unused symbols. 2020-08-02 23:51:11 +02:00