Rangi42
d87b1ed22a
Refactor some redundant error/warning-printing code
2024-02-24 19:05:29 -05:00
Sylvie
595c066c2a
Remove #include <stdbool.h> ( #1317 )
2024-02-24 10:51:46 -05:00
Sylvie
54d6a22d19
Build with pedantically standard C++ ( #1309 )
...
* Remove array designators (not standard C++)
* Build with pedantically standard C++
2024-02-23 16:46:53 -05:00
Sylvie
c0d534f5ad
No more flexible array members (not standard C++) ( #1307 )
...
* Replace FAMs with `std::vector`s (or one `std::string`) in four `struct`s
* Anonymous types declared in an anonymous union are also non-standard
Only Clang complains about this (-Wnested-anon-types)
2024-02-22 16:22:37 -05:00
Rangi42
c70cecc24a
Add missing license header
2024-02-21 19:20:10 -05:00
Rangi42
c0da9fa2bb
Remove obsolete #undef fail
2024-02-20 20:15:34 -05:00
Rangi42
ee59f17ea1
Free all the charmaps after parsing
2024-02-19 09:00:15 -05:00
Sylvie
9cdd0b8a02
No more anonymous structs (not standard C++) ( #1305 )
...
This is one step to restoring `-pedantic` builds
2024-02-19 08:12:20 +01:00
Rangi42
cd297e1f90
Remove unused rgblink function sym_ForEach
2024-02-18 18:46:07 -05:00
ISSOtm
18e83c17b4
Add a few more linker script tests
2024-02-19 00:23:08 +01:00
Sylvie
8a49a0b714
Report "<stdin>" or "<stdout>" when using "-" as a filename placeholder ( #1297 )
...
Also fix a memory leak with `targetFileNames`
2024-02-18 17:07:25 +01:00
Sylvie
d71a161bc9
Phrase error messages as "Failed to", not "Could not" or "Couldn't" ( #1298 )
2024-02-18 14:52:31 +01:00
Marcus Huderle
a37285eae9
Fix two instances of possible infinite loops in the linker ( #1292 )
2024-02-08 11:46:04 +01:00
Sylvie
66fd5a7062
Fix some usually disabled compiler warnings ( #1286 )
...
* Fixes from temporarily re-enabling more compiler warnings
* More edits suggested by cppcheck
* Fix hanging on append_yylval_string
* Fix FOR loop increment
2024-01-18 20:47:20 +01:00
Eldred Habert
ccf9dcb851
Improve linker scripts a little ( #1275 )
...
* Allow for optional sections in linker scripts
These are more useful for frameworks/toolchains.
* Check for an active mem region everywhere
Do you like segfaults? Too bad!
* Allow the address to be floating in linker scripts
Try and make the life of SDCC interop easier.
* Also validate alignment when floating
* Overhaul the linker script manual page
Documenting the new features, but also restructuring the
existing documentation to make the manual page (hopefully)
easier to understand.
2023-12-24 23:29:11 -05:00
Rangi42
09dbc50447
Some refactoring
2023-12-18 15:51:13 -05:00
Rangi
fdd45ab1dc
Improve linker script align ( #1271 )
...
An offset is now supported, and invalid values are no longer silently
truncated, aligning behaviour with other instances of the directive.
2023-12-18 07:16:48 +01:00
Rangi
39018174c5
Scramble banks from the end of the ROM ( #1273 )
...
This is more likely to test edge cases, such as having content in banks with their highest bit set.
2023-12-17 20:14:03 -05:00
Rangi
5a3a215b0e
Don't delete script.cpp after building ( #1272 )
...
Ensure consistency in linker script parser interface
Make the declaration and definition visible when compiling
so that the compiler can warn about inconsistencies.
Co-authored-by: ISSOtm <me@eldred.fr >
2023-12-17 11:42:07 -05:00
Rangi
495d701022
Use RANGE macro to abbreviate begin/end pairs ( #1269 )
2023-12-11 14:10:20 -05:00
Eldred Habert
fd78a9ae83
Port linkerscript parser to Bison ( #1266 )
...
Notable side effects:
* Use the standard-conformant MSVC preproc
* Add test for linker script INCLUDE
* Improve wording of placement conflict errors
* Fix errors from not newline-terminated files
* Teach checkdiff about the linker script doc
* Call linker script "commands" "directives" instead
---------
Co-authored-by: Rangi42 <remy.oukaour+rangi42@gmail.com >
2023-12-11 02:29:37 +01:00
Rangi
1402615bc0
Refactor how Makefile invokes Bison for reusability ( #1259 )
...
Co-authored-by: Eldred Habert <eldredhabert0@gmail.com >
2023-12-01 13:29:05 -05:00
Rangi
6132b77c1e
Add more tests for RGBASM code coverage ( #1257 )
...
* Add more tests for RGBASM code coverage
* Use C++ unnamed parameters, not `(void)` casting
* Fix crash in `sect_AlignPC` from #1253
2023-12-01 10:21:43 -05:00
Rangi
a218622d73
Remove checkpatch, since it's tuned for C not C++ ( #1250 )
...
Co-authored-by: Eldred Habert <eldredhabert0@gmail.com >
2023-11-22 19:26:08 +01:00
Rangi
e824e34526
Use an iterator template for enum sequence loops ( #1228 )
2023-11-12 09:19:19 +01:00
Rangi
31529524c8
Use some more C++20 features ( #1231 )
2023-11-11 20:47:53 -05:00
Rangi
dde9f2bb79
Rename some RPN constants for consistency ( #1230 )
2023-11-08 21:30:27 +01:00
Rangi
5379e51094
Make requested revisions to recent PRs ( #1195 )
2023-11-07 23:11:08 +01:00
Rangi
1e70e703a7
Build everything as C++ ( #1176 )
2023-11-07 21:45:56 +01:00
Rangi42
02f9128d07
Make some changes noticed while porting to C++
2023-11-07 08:27:03 +01:00
Rangi
143e76b7e3
Output the map file summary at the top of the file ( #1203 )
2023-11-05 15:43:58 +01:00
Rangi
f8af569680
Shorten license comments and consolidate an AUTHORS file ( #1217 )
2023-11-05 09:54:32 +01:00
Rangi
c869edd1d2
Implement SIZEOF and STARTOF for section types ( #1205 )
2023-11-03 08:50:04 +01:00
Rangi
8f3369fe29
Implement DS for linker scripts ( #1206 )
2023-11-03 08:47:22 +01:00
Rangi
9e4b9e75e3
Sort symbols by address, then parentage, then index ( #1186 )
2023-11-02 23:58:25 +01:00
Rangi
0d72ba886b
Consistent behavior with missing or incorrect parameters ( #1179 )
2023-11-02 17:40:40 +01:00
Rangi42
a64f28de5c
Avoid using %# printf specifier
2023-11-02 17:38:10 +01:00
Rangi
79948be3a0
Improve incorrect object file revision error ( #1189 )
...
Fixes #1118
2023-10-31 15:04:27 -04:00
Evie
a0dfa916e6
Fix off-by-one error in "scramble spec" validation ( #1144 )
2023-06-16 09:28:19 +02:00
Eldred Habert
50aaa6524d
Fix -w not coercing WRAMX sections to WRAM0
...
Fixes #1116
2022-12-21 23:43:57 +01:00
ISSOtm
75a07a90f8
Always initialise section->data to avoid an uninit read
...
The addition of SDCC objects required a change in the logic of
`mergeSections()` to dispatch based on `->data` instead of
`sect_HasData`, which implicitly assumes that `->data` is
always initialised (maybe NULL).
However, RGBDS sections did not do that!
2022-12-02 22:39:31 +01:00
Rangi
79748afdc4
Align the "; Next union/fragment" comments with their symbols
2022-11-06 23:55:15 +01:00
Rangi
32cb0558e4
Print "; Next union/fragment" between "pieces" in .map file
...
Resolves #1099
2022-11-06 23:55:15 +01:00
rlewicki
92b2ac3c8c
Remove duplicated EMPTY label in case no bank memory is used
2022-11-03 19:54:21 +01:00
rlewicki
0e67298dff
Fix indention when writing EMPTY label inside link output.c file
2022-11-03 19:54:21 +01:00
ISSOtm
c8e602dec1
Mangle the name of absolute sections
...
They are unlikely to be unique across files, actually
2022-10-15 23:16:04 +02:00
ISSOtm
0e0876b17f
Print addr ranges for empty blocks as well
...
Mirrors what sections do, for clarity & consistency
2022-10-07 16:04:02 +02:00
Rangi
a1107fc5cf
Refactor !!x to x != 0
...
Also limit comments and docs to single "!"s
2022-10-01 14:09:02 -04:00
Eldred Habert
c10345f26d
Comply with sym file spec ( #1078 )
...
Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com >
2022-10-01 12:35:00 -04:00
Rangi
5ad8a8c958
Warn when a duplicate CLI argument overrides a previous one ( #1053 )
...
Fixes #1050
2022-09-25 10:04:30 +02:00