c

c

Wrapper over realloc

Question: Wrote my wrapper over realloc . Is everything right here? Maybe there are some flaws that I did not notice? #define qk_realloc(p, n) qk_realloc__(p, &p, n) /* ================================= [TEST] The qk_realloc__ function Функция изменяет размер блока памяти, на который указывает old. Если операция выполнена успешно, то old присваивается адрес …

Wrapper over realloc Read More »

Why does format string is not a string literal error occur?

Question: According to the standard, the printf function has a prototype: int printf(const char *restrict format, …); Actually, subject: #include <stdio.h> int main (void) { const char *format = “hello world!”; printf(format); return 0; } Protest Clang : printf.c:7:12: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] …

Why does format string is not a string literal error occur? Read More »

Scroll to Top
AllEscort