Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

GCC 10+ enforces strict checks on void variables

Last updated on 6 months ago
serk118ukserk118ukSoftware Dev
Posted 6 months ago
AROS 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 ago
D
deadwoodAROS Dev
Posted 6 months ago
There is AROS_LC0NR variant of macros to handle void return type (NR stands for No-Return)
serk118ukserk118ukSoftware Dev
Posted 6 months ago

deadwood wrote:

@deadwood - There is AROS_LC0NR variant of macros to handle void return type (NR stands for No-Return)


Amazing, thank you, what will we do without you.
D
deadwoodAROS Dev
Posted 6 months ago
Glad it solved the issue Smile
serk118uk, Amiwell79
serk118ukserk118ukSoftware Dev
Posted 6 months ago
Thank you , solved..
serk118ukserk118ukSoftware Dev
Posted 6 months ago
AmiSSL 64bit version ported , i need to upload to archives sooon.

Test run screenshoot at http://serk118.bl...
retrofaza, aha, Amiwell79, deadwood
AMIGASYSTEMAMIGASYSTEMDistro Maintainer
Posted 6 months ago
Thank 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)
A
ahaNewbie
Posted 6 months ago

serk118uk wrote:

@serk118uk - AmiSSL 64bit version ported , i need to upload to archives sooon.

Test run screenshoot at http://serk118.bl...


This is great, Serk!

Which version of AmiSSL is it?
serk118ukserk118ukSoftware Dev
Posted 6 months ago
It's in uploads..

@aha
It's recompile so same versions

@AMIGASYSTEM
I need to port arZip to zip files on 64bit 1st than see if I can port dopus5 , also port few of my other apps before I try other ports and also I need free time.

BTW I tried few tests so not tested well , any problems just use aros-exec since my Gmail is still full.
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You cannot download attachments in this forum.
Users who participated in discussion: serk118uk, aha, deadwood, AMIGASYSTEM