[Maria-developers] 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 (sql/item_strfunc.cc). 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. Steve Ellcey sje@cup.hp.com
Hi, Steve! On Sep 21, Steve Ellcey wrote:
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.
Agree. Removing anonymous structs and unions would be a correct solution. I presume they were added unintentionally. Sorry for this. Regards, Sergei
Hi, Steve! FYI: I've just pushed a fix for this bug. Thanks for reporting it! On Sep 22, Sergei Golubchik wrote:
Hi, Steve!
On Sep 21, Steve Ellcey wrote:
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.
Agree. Removing anonymous structs and unions would be a correct solution.
I presume they were added unintentionally. Sorry for this.
Regards, Sergei
On Thu, 2011-09-22 at 11:10 +0200, Sergei Golubchik wrote:
Hi, Steve!
FYI: I've just pushed a fix for this bug. Thanks for reporting it!
Regards, Sergei
That's terrific Sergei, thanks a lot for fixing this. It will make building on HP-UX much easier. Steve Ellcey sje@cup.hp.com
participants (2)
-
Sergei Golubchik
-
Steve Ellcey