With the forthcoming release of SDCC version 4.2.0, I have updated the SDCC compiler options file to bring it up to date and bring some enhancements. Please find attached a patch to options_sdcc.xml.
Summary of the changes:
- Reorganised with some new categories: code generation, debugging, warnings.
- Added many new options, removed some old defunct options.
- Added new target CPU architectures: z80n, r2ka, r3ka, mos6502, sm83 (renaming of gbz80).
- Made some newer features conditional on detected SDCC version (e.g. sm83 vs. gbz80) as not all users may have latest SDCC version.
Which is the output of sdcc --version?. If it is something like 4.2.0, there is a new group of more clear and reliable tests; for example, in options_common_architecture.xml you have this:
There are more tests, like version_greater or version_equal. You can compare with "4", "4.2" or "4.2.0", for example.
On the other side, the patch is not created by SVN and is not directly usable. I would prefer a proper SVN patch or the complete file.
The output of
sdcc --versionis as follows:There is no command line option to output just the version number - no equivalent of GCC's
-dumpversion. If those new tests expect precisely just a version number string (e.g. "4.2.0"), then I think unfortunately we will not be able to take advantage of them.By the way, are those new tests available in the current release (20.03), or just trunk? Even if there were the possibility to use them, I wanted the options file to work in the current release.
As for the patch, what is not directly unusable? I apologise, but I'm not going to check out the entire SVN source tree just to make a diff against one file. I can provide the complete file, though - see attached.
The new tests are not present in 20.03, but they are present in the nightlies. IMHO, the current nightly is far more stable than 20.03 and you can just delete it if you do not like it.
Applied in [r12737], thank you.
Related
Commit: [r12737]
Last edit: Miguel Gimenez 2022-03-04
FYI, I have just modified the regex test to simplify comparations.
I have also modified options_sdcc.xml in [r12739] to benefit from the changes.
Related
Commit: [r12739]
That's pretty neat.
What happens if the regex needs to contain a ';' though? Is there some kind of escape mechanism?
wxSplit() has a built-in escape mechanism (prepending a backslash).
Anyway, the original "regex" test has been replaced everywhere with the new "version_XXX" test, so there is little to worry about.
The https://wiki.codeblocks.org/index.php/Compiler_options_file page needs updating for 12739 changes.
Updated, please review...