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

Proposed by Andrew Hutchings on 2013-04-26
Status: Merged
Approved by: Andrew Hutchings on 2013-04-26
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 2013-04-26 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 on 2013-04-26

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
1=== modified file 'libdrizzle/binlog.cc'
2--- libdrizzle/binlog.cc 2013-03-25 21:23:36 +0000
3+++ libdrizzle/binlog.cc 2013-04-26 20:55:33 +0000
4@@ -316,7 +316,7 @@
5 if (con->packet_size != binlog_event->length)
6 {
7 drizzle_set_error(con, "drizzle_state_binlog_read",
8- "packet size error:%"PRIu32":%"PRIu32, con->packet_size, binlog_event->length);
9+ "packet size error:%" PRIu32 ":%" PRIu32, con->packet_size, binlog_event->length);
10 con->binlog->error_fn(DRIZZLE_RETURN_UNEXPECTED_DATA, con, con->binlog->binlog_context);
11 return DRIZZLE_RETURN_UNEXPECTED_DATA;
12 }
13@@ -374,7 +374,7 @@
14 event_crc= (uint32_t)crc32(0, binlog_event->raw_data, (binlog_event->raw_length - DRIZZLE_BINLOG_CRC32_LEN));
15 if (event_crc != binlog_event->checksum)
16 {
17- drizzle_set_error(con, __func__, "CRC doesn't match: 0x%"PRIX32", 0x%"PRIX32, event_crc, binlog_event->checksum);
18+ drizzle_set_error(con, __func__, "CRC doesn't match: 0x%" PRIX32 ", 0x%" PRIX32, event_crc, binlog_event->checksum);
19 con->binlog->error_fn(DRIZZLE_RETURN_BINLOG_CRC, con, con->binlog->binlog_context);
20 return DRIZZLE_RETURN_BINLOG_CRC;
21 }
22
23=== modified file 'libdrizzle/conn.cc'
24--- libdrizzle/conn.cc 2013-03-25 21:44:12 +0000
25+++ libdrizzle/conn.cc 2013-04-26 20:55:33 +0000
26@@ -1445,7 +1445,7 @@
27 return DRIZZLE_RETURN_INVALID_ARGUMENT;
28 }
29
30-#if HAVE_FCNTL && !defined(SOCK_CLOEXEC) && defined(FD_CLOEXEC)
31+#if defined(HAVE_FCNTL) && !defined(SOCK_CLOEXEC) && defined(FD_CLOEXEC)
32 {
33 int flags;
34 do
35@@ -1561,7 +1561,7 @@
36 drizzle_set_error(con, __func__, "setsockopt(SO_NOSIGPIPE): %s", strerror(errno));
37 return DRIZZLE_RETURN_ERRNO;
38 }
39-#elif HAVE_FCNTL && defined(F_SETNOSIGPIPE)
40+#elif defined(HAVE_FCNTL) && defined(F_SETNOSIGPIPE)
41 ret= fcntl(con->fd, F_SETNOSIGPIPE, 1);
42
43 if (ret == -1)
44
45=== modified file 'libdrizzle/field.cc'
46--- libdrizzle/field.cc 2013-04-25 13:04:25 +0000
47+++ libdrizzle/field.cc 2013-04-26 20:55:33 +0000
48@@ -239,7 +239,7 @@
49 }
50
51 drizzle_log_debug(con,
52- "field_offset= %"PRIu64", field_size= %zu, field_total= %"PRIu64,
53+ "field_offset= %" PRIu64 ", field_size= %zu, field_total= %" PRIu64,
54 con->result->field_offset, con->result->field_size,
55 con->result->field_total);
56
57@@ -295,7 +295,7 @@
58 con->packet_size-= con->result->field_size;
59
60 drizzle_log_debug(con,
61- "field_offset= %"PRIu64", field_size= %zu, field_total= %"PRIu64,
62+ "field_offset= %" PRIu64 ", field_size= %zu, field_total= %" PRIu64,
63 con->result->field_offset, con->result->field_size,
64 con->result->field_total);
65
66
67=== modified file 'libdrizzle/statement_param.cc'
68--- libdrizzle/statement_param.cc 2013-04-25 10:15:18 +0000
69+++ libdrizzle/statement_param.cc 2013-04-26 20:55:33 +0000
70@@ -599,11 +599,11 @@
71 char* buffer= param->data_buffer + 50;
72 if (param->options.is_unsigned)
73 {
74- snprintf(buffer, 12, "%"PRIu32, val);
75+ snprintf(buffer, 12, "%" PRIu32, val);
76 }
77 else
78 {
79- snprintf(buffer, 12, "%"PRId32, (int32_t)val);
80+ snprintf(buffer, 12, "%" PRId32, (int32_t)val);
81 }
82 return buffer;
83 }
84@@ -614,11 +614,11 @@
85 char* buffer= param->data_buffer + 50;
86 if (param->options.is_unsigned)
87 {
88- snprintf(buffer, 21, "%"PRIu64, val);
89+ snprintf(buffer, 21, "%" PRIu64, val);
90 }
91 else
92 {
93- snprintf(buffer, 21, "%"PRId64, (int64_t)val);
94+ snprintf(buffer, 21, "%" PRId64, (int64_t)val);
95 }
96 return buffer;
97 }
98@@ -639,7 +639,7 @@
99 int used = 0;
100
101 /* Values are transferred with days separated from hours, but presented with days folded into hours. */
102- used = snprintf(buffer, buffersize-used, "%s%02u:%02"PRIu8":%02"PRIu8, (time->negative) ? "-" : "", time->hour + 24 * time->day, time->minute, time->second);
103+ used = snprintf(buffer, buffersize-used, "%s%02u:%02" PRIu8 ":%02" PRIu8, (time->negative) ? "-" : "", time->hour + 24 * time->day, time->minute, time->second);
104
105 /* 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 */
106 if (time->microsecond || time->show_microseconds)
107@@ -657,19 +657,19 @@
108 int buffersize = 27;
109 int used = 0;
110
111- used += snprintf(buffer, buffersize-used, "%04"PRIu16"-%02"PRIu8"-%02"PRIu32,
112+ used += snprintf(buffer, buffersize-used, "%04" PRIu16 "-%02" PRIu8 "-%02" PRIu32,
113 timestamp->year, timestamp->month, timestamp->day);
114 assert(used < buffersize);
115
116 if (param->type == DRIZZLE_COLUMN_TYPE_DATE)
117 return buffer;
118
119- used += snprintf(buffer+used, buffersize-used, " %02"PRIu16":%02"PRIu8":%02"PRIu8,
120+ used += snprintf(buffer+used, buffersize-used, " %02" PRIu16 ":%02" PRIu8 ":%02" PRIu8,
121 timestamp->hour, timestamp->minute, timestamp->second);
122
123 if (timestamp->microsecond || timestamp->show_microseconds)
124 {
125- used += snprintf(buffer+used, buffersize-used, ".%06"PRIu32, timestamp->microsecond);
126+ used += snprintf(buffer+used, buffersize-used, ".%06" PRIu32, timestamp->microsecond);
127 }
128
129 assert(used < buffersize);
130
131=== modified file 'm4/ax_harden_compiler_flags.m4'
132--- m4/ax_harden_compiler_flags.m4 2013-01-10 12:04:23 +0000
133+++ m4/ax_harden_compiler_flags.m4 2013-04-26 20:55:33 +0000
134@@ -102,7 +102,8 @@
135 _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])
136 _APPEND_COMPILE_FLAGS_ERROR([-std=c99])
137 # Anything below this comment please keep sorted.
138- _APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])
139+ AS_IF([test "x$CC_VERSION_VENDOR" != xclang],
140+ [_APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])], [])
141 # _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])
142 _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes])
143 _APPEND_COMPILE_FLAGS_ERROR([-Waddress])
144@@ -187,7 +188,8 @@
145 _APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas])
146 _APPEND_COMPILE_FLAGS_ERROR([-Wthis-test-should-fail])
147 # Anything below this comment please keep sorted.
148- _APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])
149+ AS_IF([test "x$CXX_VERSION_VENDOR" != xclang],
150+ [_APPEND_COMPILE_FLAGS_ERROR([--param=ssp-buffer-size=1])], [])
151 # _APPEND_COMPILE_FLAGS_ERROR([-Wmissing-format-attribute])
152 _APPEND_COMPILE_FLAGS_ERROR([-Wno-attributes])
153 _APPEND_COMPILE_FLAGS_ERROR([-Waddress])
154
155=== modified file 'tests/unit/include.am'
156--- tests/unit/include.am 2013-04-25 10:15:18 +0000
157+++ tests/unit/include.am 2013-04-26 20:55:33 +0000
158@@ -2,6 +2,9 @@
159 # included from Top Level Makefile.am
160 # All paths should be given relative to the root
161
162+# dummy.cxx is a hack to make MinGW link with C++
163+# See http://www.gnu.org/software/automake/manual/html_node/Libtool-Convenience-Libraries.html
164+
165 noinst_HEADERS+= tests/unit/common.h
166
167 tests_unit_binlog_SOURCES= tests/unit/binlog.cc tests/unit/common.c
168@@ -20,21 +23,25 @@
169
170 tests_unit_escape_SOURCES= tests/unit/escape.c
171 tests_unit_escape_LDADD= libdrizzle/libdrizzle.la
172+nodist_EXTRA_tests_unit_escape_SOURCES = dummy.cxx
173 check_PROGRAMS+= tests/unit/escape
174 noinst_PROGRAMS+= tests/unit/escape
175
176 tests_unit_insert_id_SOURCES= tests/unit/insert_id.c
177 tests_unit_insert_id_LDADD= libdrizzle/libdrizzle.la
178+nodist_EXTRA_tests_unit_insert_id_SOURCES = dummy.cxx
179 check_PROGRAMS+= tests/unit/insert_id
180 noinst_PROGRAMS+= tests/unit/insert_id
181
182 tests_unit_query_SOURCES= tests/unit/query.c
183 tests_unit_query_LDADD= libdrizzle/libdrizzle.la
184+nodist_EXTRA_tests_unit_query_SOURCES = dummy.cxx
185 check_PROGRAMS+= tests/unit/query
186 noinst_PROGRAMS+= tests/unit/query
187
188 tests_unit_column_SOURCES= tests/unit/column.c tests/unit/common.c
189 tests_unit_column_LDADD= libdrizzle/libdrizzle.la
190+nodist_EXTRA_tests_unit_column_SOURCES = dummy.cxx
191 check_PROGRAMS+= tests/unit/column
192 noinst_PROGRAMS+= tests/unit/column
193
194@@ -50,26 +57,31 @@
195 tests_unit_numbers_SOURCES= tests/unit/numbers.c tests/unit/common.c
196 tests_unit_numbers_LDADD= libdrizzle/libdrizzle.la
197 tests_unit_numbers_LDADD+= -lm
198+nodist_EXTRA_tests_unit_numbers_SOURCES = dummy.cxx
199 check_PROGRAMS+= tests/unit/numbers
200 noinst_PROGRAMS+= tests/unit/numbers
201
202 tests_unit_datetypes_SOURCES= tests/unit/datetypes.c tests/unit/common.c
203 tests_unit_datetypes_LDADD= libdrizzle/libdrizzle.la
204+nodist_EXTRA_tests_unit_datetypes_SOURCES = dummy.cxx
205 check_PROGRAMS+= tests/unit/datetypes
206 noinst_PROGRAMS+= tests/unit/datetypes
207
208 tests_unit_nulls_SOURCES= tests/unit/nulls.c tests/unit/common.c
209 tests_unit_nulls_LDADD= libdrizzle/libdrizzle.la
210+nodist_EXTRA_tests_unit_nulls_SOURCES = dummy.cxx
211 check_PROGRAMS+= tests/unit/nulls
212 noinst_PROGRAMS+= tests/unit/nulls
213
214 tests_unit_row_SOURCES= tests/unit/row.c
215 tests_unit_row_LDADD= libdrizzle/libdrizzle.la
216+nodist_EXTRA_tests_unit_row_SOURCES = dummy.cxx
217 check_PROGRAMS+= tests/unit/row
218 noinst_PROGRAMS+= tests/unit/row
219
220 tests_unit_version_SOURCES= tests/unit/version.c
221 tests_unit_version_LDADD= libdrizzle/libdrizzle.la
222+nodist_EXTRA_tests_unit_version_SOURCES = dummy.cxx
223 check_PROGRAMS+= tests/unit/version
224 noinst_PROGRAMS+= tests/unit/version
225
226@@ -80,6 +92,7 @@
227
228 tests_unit_connect_SOURCES= tests/unit/connect.c
229 tests_unit_connect_LDADD= libdrizzle/libdrizzle.la
230+nodist_EXTRA_tests_unit_connect_SOURCES = dummy.cxx
231 check_PROGRAMS+= tests/unit/connect
232 noinst_PROGRAMS+= tests/unit/connect
233
234@@ -94,21 +107,25 @@
235
236 tests_unit_connect_uds_SOURCES= tests/unit/connect_uds.c tests/unit/common.c
237 tests_unit_connect_uds_LDADD= libdrizzle/libdrizzle.la
238+nodist_EXTRA_tests_unit_connect_uds_SOURCES = dummy.cxx
239 check_PROGRAMS+= tests/unit/connect_uds
240 noinst_PROGRAMS+= tests/unit/connect_uds
241
242 tests_unit_unbuffered_query_SOURCES= tests/unit/unbuffered_query.c
243 tests_unit_unbuffered_query_LDADD= libdrizzle/libdrizzle.la
244+nodist_EXTRA_tests_unit_unbuffered_query_SOURCES = dummy.cxx
245 check_PROGRAMS+= tests/unit/unbuffered_query
246 noinst_PROGRAMS+= tests/unit/unbuffered_query
247
248 tests_unit_statement_SOURCES= tests/unit/statement.c
249 tests_unit_statement_LDADD= libdrizzle/libdrizzle.la
250+nodist_EXTRA_tests_unit_statement_SOURCES = dummy.cxx
251 check_PROGRAMS+= tests/unit/statement
252 noinst_PROGRAMS+= tests/unit/statement
253
254 tests_unit_statement_char_SOURCES= tests/unit/statement_char.c
255 tests_unit_statement_char_LDADD= libdrizzle/libdrizzle.la
256+nodist_EXTRA_tests_unit_statement_char_SOURCES = dummy.cxx
257 check_PROGRAMS+= tests/unit/statement_char
258 noinst_PROGRAMS+= tests/unit/statement_char
259

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: