Skip to content

Commit 6a693db

Browse files
arminkdpgeorge
authored andcommitted
extmod/re1.5: Fix compilecode.c compile problem on IAR tool chain.
The 2nd and 3rd args of the ternary operator are treated like they are in the same expression and must have similar types. void is not compatible with int so that's why the compiler is complaining.
1 parent cf31d38 commit 6a693db

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

extmod/re1.5/compilecode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
#include "re1.5.h"
66

77
#define INSERT_CODE(at, num, pc) \
8-
((code ? memmove(code + at + num, code + at, pc - at) : (void)0), pc += num)
8+
((code ? memmove(code + at + num, code + at, pc - at) : 0), pc += num)
99
#define REL(at, to) (to - at - 2)
10-
#define EMIT(at, byte) (code ? (code[at] = byte) : (void)(at))
10+
#define EMIT(at, byte) (code ? (code[at] = byte) : (at))
1111
#define PC (prog->bytelen)
1212

1313
static const char *_compilecode(const char *re, ByteProg *prog, int sizecode)

0 commit comments

Comments
 (0)