Maybe this is a gcc version thing. I use 4.4 in this case. MySQL added -Werror when --with-debug is used. That broke the official build (the problem is in the extra subdir). It also broke changes from Percona
cc1: warnings being treated as errors
In file included from ./include/buf0buf.h:1571, from ./include/page0page.h:33, from ./include/page0cur.h:32, from ./include/btr0btr.h:33, from btr/btr0btr.c:26:
./include/buf0buf.ic: In function ‘buf_page_release’:
./include/buf0buf.ic:1078: error: unused parameter ‘mtr’
cc1: warnings being treated as errors
In file included from ./include/buf0buf.h:1571, from ./include/page0page.h:33, from ./include/page0cur.h:32, from ./include/btr0cur.h:31, from btr/btr0cur.c:44:
./include/buf0buf.ic: In function ‘buf_page_release’:
./include/buf0buf.ic:1078: error: unused parameter ‘mtr’
make[2]: *** [libinnobase_a-btr0btr.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [libinnobase_a-btr0cur.o] Error 1
and another error, I haven't seen this before
cc1: warnings being treated as errors
buf/buf0buddy.c: In function ‘buf_buddy_relocate’:
buf/buf0buddy.c:493: error: ISO C90 forbids mixed declarations and code
the problem is that code was added before declarations
/* We look inside the allocated objects returned by buf_buddy_alloc() and assume that anything of PAGE_ZIP_MIN_SIZE or larger is a compressed page that contains
a valid space_id and page_no in the page header. Should the
fields be invalid, we will be unable to relocate the block.
We also assume that anything that fits sizeof(buf_page_t)
actually is a properly initialized buf_page_t object. */
if (size >= PAGE_ZIP_MIN_SIZE) {
/* This is a compressed page. */ mutex_t* mutex;
if (!have_page_hash_mutex) { mutex_exit(&zip_free_mutex); mutex_enter(&LRU_list_mutex); rw_lock_x_lock(&page_hash_latch);
}
/* The src block may be split into smaller blocks, some of which may be free. Thus, the mach_read_from_4() calls below may attempt to read from free memory. The memory is "owned" by the buddy allocator (and it has been allocated from the buffer pool), so there is nothing wrong about this. The mach_read_from_4() calls here will only trigger bogus Valgrind memcheck warnings in UNIV_DEBUG_VALGRIND builds. */ ulint space = mach_read_from_4( (const byte*) src + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); ulint page_no = mach_read_from_4( (const byte*) src + FIL_PAGE_OFFSET);
After that I gave up and removed Werror from Makefile
I encountered this in the 5.1.54 release branch
Maybe this is a gcc version thing. I use 4.4 in this case. MySQL added -Werror when --with-debug is used. That broke the official build (the problem is in the extra subdir). It also broke changes from Percona
My configure line: thread- safe-client --with- plugins= partition, csv,blackhole, myisam, heap,innodb_ plugin --without- plugin- innobase --with-fast-mutexes --with- extra-charsets= all --with-debug C_EXTRA_ FLAGS=" -fno-omit- frame-pointer -fno-strict- aliasing -DHAVE_purify -Wall" CFLAGS="-O0 -g" CXXFLAGS="-g -O0"
./configure --enable-
cc1: warnings being treated as errors buf0buf. h:1571,
from ./include/ page0page. h:33,
from ./include/ page0cur. h:32,
from ./include/ btr0btr. h:33,
from btr/btr0btr.c:26: buf0buf. ic: In function ‘buf_page_release’: buf0buf. ic:1078: error: unused parameter ‘mtr’ buf0buf. h:1571,
from ./include/ page0page. h:33,
from ./include/ page0cur. h:32,
from ./include/ btr0cur. h:31,
from btr/btr0cur.c:44: buf0buf. ic: In function ‘buf_page_release’: buf0buf. ic:1078: error: unused parameter ‘mtr’ a-btr0btr. o] Error 1 a-btr0cur. o] Error 1
In file included from ./include/
./include/
./include/
cc1: warnings being treated as errors
In file included from ./include/
./include/
./include/
make[2]: *** [libinnobase_
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [libinnobase_
and another error, I haven't seen this before
cc1: warnings being treated as errors relocate’ : c:493: error: ISO C90 forbids mixed declarations and code
buf/buf0buddy.c: In function ‘buf_buddy_
buf/buf0buddy.
the problem is that code was added before declarations
/* We look inside the allocated objects returned by
buf_buddy_ alloc() and assume that anything of
PAGE_ZIP_ MIN_SIZE or larger is a compressed page that contains
a valid space_id and page_no in the page header. Should the
fields be invalid, we will be unable to relocate the block.
We also assume that anything that fits sizeof(buf_page_t)
actually is a properly initialized buf_page_t object. */
if (size >= PAGE_ZIP_MIN_SIZE) {
mutex_ t* mutex;
/* This is a compressed page. */
if (!have_ page_hash_ mutex) {
mutex_ exit(&zip_ free_mutex) ;
mutex_ enter(& LRU_list_ mutex);
rw_lock_ x_lock( &page_hash_ latch);
}
/* The src block may be split into smaller blocks,
some of which may be free. Thus, the
mach_ read_from_ 4() calls below may attempt to read
from free memory. The memory is "owned" by the buddy
allocator (and it has been allocated from the buffer
pool) , so there is nothing wrong about this. The
mach_ read_from_ 4() calls here will only trigger bogus
Valgrind memcheck warnings in UNIV_DEBUG_VALGRIND builds. */
ulint space = mach_read_from_4(
(const byte*) src + FIL_PAGE_ ARCH_LOG_ NO_OR_SPACE_ ID);
ulint page_no = mach_read_from_4(
(const byte*) src + FIL_PAGE_OFFSET);
After that I gave up and removed Werror from Makefile