serk118ukSoftware DevPosted
6 months agoAROS OS 64Bit GCC 10+ enforces strict checks on void variables
#define CloseAmiSSL()
AROS_LC0(void, CloseAmiSSL,
struct Library *, AMISSLMASTER_BASE_NAME, 7, Amisslmaster)
Above code brings up gcc output-> error: variable or field __ret declared void.
But changing void to int works fine but thats not right way of doing.
I than needed Dopus5 and same issue on AROS_LC0.
Is there any way to keep gcc 10+ happy and eat void too?
So workaround is return int or char but not void.
The error `error: variable or field __ret declared void, In GCC 10+ typically occurs when there's a
type mismatch or incorrect function declaration,
Than I thought maybe something like see -> below lines. (we have to add few more lines to libcall.h)
#define AROS_CALL_NORET(name, basetype, libbase, offset, libname)
do {
/* Assembly to call the function without expecting a return */
register void * __a6 __asm__("a6") = (libbase);
__asm__ volatile (
"movl %1, %%d0nt" /* Offset in d0 */
"call %%a6@(-0x1E0)" /* Adjust offset as needed */
: /* No outputs */
: "r" (__a6), "i" (offset)
: "d0", "d1", "a0", "a1", "memory"
);
} while (0)
#define AROS_LCA(rettype, name, argtype, libbase, offset, libname)
({
if (__builtin_types_compatible_p(rettype, void)) {
/* Handles if rettype is void */
AROS_CALL_NORET(name, argtype, libbase, offset, libname);
} else {
t __ret = (( t (*)())(APTR)__func)();
}
})
Above code just a idea and i got it from here and there while looking at some of the macros.
I have already Ported meteMP3 1.5 ,Raylib 5.5 , GLFW 3.x to AROS-64 but AmiSSL fails to compile due to gcc 10+.
Any help/hint?
Edited by amigamia on 20-05-2025 16:35,
6 months agoThere is AROS_LC0NR variant of macros to handle void return type (NR stands for No-Return)
AMIGASYSTEMDistro MaintainerPosted
6 months agoThank you Serk, since there is no Amiga emulator on 64Bit, if you have time available you could also recompile WHD MENU and WHDload, of course someone will have to upgrade to 64Bit JanuUAE or E-UAE (a new version came out recently)