fork download
  1. #include <stdio.h>
  2.  
  3. #define I_HATE_MACRO2(a, b) a ## b
  4. #define I_HATE_MACRO(a, b) I_HATE_MACRO2(a, b)
  5. #define ASSERT_ARRAY(a) \
  6.   typedef struct { \
  7.   int I_HATE_MACRO(must_be_an_array_,__LINE__) : ((void*)&(a) == (void*)(a)); \
  8.   } I_HATE_MACRO(must_be_an_array_,__LINE__)
  9.  
  10. int main() {
  11. int test[] = {1,2,3};
  12. int test2;
  13. int *test3;
  14.  
  15. ASSERT_ARRAY(test);
  16. ASSERT_ARRAY(test2);
  17. ASSERT_ARRAY(test3);
  18.  
  19. return 0;
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:16: error: bit-field ‘must_be_an_array_16’ width not an integer constant
prog.c:17: error: bit-field ‘must_be_an_array_17’ width not an integer constant
stdout
Standard output is empty