https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118831

--- Comment #13 from jcldc13 at gmail dot com ---
(In reply to Thomas Koenig from comment #12)
> (In reply to jcldc13 from comment #10)
> > (In reply to Jakub Jelinek from comment #6)

> > You can run by yourself my test case on x86 computer, and you'll always get,
> > pretty sure, "hello world" stored in "myval" variable. No random value,
> > except from aarch64 computer (at least from a Mac ARM)
> 
> Jakub already explained this.  This happens to work on x86_64 because of
> its application binary interface (aka the argument passing conventions).
> aarch64 has a different convention, and there it does not work.

 You say aarch64 has a different convention/behavior, it was not clear for me
in the previous posts. But ok then.

> 
> > Well, you are all gcc experts, and I am just a programmer. But how to
> > explain I have never got an issue on x86 if you say that I should get random
> > values ... ?
> 
> See above, this "works" on x86, but not on aarch64.  If you want
> your code to work on other architectures, you will have to rewrite
> the C functions as non-variadic (without the ...) and then
> call the right one, preferably using C interoperability.

 The idea of my library, was to use variadic C language function because it was
very useful. Tons of fortran programs have been developed using this library. I
can't change them, plus modify the library. I am gonna stop developing on Mac
arm then.

> 
> You can check for interface errors if you use -flto.

Reply via email to