struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-3460.c.in
blob6f44c2a027342e98c3e09d1698150036719079e3
1 /* bug-3456.c
2 Broken implicit casts from pointers to bool (and a wrong warning for other integer types).
4 type: bool, intptr_t, uintptr_t
5 */
7 #include <testfwk.h>
9 #include <stdbool.h>
10 #include <stdint.h>
12 #ifdef __SDCC // Allowing implicit casts from pointers to integers is an SDCC extension
13 #pragma disable_warning 155 // But we still emit a warning
14 {type} f(const void *p)
16 return p;
19 {type} g(const void *p)
21 {type} t = p;
22 return t;
24 #endif
26 void testBug(void)
28 #ifdef __SDCC
29 char c;
30 ASSERT (f(&c));
31 ASSERT (g(&c));
32 #endif