Skip to content

Commit 09d5b71

Browse files
authored
Fix -Wunused-function warning in ext/pdo_firebird (#15646)
When FB_API_VER equals to 30, for example, on Ubuntu, there is this warning thrown with certain compiler configurations: /php-src/ext/pdo_firebird/pdo_firebird_utils.cpp:21:13: warning: ‘void fb_copy_status(const ISC_STATUS*, ISC_STATUS*, size_t)’ defined but not used [-Wunused-function] 21 | static void fb_copy_status(const ISC_STATUS* from, ISC_STATUS* to, size_t maxLength) | ^~~~~~~~~~~~~~
1 parent 7ebdd7d commit 09d5b71

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

ext/pdo_firebird/pdo_firebird_utils.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@
1818
#include <firebird/Interface.h>
1919
#include <cstring>
2020

21-
static void fb_copy_status(const ISC_STATUS* from, ISC_STATUS* to, size_t maxLength)
22-
{
23-
for(size_t i=0; i < maxLength; ++i) {
24-
memcpy(to + i, from + i, sizeof(ISC_STATUS));
25-
if (from[i] == isc_arg_end) {
26-
break;
27-
}
28-
}
29-
}
30-
3121
/* Returns the client version. 0 bytes are minor version, 1 bytes are major version. */
3222
extern "C" unsigned fb_get_client_version(void)
3323
{
@@ -51,6 +41,15 @@ extern "C" ISC_DATE fb_encode_date(unsigned year, unsigned month, unsigned day)
5141
}
5242

5343
#if FB_API_VER >= 40
44+
static void fb_copy_status(const ISC_STATUS* from, ISC_STATUS* to, size_t maxLength)
45+
{
46+
for(size_t i=0; i < maxLength; ++i) {
47+
memcpy(to + i, from + i, sizeof(ISC_STATUS));
48+
if (from[i] == isc_arg_end) {
49+
break;
50+
}
51+
}
52+
}
5453

5554
/* Decodes a time with time zone into its time components. */
5655
extern "C" ISC_STATUS fb_decode_time_tz(ISC_STATUS* isc_status, const ISC_TIME_TZ* timeTz, unsigned* hours, unsigned* minutes, unsigned* seconds, unsigned* fractions,

0 commit comments

Comments
 (0)