DASM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew Davie

Just a heads-up on building the dasm assembler;

The file exp.c has deprecated code which (for me) compiles OK (with a warning) on MacOS - and not at all on Linux (Ubuntu). The code itself needs to be changed sooner rather than later - but there is a workaround.

Add "-std=c11" to the gcc build line - this will force the "bad" code to be compiled *anyway*. It's a terrible solution, but will get you up and running if you're doing a Linux build.

cc -mmacosx-version-min=10.5   -c -o exp.o exp.c
exp.c:645:28: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
  645 |         (*Opdis[Opi]_unary)(Argstack[Argi], Argflags[Argi]);
      |                            ^
exp.c:657:29: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C23 [-Wdeprecated-non-prototype]
  657 |         (*Opdis[Opi]_binary)(Argstack[Argi], Argstack[Argi+1],
      |                             ^
2 warnings generated.

The above lines, as seen here, generate warnings in my MacOS build. But as is the case with deprecated features, it has been promoted to an error in my Linux gcc version - and dasm doesn't build (unless you use the terrible 'fix' I have listed).

I've flagged an issue on this in the dasm github repo.

JetSetIlly

I'm using gcc version 12.2.0 on a Debian (12) Linux install. For me, it compiles without any errors or warnings when using make.
https://github.com/JetSetIlly/Gopher2600
@JetSetIlly@mastodon.gamedev.place
@jetsetilly.bsky.social

Andrew Davie

Quote from: JetSetIlly on 27 Dec 2025, 09:18 PMI'm using gcc version 12.2.0 on a Debian (12) Linux install. For me, it compiles without any errors or warnings when using make.

My Ubuntu 25.10 appears to have gcc 15.2.0
I'm not sure if that's the default or if I somehow upgraded.
In any case, yours appears to be *quite old*

JetSetIlly

Quote from: Andrew Davie on 27 Dec 2025, 09:31 PM
Quote from: JetSetIlly on 27 Dec 2025, 09:18 PMI'm using gcc version 12.2.0 on a Debian (12) Linux install. For me, it compiles without any errors or warnings when using make.

My Ubuntu 25.10 appears to have gcc 15.2.0
I'm not sure if that's the default or if I somehow upgraded.
In any case, yours appears to be *quite old*


gcc 15 must have c23 as the default standard. I think specifying c11 in the build arguments is fine.
https://github.com/JetSetIlly/Gopher2600
@JetSetIlly@mastodon.gamedev.place
@jetsetilly.bsky.social

JetSetIlly

With regards to 12.2.0 being old, that's the gcc version that ships with debian bookworm (version 12 of debian), which is being maintained until 2028 :-) It's not old :-)
https://github.com/JetSetIlly/Gopher2600
@JetSetIlly@mastodon.gamedev.place
@jetsetilly.bsky.social

Andrew Davie

Quote from: JetSetIlly on 27 Dec 2025, 09:43 PMWith regards to 12.2.0 being old, that's the gcc version that ships with debian bookworm (version 12 of debian), which is being maintained until 2028 :-) It's not old :-)


Regardless, I think the real point is that people should be able to download and build dasm on the latest gcc withough having to faff about adding switches to the compile command-line to get the compiler to allow now-incorrect (i.e., not C23 compliant) code. The issue was first warned, then deprecated, and now not-supported for good reasons. dasm isn't "locked in time" - the code could/should be modified to work correctly with modern compilers. IMHO.

JetSetIlly

Quote from: Andrew Davie on 27 Dec 2025, 09:56 PM
Quote from: JetSetIlly on 27 Dec 2025, 09:43 PMWith regards to 12.2.0 being old, that's the gcc version that ships with debian bookworm (version 12 of debian), which is being maintained until 2028 :-) It's not old :-)


Regardless, I think the real point is that people should be able to download and build dasm on the latest gcc withough having to faff about adding switches to the compile command-line to get the compiler to allow now-incorrect (i.e., not C23 compliant) code. The issue was first warned, then deprecated, and now not-supported for good reasons. dasm isn't "locked in time" - the code could/should be modified to work correctly with modern compilers. IMHO.

Yes. But adding -std=c11 is just specifying what specification of the language to use. Modern compilers support that.

The language specification and compiler implementation are distinct.
https://github.com/JetSetIlly/Gopher2600
@JetSetIlly@mastodon.gamedev.place
@jetsetilly.bsky.social

alex_79

A fix has been committed yesterday:
https://github.com/dasm-assembler/dasm/commit/ed21db28a0e9693c455d6491cdc120a5936b007a

It compiles fine for me now (Arch Linux, gcc version 15.2.1).

Andrew Davie

I have made a huge update to dasm - catching many buffer errors and other issues.
It builds OK for BD and WenHop. Hopefully nothing's broken.
I have pushed to GitHub. Hopefully we won't have to revert.

Andrew Davie

GitHub now auto-builds MacOS (Apple Silicon), Windows, and Linux binaries on new releases.
Latest release here.