#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

#define T(expr) do {					\
  int cond = (expr);					\
  printf("%s -> %s\n", #expr, cond ? "true" : "false");	\
  assert(cond);						\
  }while(0)

int main() {
  size_t x = 0;
  T(sizeof(int[x]) == 0);
  T(x == 0);

  T(sizeof(int[++x]) == sizeof(int[1]));
  T(x == 1);

  char a[x], b[x];
  T(sizeof(++x ? a : b) == sizeof(char*)); // arrays are converted to pointers
  T(x == 1);

  const size_t n = 10;
  char c[n];
  T(sizeof(++x ? a : c) == sizeof(char*));
  T(x == 1);

  T(sizeof(++x ? c : a) == sizeof(char*)); 
  T(x == 1);

  T(sizeof(a) == sizeof(char[1]));
  T(sizeof(c) == sizeof(char[n]));
  T(sizeof(c) == n*sizeof(char));
  
  // T(++x ? int[x] : int[n]); // compilation error
  return (x == 1) ? EXIT_SUCCESS : EXIT_FAILURE;
}
