|
Lines 1-4
Link Here
|
| 1 |
Backport of https://github.com/jorisvink/kore/commit/c071d64bdddacbe1b69d238e14994d666a86f7cf |
1 |
Backports of |
|
|
2 |
|
| 3 |
https://github.com/jorisvink/kore/commit/c071d64bdddacbe1b69d238e14994d666a86f7cf |
| 2 |
so compiling on FreeBSD 10.x/i386 succeeds. Without it the build will fail with: |
4 |
so compiling on FreeBSD 10.x/i386 succeeds. Without it the build will fail with: |
| 3 |
|
5 |
|
| 4 |
src/pgsql.c:222:6: error: variable 'args' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] |
6 |
src/pgsql.c:222:6: error: variable 'args' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] |
|
Lines 16-24
src/pgsql.c:220:15: note: initialize the variable 'args' to silence this warning
Link Here
|
| 16 |
= NULL |
18 |
= NULL |
| 17 |
1 error generated. |
19 |
1 error generated. |
| 18 |
|
20 |
|
|
|
21 |
and https://github.com/jorisvink/kore/commit/7eced6f035c83c02680d9b58371851f8662a0e8a |
| 22 |
so that compiling with Clang 3.9 succeeds. Without it the build will fail with: |
| 23 |
|
| 24 |
src/pgsql.c:222:17: error: passing an object that undergoes default argument promotion to 'va_start' |
| 25 |
has undefined behavior [-Werror,-Wvarargs] |
| 26 |
va_start(args, count); |
| 27 |
^ |
| 28 |
src/pgsql.c:217:45: note: parameter of type 'u_int8_t' (aka 'unsigned char') is declared here |
| 29 |
const char *query, int result, u_int8_t count, ...) |
| 30 |
|
| 19 |
--- src/pgsql.c.orig 2016-08-01 07:59:32 UTC |
31 |
--- src/pgsql.c.orig 2016-08-01 07:59:32 UTC |
| 20 |
+++ src/pgsql.c |
32 |
+++ src/pgsql.c |
| 21 |
@@ -219,13 +219,11 @@ kore_pgsql_query_params(struct kore_pgsq |
33 |
@@ -151,7 +151,7 @@ kore_pgsql_query(struct kore_pgsql *pgsq |
|
|
34 |
|
| 35 |
int |
| 36 |
kore_pgsql_v_query_params(struct kore_pgsql *pgsql, |
| 37 |
- const char *query, int result, u_int8_t count, va_list args) |
| 38 |
+ const char *query, int result, int count, va_list args) |
| 39 |
{ |
| 40 |
u_int8_t i; |
| 41 |
char **values; |
| 42 |
@@ -214,18 +214,16 @@ cleanup: |
| 43 |
|
| 44 |
int |
| 45 |
kore_pgsql_query_params(struct kore_pgsql *pgsql, |
| 46 |
- const char *query, int result, u_int8_t count, ...) |
| 47 |
+ const char *query, int result, int count, ...) |
| 48 |
{ |
| 22 |
int ret; |
49 |
int ret; |
| 23 |
va_list args; |
50 |
va_list args; |
| 24 |
|
51 |
|