Исправь в коде:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <ctype.h>

// Include the provided header file
// opaque structure for poliz calculation state
struct PolizState;

// poliz operation handler
typedef int (*poliz_func_t)(struct PolizState *state, int iextra);

struct PolizItem
{
    poliz_func_t handler;
    int iextra;
};

// runtime errors
enum
{
    PE_OK,  // no error
    PE_STACK_UNDERFLOW, // not enough elements on stack
    PE_INVALID_INDEX, // s or d operations refer to invalid index
    PE_DIVISION_BY_ZERO,
    PE_INT_OVERFLOW,
    PE_READ_FAILED, // read from stdin failed to convert integer for any reason
    PE_OUT_OF_MEMORY,
};

struct PolizItem *poliz_compile(const char *str);

struct PolizState *poliz_new_state(void);
void poliz_free_state(struct PolizState *state);
int poliz_last_error(struct PolizState *state);

// Definition of PolizState structure
struct PolizState {
    int32_t *stack;      // Dynamic array to hold the stack elements
    size_t size;         // Current number of elements in the stack
    size_t capacity;     // Current capacity of the stack
    int err;             // Error code (non-zero if an error has occurred)
};

static int push_stack(struct PolizState *state, int32_t value) {
    if (state->size == state->capacity) {
        size_t new_capacity = state->capacity == 0 ? 8 : state->capacity * 2;
        int32_t *new_stack = realloc(state->stack, new_capacity * sizeof(int32_t));
        if (!new_stack) {
            state->err = PE_OUT_OF_MEMORY;
            return PE_OUT_OF_MEMORY;
        }
        state->stack = new_stack;
        state->capacity = new_capacity;
    }
    state->stack[state->size++] = value;
    return PE_OK;
}

static int pop_stack(struct PolizState *state, int32_t *value) {
    if (state->size == 0) {
        state->err = PE_STACK_UNDERFLOW;
        return PE_STACK_UNDERFLOW;
    }
    *value = state->stack[--state->size];
    return PE_OK;
}

static int handler_push_number(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;
    return push_stack(state, (int32_t)iextra);
}

static int handler_add(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    int32_t a, b;
    if (pop_stack(state, &b) != PE_OK) return -state->err;
    if (pop_stack(state, &a) != PE_OK) return -state->err;

    int64_t result = (int64_t)a + (int64_t)b;
    if (result > INT32_MAX || result < INT32_MIN) {
        state->err = PE_INT_OVERFLOW;
        return -state->err;
    }

    return push_stack(state, (int32_t)result);
}

static int handler_sub(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    int32_t a, b;
    if (pop_stack(state, &b) != PE_OK) return -state->err;
    if (pop_stack(state, &a) != PE_OK) return -state->err;

    int64_t result = (int64_t)a - (int64_t)b;
    if (result > INT32_MAX || result < INT32_MIN) {
        state->err = PE_INT_OVERFLOW;
        return -state->err;
    }

    return push_stack(state, (int32_t)result);
}

static int handler_mul(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    int32_t a, b;
    if (pop_stack(state, &b) != PE_OK) return -state->err;
    if (pop_stack(state, &a) != PE_OK) return -state->err;

    int64_t result = (int64_t)a * (int64_t)b;
    if (result > INT32_MAX || result < INT32_MIN) {
        state->err = PE_INT_OVERFLOW;
        return -state->err;
    }

    return push_stack(state, (int32_t)result);
}

static int handler_div(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    int32_t divisor, dividend;
    if (pop_stack(state, &divisor) != PE_OK) return -state->err;
    if (pop_stack(state, &dividend) != PE_OK) return -state->err;

    if (divisor == 0) {
        state->err = PE_DIVISION_BY_ZERO;
        return -state->err;
    }

    int32_t result = dividend / divisor;
    return push_stack(state, result);
}

static int handler_mod(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    int32_t divisor, dividend;
    if (pop_stack(state, &divisor) != PE_OK) return -state->err;
    if (pop_stack(state, &dividend) != PE_OK) return -state->err;

    if (divisor == 0) {
        state->err = PE_DIVISION_BY_ZERO;
        return -state->err;
    }

    int32_t result = dividend % divisor;
    return push_stack(state, result);
}

static int handler_negate(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    int32_t a;
    if (pop_stack(state, &a) != PE_OK) return -state->err;

    int64_t result = -(int64_t)a;
    if (result > INT32_MAX || result < INT32_MIN) {
        state->err = PE_INT_OVERFLOW;
        return -state->err;
    }

    return push_stack(state, (int32_t)result);
}

static int handler_read(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    int32_t value;
    int res = scanf("%d", &value);
    if (res != 1) {
        state->err = PE_READ_FAILED;
        return -state->err;
    }

    return push_stack(state, value);
}

static int handler_write(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    int32_t value;
    if (pop_stack(state, &value) != PE_OK) return -state->err;

    printf("%d", value);
    return PE_OK;
}

static int handler_newline(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    printf("\n");
    return PE_OK;
}

static int handler_remove_top(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    if (state->size == 0) {
        state->err = PE_STACK_UNDERFLOW;
        return -state->err;
    }

    state->size--;
    return PE_OK;
}

static int handler_copy(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    size_t num = (size_t)iextra;
    if (num >= state->size) {
        state->err = PE_INVALID_INDEX;
        return -state->err;
    }

    int32_t value = state->stack[state->size - 1 - num];
    return push_stack(state, value);
}

static int handler_swap(struct PolizState *state, int iextra) {
    if (state->err != PE_OK) return -state->err;

    size_t num = (size_t)iextra;
    if (num >= state->size) {
        state->err = PE_INVALID_INDEX;
        return -state->err;
    }

    if (num == 0) {
        return PE_OK;
    }

    size_t index1 = state->size - 1 - num;
    size_t index2 = state->size - 1;
    int32_t temp = state->stack[index1];
    state->stack[index1] = state->stack[index2];
    state->stack[index2] = temp;

    return PE_OK;
}

struct PolizState *poliz_new_state(void) {
    struct PolizState *state = malloc(sizeof(struct PolizState));
    if (!state) return NULL;

    state->stack = NULL;
    state->size = 0;
    state->capacity = 0;
    state->err = PE_OK;
    return state;
}

void poliz_free_state(struct PolizState *state) {
    if (state) {
        free(state->stack);
        free(state);
    }
}

int poliz_last_error(struct PolizState *state) {
    if (!state) return PE_OK;
    return state->err;
}

static struct PolizItem compile_token(const char *token, int *extra) {
    struct PolizItem item;
    item.handler = NULL;
    item.iextra = 0;

    char *endptr;
    long num = strtol(token, &endptr, 10);
    if (*endptr == '\0') {
        item.handler = handler_push_number;
        item.iextra = (int)num;
        return item;
    }

    if (strcmp(token, "+") == 0) {
        item.handler = handler_add;
    }
    else if (strcmp(token, "-") == 0) {
        item.handler = handler_sub;
    }
    else if (strcmp(token, "*") == 0) {
        item.handler = handler_mul;
    }
    else if (strcmp(token, "/") == 0) {
        item.handler = handler_div;
    }
    else if (strcmp(token, "%") == 0) {
        item.handler = handler_mod;
    }
    else if (strcmp(token, "#") == 0) {
        item.handler = handler_negate;
    }
    else if (strcmp(token, "r") == 0) {
        item.handler = handler_read;
    }
    else if (strcmp(token, "w") == 0) {
        item.handler = handler_write;
    }
    else if (strcmp(token, "n") == 0) {
        item.handler = handler_newline;
    }
    else if (strcmp(token, ";") == 0) {
        item.handler = handler_remove_top;
    }
    else if (token[0] == 'd') {
        if (token[1] == '\0') {
            *extra = 0;
        }
        else {
            long dn = strtol(token + 1, &endptr, 10);
            if (*endptr != '\0' || dn < 0) {
                dn = 0;
            }
            *extra = (int)dn;
        }
        item.handler = handler_copy;
    }
    else if (token[0] == 's') {
        if (token[1] == '\0') {
            *extra = 1;
        }
        else {
            long sn = strtol(token + 1, &endptr, 10);
            if (*endptr != '\0' || sn < 0) {
                sn = 1;
            }
            *extra = (int)sn;
        }
        item.handler = handler_swap;
    }
    else {
        item.handler = NULL;
    }

    return item;
}

struct PolizItem *poliz_compile(const char *str) {
    if (!str) return NULL;

    char *input = strdup(str);
    if (!input) return NULL;

    size_t capacity = 16;
    size_t count = 0;
    struct PolizItem *items = malloc(capacity * sizeof(struct PolizItem));
    if (!items) {
        free(input);
        return NULL;
    }

    char *token = strtok(input, " \t\r\n");
    while (token) {
        if (count == capacity - 1) {
            // Need to expand the array
            size_t new_capacity = capacity * 2;
            struct PolizItem *new_items = realloc(items, new_capacity * sizeof(struct PolizItem));
            if (!new_items) {
                free(items);
                free(input);
                return NULL;
            }
            items = new_items;
            capacity = new_capacity;
        }

        int extra = 0;
        struct PolizItem item = compile_token(token, &extra);
        items[count].handler = item.handler;
        items[count].iextra = item.iextra;
        count++;

        token = strtok(NULL, " \t\r\n");
    }

    items[count].handler = NULL;
    items[count].iextra = 0;
    count++;

    struct PolizItem *final_items = realloc(items, count * sizeof(struct PolizItem));
    if (!final_items) {
        final_items = items;
    }

    free(input);
    return final_items;
}

Ошибки:

Clang-format returned error(s):

--- 91e768c3a7807c2.c	(original)
+++ 91e768c3a7807c2.c	(reformatted)
@@ -1,8 +1,8 @@
+#include <ctype.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdint.h>
-#include <ctype.h>
 
 // Include the provided header file
 // opaque structure for poliz calculation state
@@ -11,21 +11,19 @@
 // poliz operation handler
 typedef int (*poliz_func_t)(struct PolizState *state, int iextra);
 
-struct PolizItem
-{
+struct PolizItem {
     poliz_func_t handler;
     int iextra;
 };
 
 // runtime errors
-enum
-{
-    PE_OK,  // no error
-    PE_STACK_UNDERFLOW, // not enough elements on stack
-    PE_INVALID_INDEX, // s or d operations refer to invalid index
+enum {
+    PE_OK,               // no error
+    PE_STACK_UNDERFLOW,  // not enough elements on stack
+    PE_INVALID_INDEX,    // s or d operations refer to invalid index
     PE_DIVISION_BY_ZERO,
     PE_INT_OVERFLOW,
-    PE_READ_FAILED, // read from stdin failed to convert integer for any reason
+    PE_READ_FAILED,  // read from stdin failed to convert integer for any reason
     PE_OUT_OF_MEMORY,
 };
 
@@ -37,16 +35,17 @@
 
 // Definition of PolizState structure
 struct PolizState {
-    int32_t *stack;      // Dynamic array to hold the stack elements
-    size_t size;         // Current number of elements in the stack
-    size_t capacity;     // Current capacity of the stack
-    int err;             // Error code (non-zero if an error has occurred)
+    int32_t *stack;   // Dynamic array to hold the stack elements
+    size_t size;      // Current number of elements in the stack
+    size_t capacity;  // Current capacity of the stack
+    int err;          // Error code (non-zero if an error has occurred)
 };
 
 static int push_stack(struct PolizState *state, int32_t value) {
     if (state->size == state->capacity) {
         size_t new_capacity = state->capacity == 0 ? 8 : state->capacity * 2;
-        int32_t *new_stack = realloc(state->stack, new_capacity * sizeof(int32_t));
+        int32_t *new_stack =
+            realloc(state->stack, new_capacity * sizeof(int32_t));
         if (!new_stack) {
             state->err = PE_OUT_OF_MEMORY;
             return PE_OUT_OF_MEMORY;
@@ -68,16 +67,24 @@
 }
 
 static int handler_push_number(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
     return push_stack(state, (int32_t)iextra);
 }
 
 static int handler_add(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     int32_t a, b;
-    if (pop_stack(state, &b) != PE_OK) return -state->err;
-    if (pop_stack(state, &a) != PE_OK) return -state->err;
+    if (pop_stack(state, &b) != PE_OK) {
+        return -state->err;
+    }
+    if (pop_stack(state, &a) != PE_OK) {
+        return -state->err;
+    }
 
     int64_t result = (int64_t)a + (int64_t)b;
     if (result > INT32_MAX || result < INT32_MIN) {
@@ -89,11 +96,17 @@
 }
 
 static int handler_sub(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     int32_t a, b;
-    if (pop_stack(state, &b) != PE_OK) return -state->err;
-    if (pop_stack(state, &a) != PE_OK) return -state->err;
+    if (pop_stack(state, &b) != PE_OK) {
+        return -state->err;
+    }
+    if (pop_stack(state, &a) != PE_OK) {
+        return -state->err;
+    }
 
     int64_t result = (int64_t)a - (int64_t)b;
     if (result > INT32_MAX || result < INT32_MIN) {
@@ -105,11 +118,17 @@
 }
 
 static int handler_mul(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     int32_t a, b;
-    if (pop_stack(state, &b) != PE_OK) return -state->err;
-    if (pop_stack(state, &a) != PE_OK) return -state->err;
+    if (pop_stack(state, &b) != PE_OK) {
+        return -state->err;
+    }
+    if (pop_stack(state, &a) != PE_OK) {
+        return -state->err;
+    }
 
     int64_t result = (int64_t)a * (int64_t)b;
     if (result > INT32_MAX || result < INT32_MIN) {
@@ -121,11 +140,17 @@
 }
 
 static int handler_div(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     int32_t divisor, dividend;
-    if (pop_stack(state, &divisor) != PE_OK) return -state->err;
-    if (pop_stack(state, &dividend) != PE_OK) return -state->err;
+    if (pop_stack(state, &divisor) != PE_OK) {
+        return -state->err;
+    }
+    if (pop_stack(state, &dividend) != PE_OK) {
+        return -state->err;
+    }
 
     if (divisor == 0) {
         state->err = PE_DIVISION_BY_ZERO;
@@ -137,11 +162,17 @@
 }
 
 static int handler_mod(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     int32_t divisor, dividend;
-    if (pop_stack(state, &divisor) != PE_OK) return -state->err;
-    if (pop_stack(state, &dividend) != PE_OK) return -state->err;
+    if (pop_stack(state, &divisor) != PE_OK) {
+        return -state->err;
+    }
+    if (pop_stack(state, &dividend) != PE_OK) {
+        return -state->err;
+    }
 
     if (divisor == 0) {
         state->err = PE_DIVISION_BY_ZERO;
@@ -153,10 +184,14 @@
 }
 
 static int handler_negate(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     int32_t a;
-    if (pop_stack(state, &a) != PE_OK) return -state->err;
+    if (pop_stack(state, &a) != PE_OK) {
+        return -state->err;
+    }
 
     int64_t result = -(int64_t)a;
     if (result > INT32_MAX || result < INT32_MIN) {
@@ -168,7 +203,9 @@
 }
 
 static int handler_read(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     int32_t value;
     int res = scanf("%d", &value);
@@ -181,24 +218,32 @@
 }
 
 static int handler_write(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     int32_t value;
-    if (pop_stack(state, &value) != PE_OK) return -state->err;
-    
+    if (pop_stack(state, &value) != PE_OK) {
+        return -state->err;
+    }
+
     printf("%d", value);
     return PE_OK;
 }
 
 static int handler_newline(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     printf("\n");
     return PE_OK;
 }
 
 static int handler_remove_top(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     if (state->size == 0) {
         state->err = PE_STACK_UNDERFLOW;
@@ -210,7 +255,9 @@
 }
 
 static int handler_copy(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     size_t num = (size_t)iextra;
     if (num >= state->size) {
@@ -223,7 +270,9 @@
 }
 
 static int handler_swap(struct PolizState *state, int iextra) {
-    if (state->err != PE_OK) return -state->err;
+    if (state->err != PE_OK) {
+        return -state->err;
+    }
 
     size_t num = (size_t)iextra;
     if (num >= state->size) {
@@ -234,7 +283,7 @@
     if (num == 0) {
         return PE_OK;
     }
-    
+
     size_t index1 = state->size - 1 - num;
     size_t index2 = state->size - 1;
     int32_t temp = state->stack[index1];
@@ -246,7 +295,9 @@
 
 struct PolizState *poliz_new_state(void) {
     struct PolizState *state = malloc(sizeof(struct PolizState));
-    if (!state) return NULL;
+    if (!state) {
+        return NULL;
+    }
 
     state->stack = NULL;
     state->size = 0;
@@ -263,7 +314,9 @@
 }
 
 int poliz_last_error(struct PolizState *state) {
-    if (!state) return PE_OK;
+    if (!state) {
+        return PE_OK;
+    }
     return state->err;
 }
 
@@ -271,7 +324,7 @@
     struct PolizItem item;
     item.handler = NULL;
     item.iextra = 0;
-    
+
     char *endptr;
     long num = strtol(token, &endptr, 10);
     if (*endptr == '\0') {
@@ -279,42 +332,31 @@
         item.iextra = (int)num;
         return item;
     }
-    
+
     if (strcmp(token, "+") == 0) {
         item.handler = handler_add;
-    }
-    else if (strcmp(token, "-") == 0) {
+    } else if (strcmp(token, "-") == 0) {
         item.handler = handler_sub;
-    }
-    else if (strcmp(token, "*") == 0) {
+    } else if (strcmp(token, "*") == 0) {
         item.handler = handler_mul;
-    }
-    else if (strcmp(token, "/") == 0) {
+    } else if (strcmp(token, "/") == 0) {
         item.handler = handler_div;
-    }
-    else if (strcmp(token, "%") == 0) {
+    } else if (strcmp(token, "%") == 0) {
         item.handler = handler_mod;
-    }
-    else if (strcmp(token, "#") == 0) {
+    } else if (strcmp(token, "#") == 0) {
         item.handler = handler_negate;
-    }
-    else if (strcmp(token, "r") == 0) {
+    } else if (strcmp(token, "r") == 0) {
         item.handler = handler_read;
-    }
-    else if (strcmp(token, "w") == 0) {
+    } else if (strcmp(token, "w") == 0) {
         item.handler = handler_write;
-    }
-    else if (strcmp(token, "n") == 0) {
+    } else if (strcmp(token, "n") == 0) {
         item.handler = handler_newline;
-    }
-    else if (strcmp(token, ";") == 0) {
+    } else if (strcmp(token, ";") == 0) {
         item.handler = handler_remove_top;
-    }
-    else if (token[0] == 'd') {
+    } else if (token[0] == 'd') {
         if (token[1] == '\0') {
             *extra = 0;
-        }
-        else {
+        } else {
             long dn = strtol(token + 1, &endptr, 10);
             if (*endptr != '\0' || dn < 0) {
                 dn = 0;
@@ -322,12 +364,10 @@
             *extra = (int)dn;
         }
         item.handler = handler_copy;
-    }
-    else if (token[0] == 's') {
+    } else if (token[0] == 's') {
         if (token[1] == '\0') {
             *extra = 1;
-        }
-        else {
+        } else {
             long sn = strtol(token + 1, &endptr, 10);
             if (*endptr != '\0' || sn < 0) {
                 sn = 1;
@@ -335,8 +375,7 @@
             *extra = (int)sn;
         }
         item.handler = handler_swap;
-    }
-    else {
+    } else {
         item.handler = NULL;
     }
 
@@ -344,10 +383,14 @@
 }
 
 struct PolizItem *poliz_compile(const char *str) {
-    if (!str) return NULL;
-    
+    if (!str) {
+        return NULL;
+    }
+
     char *input = strdup(str);
-    if (!input) return NULL;
+    if (!input) {
+        return NULL;
+    }
 
     size_t capacity = 16;
     size_t count = 0;
@@ -362,7 +405,8 @@
         if (count == capacity - 1) {
             // Need to expand the array
             size_t new_capacity = capacity * 2;
-            struct PolizItem *new_items = realloc(items, new_capacity * sizeof(struct PolizItem));
+            struct PolizItem *new_items =
+                realloc(items, new_capacity * sizeof(struct PolizItem));
             if (!new_items) {
                 free(items);
                 free(input);
@@ -380,12 +424,13 @@
 
         token = strtok(NULL, " \t\r\n");
     }
-    
+
     items[count].handler = NULL;
     items[count].iextra = 0;
     count++;
-    
-    struct PolizItem *final_items = realloc(items, count * sizeof(struct PolizItem));
+
+    struct PolizItem *final_items =
+        realloc(items, count * sizeof(struct PolizItem));
     if (!final_items) {
         final_items = items;
     }

Clang-tidy returned error(s):
1337 warnings generated.
Suppressed 1334 warnings (1334 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
3 warnings treated as errors

/var/lib/ejudge/compile/work/91e768c3a7807c2.c:12:15: error: invalid case style for typedef 'poliz_func_t' [caos-identifier-naming,-warnings-as-errors]
typedef int (*poliz_func_t)(struct PolizState *state, int iextra);
              ^~~~~~~~~~~~
              PolizFuncT
/var/lib/ejudge/compile/work/91e768c3a7807c2.c:48:54: error: 8 is a magic number; consider replacing it with a named constant [caos-magic-numbers,-warnings-as-errors]
        size_t new_capacity = state->capacity == 0 ? 8 : state->capacity * 2;
                                                     ^
/var/lib/ejudge/compile/work/91e768c3a7807c2.c:352:23: error: 16 is a magic number; consider replacing it with a named constant [caos-magic-numbers,-warnings-as-errors]
    size_t capacity = 16;
                      ^



Style checker detected errors