diff options
| author | jvoisin | 2023-07-09 19:14:44 +0200 |
|---|---|---|
| committer | jvoisin | 2023-07-09 19:14:44 +0200 |
| commit | e7c10a1b27be94a09bb03bf31b4b66233e3d1bdc (patch) | |
| tree | 74eaf63f04fa673d81fe900f38dbae1b1241fefe /include/fortify-headers.h | |
| parent | b333df29dcfabcd4ad0cf630fdb648eaa38ec1c7 (diff) | |
Add some malloc annotations
Diffstat (limited to 'include/fortify-headers.h')
| -rw-r--r-- | include/fortify-headers.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/fortify-headers.h b/include/fortify-headers.h index 24af881..42a283f 100644 --- a/include/fortify-headers.h +++ b/include/fortify-headers.h | |||
| @@ -66,6 +66,12 @@ | |||
| 66 | #define __format(...) | 66 | #define __format(...) |
| 67 | #endif | 67 | #endif |
| 68 | 68 | ||
| 69 | #if defined __has_attribute && __has_attribute (malloc) | ||
| 70 | #define __malloc(...) __attribute__ ((malloc, __VA_ARGS__)) | ||
| 71 | #else | ||
| 72 | #define __malloc(...) | ||
| 73 | #endif | ||
| 74 | |||
| 69 | 75 | ||
| 70 | /* TODO(jvoisin) Figure a nice way to make use of __builtin_mul_overflow while ignoring the result. */ | 76 | /* TODO(jvoisin) Figure a nice way to make use of __builtin_mul_overflow while ignoring the result. */ |
| 71 | /* TODO(jvoisin) Make use of C23's stdckdint header: https://gustedt.gitlabpages.inria.fr/c23-library/#stdckdint */ | 77 | /* TODO(jvoisin) Make use of C23's stdckdint header: https://gustedt.gitlabpages.inria.fr/c23-library/#stdckdint */ |
