Skip to content

Commit

Permalink
sys/cbor: change array initializer from const variable to #define
Browse files Browse the repository at this point in the history
OS X clang complains "folded to constant array as an extension"
[-Wgnu-folding-constant]
  • Loading branch information
thomaseichinger committed Sep 30, 2015
1 parent be8f637 commit e93fd66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sys/cbor/cbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
/* Extra defines not related to the protocol itself */
#define CBOR_STREAM_PRINT_BUFFERSIZE 1024 /* bytes */

/* Array size */
#define MAX_TIMESTRING_LENGTH (21)

#ifndef INFINITY
#define INFINITY (1.0/0.0)
#endif
Expand Down Expand Up @@ -694,7 +697,6 @@ size_t cbor_deserialize_date_time(const cbor_stream_t *stream, size_t offset, st

size_t cbor_serialize_date_time(cbor_stream_t *stream, struct tm *val)
{
static const int MAX_TIMESTRING_LENGTH = 21;
CBOR_ENSURE_SIZE(stream, MAX_TIMESTRING_LENGTH + 1); /* + 1 tag byte */

char time_str[MAX_TIMESTRING_LENGTH];
Expand Down

0 comments on commit e93fd66

Please sign in to comment.