Bug #36368 Compiling storage/falcon/BigInt.cpp fails using Sun Studio 12 compiler
Submitted: 28 Apr 2008 8:20 Modified: 5 Oct 2008 15:24
Reporter: Olav Sandstaa Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S3 (Non-critical)
Version:6.0 OS:Solaris
Assigned to: Hakan Küçükyılmaz CPU Architecture:Any
Tags: Sun Studio

[28 Apr 2008 8:20] Olav Sandstaa
Description:
When compiling Falcon with Sun Studio 12 compiler I get the following error when compiling storage/falcon/BigInt.cpp:

  "Value.h", line 185: Error: A union member cannot have a user-defined assignment
 operator

This is due to the member "timestamp" of type TimeStamp of the union has a user defined assignment operator.

The complete output from compiling BigInt.cpp:

/opt/studio12/SUNWspro/bin/CC -DHAVE_CONFIG_H -D_REENTRANT -D_PTHREADS -DENGINE 
-DSTORAGE_ENGINE -DNAMESPACE=Nfs -I. -I. -I../../include -I../../include -I../..
/include -I../../regex -I../../sql -I. -I./TransformLib     -m32 -mt   -DHAVE_RW
LOCK_T  -c -o libhafalcon_a-BigInt.o `test -f 'BigInt.cpp' || echo './'`BigInt.c
pp
"MemoryManager.h", line 85: Warning: attribute always_inline is unsupported and 
will be skipped..
"MemoryManager.h", line 86: Warning (Anachronism): The prior declaration for ope
rator new(unsigned) has an exception specification.
"MemoryManager.h", line 88: Warning: attribute always_inline is unsupported and 
will be skipped..
"MemoryManager.h", line 91: Warning: attribute always_inline is unsupported and 
will be skipped..
"MemoryManager.h", line 94: Warning: attribute always_inline is unsupported and 
will be skipped..
"MemoryManager.h", line 97: Warning: attribute always_inline is unsupported and 
will be skipped..
"MemoryManager.h", line 98: Warning (Anachronism): The prior declaration for ope
rator new[](unsigned) has an exception specification.
"MemoryManager.h", line 126: Warning: attribute always_inline is unsupported and
 will be skipped..
"MemoryManager.h", line 129: Warning: attribute always_inline is unsupported and
 will be skipped..
"MemoryManager.h", line 132: Warning: attribute always_inline is unsupported and
 will be skipped..
"MemoryManager.h", line 135: Warning: attribute always_inline is unsupported and
 will be skipped..
"MemoryManager.h", line 138: Warning: attribute always_inline is unsupported and
 will be skipped..
"MemoryManager.h", line 141: Warning: attribute always_inline is unsupported and
 will be skipped..
"Types.h", line 74: Warning: Identifier expected instead of "}".
"Types.h", line 107: Warning: Identifier expected instead of "}".
"Value.h", line 185: Error: A union member cannot have a user-defined assignment
 operator.
1 Error(s) and 15 Warning(s) detected.

How to repeat:
Compile MySQL including Falcon using Sun Studio 12 compiler with the following configure command:

  ./configure CC=/opt/studio12/SUNWspro/bin/cc CXX=/opt/studio12/SUNWspro/bin/CC CFLAGS="-Xa -m32 -mt" CXXFLAGS="-m32 -mt" --prefix=/home/os136802/install/mysql6 --with-named-curses=-lcurses --with-mysql-ldflags=-static --with-client-ldflags=-static --with-plugins=myisam,innobase,falcon
[28 Apr 2008 12:01] Olav Sandstaa
The lastest version of the C++ standard that I have available is the 1998 version. This states that objects that have a "non-trivial copy assignment operator" can not be part of a union (see Section 9.5).
[29 Apr 2008 0:55] Hakan Küçükyılmaz
Olav,

Jim Starkey jut pushed a fix for this issue. Can you please try mysql-6.0-falcon-team tree whether it fixes your issue?

Thanks,

Hakan
[29 Apr 2008 20:23] Olav Sandstaa
I have now verified that this fixes the problem with compiling the source file with the Sun Studio 12 compiler.

Thanks to Jim for fixing this so quickly.

Regards,
Olav
[29 Aug 2008 1:40] Kevin Lewis
This fix is in version 6.0.6
[5 Oct 2008 15:24] Jon Stephens
Documented in the 6.0.6 changelog as follows:

        Attempting to compile the server with Falcon support using the Sun
        Studio 12 compiler failed with the error "Value.h", line 185: Error: A 
        union member cannot have a user-defined assignment operator.