mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-03 21:24:22 +01:00
plugins/renepay: fix gcc-12.3.0 -O3 warning.
Compiler can't tell that we always set have_state[PAY_FLOW_FAILED_FINAL]
when we set this:
```
plugins/renepay/payment.c: In function ‘payment_reconsider’:
plugins/renepay/payment.c:287:25: error: ‘final_error’ may be used uninitialized [-Werror=maybe-uninitialized]
287 | payment_fail(payment, final_error, "%s", final_msg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
plugins/renepay/payment.c:194:30: note: ‘final_error’ was declared here
194 | enum jsonrpc_errcode final_error, ecode;
| ^~~~~~~~~~~
plugins/renepay/payment.c:287:25: error: ‘final_msg’ may be used uninitialized [-Werror=maybe-uninitialized]
287 | payment_fail(payment, final_error, "%s", final_msg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
plugins/renepay/payment.c:195:21: note: ‘final_msg’ was declared here
195 | const char *final_msg;
| ^~~~~~~~~
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -191,8 +191,8 @@ void payment_reconsider(struct payment *payment)
|
||||
{
|
||||
struct pay_flow *i, *next;
|
||||
bool have_state[NUM_PAY_FLOW] = {false};
|
||||
enum jsonrpc_errcode final_error, ecode;
|
||||
const char *final_msg;
|
||||
enum jsonrpc_errcode final_error COMPILER_WANTS_INIT("gcc 12.3.0 -O3"), ecode;
|
||||
const char *final_msg COMPILER_WANTS_INIT("gcc 12.3.0 -O3");
|
||||
const char *errmsg;
|
||||
|
||||
plugin_log(pay_plugin->plugin, LOG_DBG, "payment_reconsider");
|
||||
|
||||
Reference in New Issue
Block a user