Build failure on debian
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
Critical
|
Jay Pipes |
Bug Description
Stewart's 64bit Debian machine is failing to compile. Not sure exactly when this started as it has been awhile since we have been able to compile on this machine
See the complete log at http://
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I. -ggdb3 -pthread -pipe -O3 -Werror -pedantic -Wall -Wextra -Wundef -Wshadow -fdiagnostics-
cc1plus: warnings being treated as errors
plugin/
plugin/
Related branches
- Brian Aker: Pending requested
- Drizzle Developers: Pending requested
-
Diff: 129 lines (+23/-23)2 files modifieddrizzled/temporal_format.cc (+23/-22)
drizzled/temporal_format.h (+0/-1)
Changed in drizzle: | |
assignee: | nobody → Jay Pipes (jaypipes) |
importance: | Undecided → Critical |
milestone: | none → bell |
status: | New → Confirmed |
Changed in drizzle: | |
status: | In Progress → Fix Committed |
Changed in drizzle: | |
status: | Confirmed → Fix Released |
Not sure what is going on here. It's a call to one of the lovely korr.h macros:
int8store( nbo_length, length);
nbo_length is declared as unsigned char[8] and length is declared as size_t.
This macros is variously #defined, based on arch and byte-alignment as:
i386:
#define int8store(T,A) *((uint64_t *) (T))= (uint64_t) (A)
SPARC:
#define int8store(T,A) do { uint32_t def_temp= (uint32_t) (A), def_temp2= (uint32_t) ((A) >> 32); \
int4store ((T),def_ temp); \
int4store ((T+4), def_temp2) ; } while(0)
Clearly, the issue here is that a size_t -- the length variable -- is being bit-shifted 32 bits to the right. On all *sane* platforms, a size_t is unsigned, either 32 or 64 bit integers. Of course, on SPARC, it's not. It's a signed integer, and shifting 32 bits goes beyond the signed integer boundary.
Short of fixing SPARC to be not-stoopid, the solution to this is to use an uint32_t instead of a size_t, and then static_ cast<size_ t>(length) in all the cases (most of them) where length is needed in GPB calls.
I will fix this shortly.
Screw SPARC. :)
-jay