Language: C

#define UTIL_ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))

#define UTIL_SWAP(x, y)                                                                                                                    \
  do {                                                                                                                                     \
    typeof(x) _a = x;                                                                                                                      \
    x = y;                                                                                                                                 \
    y = _a;                                                                                                                                \
  } while (0)

#define UTIL_PRINT_ARRAY(arr, size)                                                                                                        \
  do {                                                                                                                                     \
    uint16_t i;                                                                                                                            \
    for (i = 0; i < size; i++) {                                                                                                           \
      if (i != 0) printf(" ");                                                                                                             \
      printf("%d", arr[i]);                                                                                                                \
    }                                                                                                                                      \
    printf("\n");                                                                                                                          \
  } while (0)

#define BUF_SIZE 100

uint32_t bubble(int32_t buf[], size_t size)
{
  uint32_t num = 0;
  uint16_t i = size;
  while (i--) {
    uint16_t j;
    for (j = 0; j < i; j++) {
      if (buf[j] > buf[j + 1]) {
        UTIL_SWAP(buf[j], buf[j + 1]);
        num++;
      }
    }
  }

  return num;
}

#if !defined(TEST)
int32_t main(void)
{
  int32_t num;
  scanf("%d", &num);
  int32_t buf[BUF_SIZE];
  uint16_t i;
  for (i = 0; i < num; i++) {
    scanf("%d", &buf[i]);
  }

  uint32_t cnt = bubble(buf, num);

  UTIL_PRINT_ARRAY(buf, num);
  printf("%d\n", cnt);

  return 0;
}
#endif

Compiler output:
main.c:22:1: error: unknown type name 'uint32_t'
   22 | uint32_t bubble(int32_t buf[], size_t size)
      | ^~~~~~~~
main.c:1:1: note: 'uint32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
  +++ |+#include <stdint.h>
    1 | #define UTIL_ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
main.c:22:17: error: unknown type name 'int32_t'
   22 | uint32_t bubble(int32_t buf[], size_t size)
      |                 ^~~~~~~
main.c:22:17: note: 'int32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
main.c:22:32: error: unknown type name 'size_t'
   22 | uint32_t bubble(int32_t buf[], size_t size)
      |                                ^~~~~~
main.c:1:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
  +++ |+#include <stddef.h>
    1 | #define UTIL_ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
main.c:40:1: error: unknown type name 'int32_t'
   40 | int32_t main(void)
      | ^~~~~~~
main.c:40:1: note: 'int32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
main.c: In function 'main':
main.c:42:3: error: unknown type name 'int32_t'
   42 |   int32_t num;
      |   ^~~~~~~
main.c:42:3: note: 'int32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
main.c:43:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   43 |   scanf("%d", &num);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define UTIL_ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
main.c:43:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   43 |   scanf("%d", &num);
      |   ^~~~~
main.c:43:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:44:3: error: unknown type name 'int32_t'
   44 |   int32_t buf[BUF_SIZE];
      |   ^~~~~~~
main.c:44:3: note: 'int32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
main.c:45:3: error: unknown type name 'uint16_t'
   45 |   uint16_t i;
      |   ^~~~~~~~
main.c:45:3: note: 'uint16_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
main.c:50:3: error: unknown type name 'uint32_t'
   50 |   uint32_t cnt = bubble(buf, num);
      |   ^~~~~~~~
main.c:50:3: note: 'uint32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
main.c:50:18: error: implicit declaration of function 'bubble' [-Wimplicit-function-declaration]
   50 |   uint32_t cnt = bubble(buf, num);
      |                  ^~~~~~
main.c:12:5: error: unknown type name 'uint16_t'
   12 |     uint16_t i;                                                                                                                            \
      |     ^~~~~~~~
main.c:52:3: note: in expansion of macro 'UTIL_PRINT_ARRAY'
   52 |   UTIL_PRINT_ARRAY(buf, num);
      |   ^~~~~~~~~~~~~~~~
main.c:12:5: note: 'uint16_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
   12 |     uint16_t i;                                                                                                                            \
      |     ^~~~~~~~
main.c:52:3: note: in expansion of macro 'UTIL_PRINT_ARRAY'
   52 |   UTIL_PRINT_ARRAY(buf, num);
      |   ^~~~~~~~~~~~~~~~
main.c:14:19: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 |       if (i != 0) printf(" ");                                                                                                             \
      |                   ^~~~~~
main.c:52:3: note: in expansion of macro 'UTIL_PRINT_ARRAY'
   52 |   UTIL_PRINT_ARRAY(buf, num);
      |   ^~~~~~~~~~~~~~~~
main.c:14:19: note: include '<stdio.h>' or provide a declaration of 'printf'
   14 |       if (i != 0) printf(" ");                                                                                                             \
      |                   ^~~~~~
main.c:52:3: note: in expansion of macro 'UTIL_PRINT_ARRAY'
   52 |   UTIL_PRINT_ARRAY(buf, num);
      |   ^~~~~~~~~~~~~~~~
main.c:14:19: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   14 |       if (i != 0) printf(" ");                                                                                                             \
      |                   ^~~~~~
main.c:52:3: note: in expansion of macro 'UTIL_PRINT_ARRAY'
   52 |   UTIL_PRINT_ARRAY(buf, num);
      |   ^~~~~~~~~~~~~~~~
main.c:14:19: note: include '<stdio.h>' or provide a declaration of 'printf'
   14 |       if (i != 0) printf(" ");                                                                                                             \
      |                   ^~~~~~
main.c:52:3: note: in expansion of macro 'UTIL_PRINT_ARRAY'
   52 |   UTIL_PRINT_ARRAY(buf, num);
      |   ^~~~~~~~~~~~~~~~
main.c:15:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   15 |       printf("%d", arr[i]);                                                                                                                \
      |       ^~~~~~
main.c:52:3: note: in expansion of macro 'UTIL_PRINT_ARRAY'
   52 |   UTIL_PRINT_ARRAY(buf, num);
      |   ^~~~~~~~~~~~~~~~
main.c:15:7: note: include '<stdio.h>' or provide a declaration of 'printf'
   15 |       printf("%d", arr[i]);                                                                                                                \
      |       ^~~~~~
main.c:52:3: note: in expansion of macro 'UTIL_PRINT_ARRAY'
   52 |   UTIL_PRINT_ARRAY(buf, num);
      |   ^~~~~~~~~~~~~~~~
main.c:17:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   17 |     printf("\n");                                                                                                                          \
      |     ^~~~~~
main.c:52:3: note: in expansion of macro 'UTIL_PRINT_ARRAY'
   52 |   UTIL_PRINT_ARRAY(buf, num);
      |   ^~~~~~~~~~~~~~~~
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
   17 |     printf("\n");                                                                                                                          \
      |     ^~~~~~
main.c:52:3: note: in expansion of macro 'UTIL_PRINT_ARRAY'
   52 |   UTIL_PRINT_ARRAY(buf, num);
      |   ^~~~~~~~~~~~~~~~
main.c:53:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   53 |   printf("%d\n", cnt);
      |   ^~~~~~
main.c:53:3: note: include '<stdio.h>' or provide a declaration of 'printf'