Merge lp:~linuxjedi/libdrizzle/5.1-compiler-fixes into lp:libdrizzle

Proposed by Andrew Hutchings
Status: Merged
Approved by: Andrew Hutchings
Approved revision: no longer in the source branch.
Merged at revision: 120
Proposed branch: lp:~linuxjedi/libdrizzle/5.1-compiler-fixes
Merge into: lp:libdrizzle
Diff against target: 258 lines (+35/-16)
6 files modified
libdrizzle/binlog.cc (+2/-2)
libdrizzle/conn.cc (+2/-2)
libdrizzle/field.cc (+2/-2)
libdrizzle/statement_param.cc (+8/-8)
m4/ax_harden_compiler_flags.m4 (+4/-2)
tests/unit/include.am (+17/-0)
To merge this branch: bzr merge lp:~linuxjedi/libdrizzle/5.1-compiler-fixes
Reviewer Review Type Date Requested Status
Drizzle Trunk Pending
Review via email: mp+161236@code.launchpad.net

Description of the change

Fixes for clang and mingw compiling

To post a comment you must log in.
120. By Drizzle Continuous Integration

Merge lp:~linuxjedi/libdrizzle/5.1-compiler-fixes Build: jenkins-Libdrizzle-94

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libdrizzle/binlog.cc'
--- libdrizzle/binlog.cc 2013-03-25 21:23:36 +0000
+++ libdrizzle/binlog.cc 2013-04-26 20:55:33 +0000
@@ -316,7 +316,7 @@
316 if (con->packet_size != binlog_event->length)316 if (con->packet_size != binlog_event->length)
317 {317 {
318 drizzle_set_error(con, "drizzle_state_binlog_read",318 drizzle_set_error(con, "drizzle_state_binlog_read",
319 "packet size error:%"PRIu32":%"PRIu32, con->packet_size, binlog_event->length);319 "packet size error:%" PRIu32 ":%" PRIu32, con->packet_size, binlog_event->length);
320 con->binlog->error_fn(DRIZZLE_RETURN_UNEXPECTED_DATA, con, con->binlog->binlog_context);320 con->binlog->error_fn(DRIZZLE_RETURN_UNEXPECTED_DATA, con, con->binlog->binlog_context);
321 return DRIZZLE_RETURN_UNEXPECTED_DATA;321 return DRIZZLE_RETURN_UNEXPECTED_DATA;
322 }322 }
@@ -374,7 +374,7 @@
374 event_crc= (uint32_t)crc32(0, binlog_event->raw_data, (binlog_event->raw_length - DRIZZLE_BINLOG_CRC32_LEN));374 event_crc= (uint32_t)crc32(0, binlog_event->raw_data, (binlog_event->raw_length - DRIZZLE_BINLOG_CRC32_LEN));
375 if (event_crc != binlog_event->checksum)375 if (event_crc != binlog_event->checksum)
376 {376 {
377 drizzle_set_error(con, __func__, "CRC doesn't match: 0x%"PRIX32", 0x%"PRIX32, event_crc, binlog_event->checksum);377 drizzle_set_error(con, __func__, "CRC doesn't match: 0x%" PRIX32 ", 0x%" PRIX32, event_crc, binlog_event->checksum);
378 con->binlog->error_fn(DRIZZLE_RETURN_BINLOG_CRC, con, con->binlog->binlog_context);378 con->binlog->error_fn(DRIZZLE_RETURN_BINLOG_CRC, con, con->binlog->binlog_context);
379 return DRIZZLE_RETURN_BINLOG_CRC;379 return DRIZZLE_RETURN_BINLOG_CRC;
380 }380 }
381381
=== modified file 'libdrizzle/conn.cc'
--- libdrizzle/conn.cc 2013-03-25 21:44:12 +0000
+++ libdrizzle/conn.cc 2013-04-26 20:55:33 +0000
@@ -1445,7 +1445,7 @@
1445 return DRIZZLE_RETURN_INVALID_ARGUMENT;1445 return DRIZZLE_RETURN_INVALID_ARGUMENT;
1446 }1446 }
14471447
1448#if HAVE_FCNTL && !defined(SOCK_CLOEXEC) && defined(FD_CLOEXEC)1448#if defined(HAVE_FCNTL) && !defined(SOCK_CLOEXEC) && defined(FD_CLOEXEC)
1449 {1449 {
1450 int flags;1450 int flags;
1451 do1451 do
@@ -1561,7 +1561,7 @@
1561 drizzle_set_error(con, __func__, "setsockopt(SO_NOSIGPIPE): %s", strerror(errno));1561 drizzle_set_error(con, __func__, "setsockopt(SO_NOSIGPIPE): %s", strerror(errno));
1562 return DRIZZLE_RETURN_ERRNO;1562 return DRIZZLE_RETURN_ERRNO;
1563 }1563 }
1564#elif HAVE_FCNTL && defined(F_SETNOSIGPIPE)1564#elif defined(HAVE_FCNTL) && defined(F_SETNOSIGPIPE)
1565 ret= fcntl(con->fd, F_SETNOSIGPIPE, 1);1565 ret= fcntl(con->fd, F_SETNOSIGPIPE, 1);
1566 1566
1567 if (ret == -1)1567 if (ret == -1)
15681568
=== modified file 'libdrizzle/field.cc'
--- libdrizzle/field.cc 2013-04-25 13:04:25 +0000
+++ libdrizzle/field.cc 2013-04-26 20:55:33 +0000
@@ -239,7 +239,7 @@
239 }239 }
240240
241 drizzle_log_debug(con,241 drizzle_log_debug(con,
242 "field_offset= %"PRIu64", field_size= %zu, field_total= %"PRIu64,242 "field_offset= %" PRIu64 ", field_size= %zu, field_total= %" PRIu64,
243 con->result->field_offset, con->result->field_size,243 con->result->field_offset, con->result->field_size,
244 con->result->field_total);244 con->result->field_total);
245245
@@ -295,7 +295,7 @@
295 con->packet_size-= con->result->field_size;295 con->packet_size-= con->result->field_size;
296296
297 drizzle_log_debug(con,297 drizzle_log_debug(con,
298 "field_offset= %"PRIu64", field_size= %zu, field_total= %"PRIu64,298 "field_offset= %" PRIu64 ", field_size= %zu, field_total= %" PRIu64,
299 con->result->field_offset, con->result->field_size,299 con->result->field_offset, con->result->field_size,
300 con->result->field_total);300 con->result->field_total);
301301
302302
=== modified file 'libdrizzle/statement_param.cc'
--- libdrizzle/statement_param.cc 2013-04-25 10:15:18 +0000
+++ libdrizzle/statement_param.cc 2013-04-26 20:55:33 +0000
@@ -599,11 +599,11 @@
599 char* buffer= param->data_buffer + 50;599 char* buffer= param->data_buffer + 50;
600 if (param->options.is_unsigned)600 if (param->options.is_unsigned)
601 {601 {
602 snprintf(buffer, 12, "%"PRIu32, val);602 snprintf(buffer, 12, "%" PRIu32, val);
603 }603 }
604 else604 else
605 {605 {
606 snprintf(buffer, 12, "%"PRId32, (int32_t)val);606 snprintf(buffer, 12, "%" PRId32, (int32_t)val);
607 }607 }
608 return buffer;608 return buffer;
609}609}
@@ -614,11 +614,11 @@
614 char* buffer= param->data_buffer + 50;614 char* buffer= param->data_buffer + 50;
615 if (param->options.is_unsigned)615 if (param->options.is_unsigned)
616 { 616 {
617 snprintf(buffer, 21, "%"PRIu64, val);617 snprintf(buffer, 21, "%" PRIu64, val);
618 }618 }
619 else619 else
620 {620 {
621 snprintf(buffer, 21, "%"PRId64, (int64_t)val);621 snprintf(buffer, 21, "%" PRId64, (int64_t)val);
622 }622 }
623 return buffer;623 return buffer;
624}624}
@@ -639,7 +639,7 @@
639 int used = 0;639 int used = 0;
640 640
641 /* Values are transferred with days separated from hours, but presented with days folded into hours. */641 /* Values are transferred with days separated from hours, but presented with days folded into hours. */
642 used = snprintf(buffer, buffersize-used, "%s%02u:%02"PRIu8":%02"PRIu8, (time->negative) ? "-" : "", time->hour + 24 * time->day, time->minute, time->second);642 used = snprintf(buffer, buffersize-used, "%s%02u:%02" PRIu8 ":%02" PRIu8, (time->negative) ? "-" : "", time->hour + 24 * time->day, time->minute, time->second);
643643
644 /* TODO: the existence (and length) of the decimals should be decided based on the number of fields sent by the server or possibly the column's "decimals" value, not by whether the microseconds are 0 */644 /* TODO: the existence (and length) of the decimals should be decided based on the number of fields sent by the server or possibly the column's "decimals" value, not by whether the microseconds are 0 */
645 if (time->microsecond || time->show_microseconds)645 if (time->microsecond || time->show_microseconds)
@@ -657,19 +657,19 @@
657 int buffersize = 27;657 int buffersize = 27;
658 int used = 0;658 int used = 0;
659 659
660 used += snprintf(buffer, buffersize-used, "%04"PRIu16"-%02"PRIu8"-%02"PRIu32,660 used += snprintf(buffer, buffersize-used, "%04" PRIu16 "-%02" PRIu8 "-%02" PRIu32,
661 timestamp->year, timestamp->month, timestamp->day);661 timestamp->year, timestamp->month, timestamp->day);
662 assert(used < buffersize);662 assert(used < buffersize);
663 663
664 if (param->type == DRIZZLE_COLUMN_TYPE_DATE)664 if (param->type == DRIZZLE_COLUMN_TYPE_DATE)
665 return buffer;665 return buffer;
666 666
667 used += snprintf(buffer+used, buffersize-used, " %02"PRIu16":%02"PRIu8":%02"PRIu8,667 used += snprintf(buffer+used, buffersize-used, " %02" PRIu16 ":%02" PRIu8 ":%02" PRIu8,
668 timestamp->hour, timestamp->minute, timestamp->second);668 timestamp->hour, timestamp->minute, timestamp->second);
669669
670 if (timestamp->microsecond || timestamp->show_microseconds)670 if (timestamp->microsecond || timestamp->show_microseconds)
671 {671 {
672 used += snprintf(buffer+used, buffersize-used, ".%06"PRIu32, timestamp->microsecond);672 used += snprintf(buffer+used, buffersize-used, ".%06" PRIu32, timestamp->microsecond);
673 }673 }
674 674
675 assert(used < buffersize);675 assert(used < buffersize);
676676
=== modified file 'm4/ax_harden_compiler_flags.m4'
--- m4/ax_harden_compiler_flags.m4 2013-01-10 12:04:23 +0000
+++ m4/ax_harden_compiler_flags.m4 2013-04-26 20:55:33 +0000
@@ -102,7 +102,8 @@
102 _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])102 _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])
103 _APPEND_COMPILE_FLAGS_ERROR([-std=c99])103 _APPEND_COMPILE_FLAGS_ERROR([-std=c99])
104# Anything below this comment please keep sorted.104# Anything below this comment please keep sorted.
105 _APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])105 AS_IF([test "x$CC_VERSION_VENDOR" != xclang],
106 [_APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])], [])
106# _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])107# _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])
107 _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes])108 _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes])
108 _APPEND_COMPILE_FLAGS_ERROR([-Waddress])109 _APPEND_COMPILE_FLAGS_ERROR([-Waddress])
@@ -187,7 +188,8 @@
187 _APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas])188 _APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas])
188 _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])189 _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])
189# Anything below this comment please keep sorted.190# Anything below this comment please keep sorted.
190 _APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])191 AS_IF([test "x$CXX_VERSION_VENDOR" != xclang],
192 [_APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])], [])
191# _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])193# _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])
192 _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes])194 _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes])
193 _APPEND_COMPILE_FLAGS_ERROR([-Waddress])195 _APPEND_COMPILE_FLAGS_ERROR([-Waddress])
194196
=== modified file 'tests/unit/include.am'
--- tests/unit/include.am 2013-04-25 10:15:18 +0000
+++ tests/unit/include.am 2013-04-26 20:55:33 +0000
@@ -2,6 +2,9 @@
2# included from Top Level Makefile.am2# included from Top Level Makefile.am
3# All paths should be given relative to the root3# All paths should be given relative to the root
44
5# dummy.cxx is a hack to make MinGW link with C++
6# See http://www.gnu.org/software/automake/manual/html_node/Libtool-Convenience-Libraries.html
7
5noinst_HEADERS+= tests/unit/common.h8noinst_HEADERS+= tests/unit/common.h
69
7tests_unit_binlog_SOURCES= tests/unit/binlog.cc tests/unit/common.c10tests_unit_binlog_SOURCES= tests/unit/binlog.cc tests/unit/common.c
@@ -20,21 +23,25 @@
2023
21tests_unit_escape_SOURCES= tests/unit/escape.c24tests_unit_escape_SOURCES= tests/unit/escape.c
22tests_unit_escape_LDADD= libdrizzle/libdrizzle.la25tests_unit_escape_LDADD= libdrizzle/libdrizzle.la
26nodist_EXTRA_tests_unit_escape_SOURCES = dummy.cxx
23check_PROGRAMS+= tests/unit/escape27check_PROGRAMS+= tests/unit/escape
24noinst_PROGRAMS+= tests/unit/escape28noinst_PROGRAMS+= tests/unit/escape
2529
26tests_unit_insert_id_SOURCES= tests/unit/insert_id.c30tests_unit_insert_id_SOURCES= tests/unit/insert_id.c
27tests_unit_insert_id_LDADD= libdrizzle/libdrizzle.la31tests_unit_insert_id_LDADD= libdrizzle/libdrizzle.la
32nodist_EXTRA_tests_unit_insert_id_SOURCES = dummy.cxx
28check_PROGRAMS+= tests/unit/insert_id33check_PROGRAMS+= tests/unit/insert_id
29noinst_PROGRAMS+= tests/unit/insert_id34noinst_PROGRAMS+= tests/unit/insert_id
3035
31tests_unit_query_SOURCES= tests/unit/query.c36tests_unit_query_SOURCES= tests/unit/query.c
32tests_unit_query_LDADD= libdrizzle/libdrizzle.la37tests_unit_query_LDADD= libdrizzle/libdrizzle.la
38nodist_EXTRA_tests_unit_query_SOURCES = dummy.cxx
33check_PROGRAMS+= tests/unit/query39check_PROGRAMS+= tests/unit/query
34noinst_PROGRAMS+= tests/unit/query40noinst_PROGRAMS+= tests/unit/query
3541
36tests_unit_column_SOURCES= tests/unit/column.c tests/unit/common.c42tests_unit_column_SOURCES= tests/unit/column.c tests/unit/common.c
37tests_unit_column_LDADD= libdrizzle/libdrizzle.la43tests_unit_column_LDADD= libdrizzle/libdrizzle.la
44nodist_EXTRA_tests_unit_column_SOURCES = dummy.cxx
38check_PROGRAMS+= tests/unit/column45check_PROGRAMS+= tests/unit/column
39noinst_PROGRAMS+= tests/unit/column46noinst_PROGRAMS+= tests/unit/column
4047
@@ -50,26 +57,31 @@
50tests_unit_numbers_SOURCES= tests/unit/numbers.c tests/unit/common.c57tests_unit_numbers_SOURCES= tests/unit/numbers.c tests/unit/common.c
51tests_unit_numbers_LDADD= libdrizzle/libdrizzle.la58tests_unit_numbers_LDADD= libdrizzle/libdrizzle.la
52tests_unit_numbers_LDADD+= -lm59tests_unit_numbers_LDADD+= -lm
60nodist_EXTRA_tests_unit_numbers_SOURCES = dummy.cxx
53check_PROGRAMS+= tests/unit/numbers61check_PROGRAMS+= tests/unit/numbers
54noinst_PROGRAMS+= tests/unit/numbers62noinst_PROGRAMS+= tests/unit/numbers
5563
56tests_unit_datetypes_SOURCES= tests/unit/datetypes.c tests/unit/common.c64tests_unit_datetypes_SOURCES= tests/unit/datetypes.c tests/unit/common.c
57tests_unit_datetypes_LDADD= libdrizzle/libdrizzle.la65tests_unit_datetypes_LDADD= libdrizzle/libdrizzle.la
66nodist_EXTRA_tests_unit_datetypes_SOURCES = dummy.cxx
58check_PROGRAMS+= tests/unit/datetypes67check_PROGRAMS+= tests/unit/datetypes
59noinst_PROGRAMS+= tests/unit/datetypes68noinst_PROGRAMS+= tests/unit/datetypes
6069
61tests_unit_nulls_SOURCES= tests/unit/nulls.c tests/unit/common.c70tests_unit_nulls_SOURCES= tests/unit/nulls.c tests/unit/common.c
62tests_unit_nulls_LDADD= libdrizzle/libdrizzle.la71tests_unit_nulls_LDADD= libdrizzle/libdrizzle.la
72nodist_EXTRA_tests_unit_nulls_SOURCES = dummy.cxx
63check_PROGRAMS+= tests/unit/nulls73check_PROGRAMS+= tests/unit/nulls
64noinst_PROGRAMS+= tests/unit/nulls74noinst_PROGRAMS+= tests/unit/nulls
6575
66tests_unit_row_SOURCES= tests/unit/row.c76tests_unit_row_SOURCES= tests/unit/row.c
67tests_unit_row_LDADD= libdrizzle/libdrizzle.la77tests_unit_row_LDADD= libdrizzle/libdrizzle.la
78nodist_EXTRA_tests_unit_row_SOURCES = dummy.cxx
68check_PROGRAMS+= tests/unit/row79check_PROGRAMS+= tests/unit/row
69noinst_PROGRAMS+= tests/unit/row80noinst_PROGRAMS+= tests/unit/row
7081
71tests_unit_version_SOURCES= tests/unit/version.c82tests_unit_version_SOURCES= tests/unit/version.c
72tests_unit_version_LDADD= libdrizzle/libdrizzle.la83tests_unit_version_LDADD= libdrizzle/libdrizzle.la
84nodist_EXTRA_tests_unit_version_SOURCES = dummy.cxx
73check_PROGRAMS+= tests/unit/version85check_PROGRAMS+= tests/unit/version
74noinst_PROGRAMS+= tests/unit/version86noinst_PROGRAMS+= tests/unit/version
7587
@@ -80,6 +92,7 @@
8092
81tests_unit_connect_SOURCES= tests/unit/connect.c93tests_unit_connect_SOURCES= tests/unit/connect.c
82tests_unit_connect_LDADD= libdrizzle/libdrizzle.la94tests_unit_connect_LDADD= libdrizzle/libdrizzle.la
95nodist_EXTRA_tests_unit_connect_SOURCES = dummy.cxx
83check_PROGRAMS+= tests/unit/connect96check_PROGRAMS+= tests/unit/connect
84noinst_PROGRAMS+= tests/unit/connect97noinst_PROGRAMS+= tests/unit/connect
8598
@@ -94,21 +107,25 @@
94107
95tests_unit_connect_uds_SOURCES= tests/unit/connect_uds.c tests/unit/common.c108tests_unit_connect_uds_SOURCES= tests/unit/connect_uds.c tests/unit/common.c
96tests_unit_connect_uds_LDADD= libdrizzle/libdrizzle.la109tests_unit_connect_uds_LDADD= libdrizzle/libdrizzle.la
110nodist_EXTRA_tests_unit_connect_uds_SOURCES = dummy.cxx
97check_PROGRAMS+= tests/unit/connect_uds111check_PROGRAMS+= tests/unit/connect_uds
98noinst_PROGRAMS+= tests/unit/connect_uds112noinst_PROGRAMS+= tests/unit/connect_uds
99113
100tests_unit_unbuffered_query_SOURCES= tests/unit/unbuffered_query.c114tests_unit_unbuffered_query_SOURCES= tests/unit/unbuffered_query.c
101tests_unit_unbuffered_query_LDADD= libdrizzle/libdrizzle.la115tests_unit_unbuffered_query_LDADD= libdrizzle/libdrizzle.la
116nodist_EXTRA_tests_unit_unbuffered_query_SOURCES = dummy.cxx
102check_PROGRAMS+= tests/unit/unbuffered_query117check_PROGRAMS+= tests/unit/unbuffered_query
103noinst_PROGRAMS+= tests/unit/unbuffered_query118noinst_PROGRAMS+= tests/unit/unbuffered_query
104119
105tests_unit_statement_SOURCES= tests/unit/statement.c120tests_unit_statement_SOURCES= tests/unit/statement.c
106tests_unit_statement_LDADD= libdrizzle/libdrizzle.la121tests_unit_statement_LDADD= libdrizzle/libdrizzle.la
122nodist_EXTRA_tests_unit_statement_SOURCES = dummy.cxx
107check_PROGRAMS+= tests/unit/statement123check_PROGRAMS+= tests/unit/statement
108noinst_PROGRAMS+= tests/unit/statement124noinst_PROGRAMS+= tests/unit/statement
109125
110tests_unit_statement_char_SOURCES= tests/unit/statement_char.c126tests_unit_statement_char_SOURCES= tests/unit/statement_char.c
111tests_unit_statement_char_LDADD= libdrizzle/libdrizzle.la127tests_unit_statement_char_LDADD= libdrizzle/libdrizzle.la
128nodist_EXTRA_tests_unit_statement_char_SOURCES = dummy.cxx
112check_PROGRAMS+= tests/unit/statement_char129check_PROGRAMS+= tests/unit/statement_char
113noinst_PROGRAMS+= tests/unit/statement_char130noinst_PROGRAMS+= tests/unit/statement_char
114131

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: