aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavol Rusnak <pavol@rusnak.io>2019-10-10 19:48:45 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2019-10-11 10:51:34 +0300
commit9bb001e88ad1cd7c36f090eee828d435ae63a294 (patch)
treef0e824612a09967c910b9a54624c8e9f4f89c498
parent252f4199540a113a37d19de5ba051922909c810d (diff)
downloadnanopb-c-9bb001e88ad1cd7c36f090eee828d435ae63a294.tar.gz
Fix "unused variable" warning when using PB_ENCODE_ARRAYS_UNPACKED
-rw-r--r--pb_encode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pb_encode.c b/pb_encode.c
index a8cd14e..7a4ba31 100644
--- a/pb_encode.c
+++ b/pb_encode.c
@@ -146,8 +146,10 @@ static bool checkreturn encode_array(pb_ostream_t *stream, const pb_field_t *fie
{
size_t i;
const void *p;
+#ifndef PB_ENCODE_ARRAYS_UNPACKED
size_t size;
-
+#endif
+
if (count == 0)
return true;