From c936dbfcd6c26f0d143f01a6c7a5f0f4e27ac6eb Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 18 Oct 2023 15:09:04 -0400 Subject: char/char: Add "__malloc__" attribute The GCC analyzer looks for unchecked possibly null allocation function call results being dereferenced or passed to functions requiring non- null arguments. --- (limited to 'src/char') diff --git a/src/char/char.h b/src/char/char.h index f5054d5..dc79cf6 100644 --- a/src/char/char.h +++ b/src/char/char.h @@ -59,7 +59,7 @@ struct mf_char { }; struct mf_char * -mf_char_new(size_t size); +mf_char_new(size_t size) __attribute__((__malloc__)); #define mf_char_init(c, t_c, name) \ do { \ -- cgit v0.9.1