maria-developers team mailing list archive
Mailing list archive
Building MariaDB 3.1 Beta on HP-UX
Hi, I have downloaded the MariaDB 3.1 Beta sources and am trying to
build MariaDB on HP-UX 11.31 using the HP compilers and ran into a few
problems that I wanted to ask about. The first problem I ran into was
with anonymous unions (and structs).
Anonymous unions are part of the C++ standard, but not C (though the
GNU C compiler allows them). The header file include/ma_dyncol.h has
a structure, st_dynamic_column_value, which includes both anonymous
unions and anonymous structures and this file is included in both C
files (mysys/ma_dyncol.c and unittest/mysys/ma_dyncol-t.c) and C++ files
This is causing the HP C compiler problems since it doesn't allow
anonymous unions (or structs) by default. Now I can use a GNU
compatibility mode in the compiler (-Agcc) to allow this to compile,
but that creates other problems, specifically it causes the MariaDB
configure script to think I am using GCC (because __GNUC__ is defined
in this mode) and then it runs the ABI check which fails because the HP
compiler doesn't generate preprocessed source that exactly matches the
expected GNU compiler output due to minor changes in the output.
So I was wondering if this use of anonymous unions in C code was
intentional or unintentional? I was also wondering about the use of
the anonymous structs in the anonymous union as that is not part of the
C or C++ standards, though the GNU compilers only complain about this
when you use the -pedantic flag.
What solution to this issue would people recommend? We could use the
GNU compatibility mode with the HP compilers but would have to modify
the configure script to not run the ABI check. Or we could remove
the use of anonymous unions (and structs) from the C code in MariaDB.
I prefer the second option because it makes the C code more consistent
with the C99 standard.