fix compilation issues with small and w/o debug
PATCH 1/1 fix compilation issues with small and w/o debug
--- src/openvpn/init.c | 2 +- src/openvpn/mtcp.c | 2 ++ src/openvpn/packet_id.c | 2 ++ src/openvpn/reliable.c | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-)
src/openvpn/init.c +1 -1
@@ -2491,7 +2491,7 @@ frame_finalize_options(struct context *c, const struct options *o)size_t tailroom = headroom;#ifdef USE_COMP -msg (D_MTU_DEBUG ,"MTU: adding %lu buffer tailroom for compression for %lu " +msg (D_MTU_DEBUG ,"MTU: adding %zu buffer tailroom for compression for %zu " "bytes of payload" ,COMP_EXTRA_BUFFER (payload_size), payload_size); tailroom +=COMP_EXTRA_BUFFER (payload_size);
src/openvpn/mtcp.c +2 -0
@@ -72,6 +72,7 @@ struct ta_iow_flagsunsigned int sock; }; +#ifdef ENABLE_DEBUG static const char *pract (int action) {
@@ -114,6 +115,7 @@ pract(int action) return "?"; } } +#endif /* ENABLE_DEBUG */ static struct multi_instance *multi_create_instance_tcp (struct multi_context *m)
src/openvpn/packet_id.c +2 -0
@@ -53,11 +53,13 @@#define SEQ_UNSEEN ((time_t)0)#define SEQ_EXPIRED ((time_t)1) +#ifdef ENABLE_DEBUG static void packet_id_debug_print (int msglevel,const struct packet_id_rec *p,const struct packet_id_net *pin,const char *message,int value); +#endif /* ENABLE_DEBUG */ static inline void packet_id_debug(int msglevel,
src/openvpn/reliable.c +2 -0
@@ -394,6 +394,7 @@ reliable_send_purge(struct reliable *rel, const struct reliable_ack *ack) } } +#ifdef ENABLE_DEBUG /* print the current sequence of active packet IDs */ static const char *reliable_print_ids (const struct reliable *rel,struct gc_arena *gc)
@@ -412,6 +413,7 @@ reliable_print_ids(const struct reliable *rel, struct gc_arena *gc) }return BSTR (&out); } +#endif /* ENABLE_DEBUG */ /* true if at least one free buffer available */ bool
Signature · 1 line
2.34.1
I can confirm that this fixes issues seen with
./configure --enable-small --disable-debug --enable-werror
(compile tested on Debian 11 amd64, gcc 10.2.1)
The init.c change did not fix a warning for my compiler, but it looks correct and might be a warning with different compilers.
Regards,
Frank
Quoted 90 lines
Ilya Ponetayev <[email protected]...> hat am 17.06.2022 06:13 CEST geschrieben:
--- src/openvpn/init.c | 2 +- src/openvpn/mtcp.c | 2 ++ src/openvpn/packet_id.c | 2 ++ src/openvpn/reliable.c | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-)src/openvpn/init.c +1
-1@@ -2491,7 +2491,7 @@ frame_finalize_options(struct context *c, const struct options *o)size_t tailroom = headroom;#ifdef USE_COMP -msg (D_MTU_DEBUG ,"MTU: adding %lu buffer tailroom for compression for %lu " +msg (D_MTU_DEBUG ,"MTU: adding %zu buffer tailroom for compression for %zu " "bytes of payload" ,COMP_EXTRA_BUFFER (payload_size), payload_size); tailroom +=COMP_EXTRA_BUFFER (payload_size);src/openvpn/mtcp.c +2
-0@@ -72,6 +72,7 @@ struct ta_iow_flagsunsigned int sock; }; +#ifdef ENABLE_DEBUG static const char *pract (int action) {@@ -114,6 +115,7 @@ pract(int action) return "?"; } } +#endif /* ENABLE_DEBUG */ static struct multi_instance *multi_create_instance_tcp (struct multi_context *m)src/openvpn/packet_id.c +2
-0@@ -53,11 +53,13 @@#define SEQ_UNSEEN ((time_t)0)#define SEQ_EXPIRED ((time_t)1) +#ifdef ENABLE_DEBUG static void packet_id_debug_print (int msglevel,const struct packet_id_rec *p,const struct packet_id_net *pin,const char *message,int value); +#endif /* ENABLE_DEBUG */ static inline void packet_id_debug(int msglevel,src/openvpn/reliable.c +2
-0@@ -394,6 +394,7 @@ reliable_send_purge(struct reliable *rel, const struct reliable_ack *ack) } } +#ifdef ENABLE_DEBUG /* print the current sequence of active packet IDs */ static const char *reliable_print_ids (const struct reliable *rel,struct gc_arena *gc)@@ -412,6 +413,7 @@ reliable_print_ids(const struct reliable *rel, struct gc_arena *gc) }return BSTR (&out); } +#endif /* ENABLE_DEBUG */ /* true if at least one free buffer available */ bool Signature · 8 lines
2.34.1 _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
--
Frank Lichtenheld
I discussed the use of "%zu" and Windows/MinGW builds with Selva, who said this will work (it will create warnings, thus no -Werror builds, but since release builds are MSVC, this should be acceptable).
Uncrustify said I have to add a newline before one of the #endif lines, so I did.
Generally speaking: we're adding #ifdef again - maybe we should see how much of a difference this creates if we *remove* "--disable-debug" and all the ENABLE_DEBUG conditionals. Resulting binary size, and runtime.
Your patch has been applied to the master branch.
commit 8c815699ba616151e6bc5074cd150f3ebf053d4a
Author: Ilya Ponetayev Date: Fri Jun 17 07:13:26 2022 +0300
fix compilation issues with small and w/o debug
Acked-by: Frank Lichtenheld <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg24476.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering