[cfarm-users] AIX portability
Bruno Haible
bruno at clisp.org
Tue Sep 20 23:29:35 CEST 2022
Kaz Kylheku wrote:
> Simple code like this doesn't compile:
>
> #include <netinet/in.h>
>
> // ...
>
> void foo(struct in6_addr *addr)
> {
> return bar(addr->s6_addr, 16);
> }
After fixing the gcc warning "‘return’ with a value, in function returning
void", this code compiles perfectly fine, both with gcc and xlc, with the
configuration from [1]:
$ cat foo.c
#include <netinet/in.h>
extern int bar (uint8_t *, size_t);
int
foo(struct in6_addr *addr)
{
return bar (addr->s6_addr, 16);
}
$ CC="gcc -maix64"; CXX="g++ -maix64"; AR="ar -X 64"; NM="nm -X 64 -B"; export CC CXX AR NM
$ $CC -Wall -c foo.c
$ CC="xlc -q64 -qthreaded -qtls"; CXX="xlC -q64 -qthreaded -qtls"; AR="ar -X 64"; NM="nm -X 64 -B"; export CC CXX AR NM
$ $CC -c foo.c
This is on gcc119.fsffrance.org (AIX 7.2). About which AIX and GCC versions
were you complaining?
Bruno
[1] https://gitlab.com/ghwiki/gnow-how/-/wikis/Platforms/Configuration
More information about the cfarm-users
mailing list