[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
purge_secrets missing return on non-void function
From: |
Andreas Stieger |
Subject: |
purge_secrets missing return on non-void function |
Date: |
Mon, 25 Sep 2023 14:18:44 +0200 |
User-agent: |
Mozilla Thunderbird |
Hello,
I am not sure if this is new as of 0.20.0 or earlier, but this seems to
be related to bb4036:
[ 50s] gnunet-communicator-udp.c: In function 'purge_secrets':
[ 50s] gnunet-communicator-udp.c:1401:1: error: no return statement in
function returning non-void [-Werror=return-type]
[ 50s] 1401 | }
[ 50s] | ^
The documented intent here is to return an GNUNET_GenericReturnValue,
specifically if GNUNET_YES if any secret was deleted. It actually does
the counting but the GNUNET_YES/GNUNET_NO logic seems to be missing.
So the following makes sense:
Index: gnunet-0.20.0/src/transport/gnunet-communicator-udp.c
===================================================================
--- gnunet-0.20.0.orig/src/transport/gnunet-communicator-udp.c
+++ gnunet-0.20.0/src/transport/gnunet-communicator-udp.c
@@ -1398,6 +1398,10 @@ purge_secrets (struct SharedSecret *ss_l
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Finished purging all, deleted %u.\n", deleted);
+ if (deleted > 0) {
+ return GNUNET_YES;
+ }
+ return GNUNET_NO;
}
Andreas
- purge_secrets missing return on non-void function,
Andreas Stieger <=