60_errors_and_warnings.c 857 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #if defined test_56_btype_excess_1
  2. struct A {} int i;
  3. #elif defined test_57_btype_excess_2
  4. char int i;
  5. #elif defined test_58_function_redefinition
  6. int f(void) { return 0; }
  7. int f(void) { return 1; }
  8. #elif defined test_global_redefinition
  9. int xxx = 1;
  10. int xxx;
  11. int xxx = 2;
  12. #elif defined test_59_function_array
  13. int (*fct)[42](int x);
  14. #elif defined test_60_enum_redefinition
  15. enum color { RED, GREEN, BLUE };
  16. enum color { R, G, B };
  17. enum color c;
  18. #elif defined test_62_enumerator_redefinition
  19. enum color { RED, GREEN, BLUE };
  20. enum rgb { RED, G, B};
  21. enum color c = RED;
  22. #elif defined test_63_local_enumerator_redefinition
  23. enum {
  24. FOO,
  25. BAR
  26. };
  27. int main(void)
  28. {
  29. enum {
  30. FOO = 2,
  31. BAR
  32. };
  33. return BAR - FOO;
  34. }
  35. #elif defined test_61_undefined_enum
  36. enum rgb3 c = 42;
  37. #elif defined test_74_non_const_init
  38. int i = i++;
  39. #endif