5454#define LIKELY (x ) __builtin_expect ((x), 1)
5555#define UNLIKELY (x ) __builtin_expect ((x), 0)
5656
57- static inline void *
57+ __attribute__ (( malloc )) static inline void *
5858xmalloc (size_t size )
5959{
6060 void * res = malloc (size );
@@ -63,7 +63,7 @@ xmalloc (size_t size)
6363 return res ;
6464}
6565
66- static inline void *
66+ __attribute__ (( malloc )) static inline void *
6767xmalloc0 (size_t size )
6868{
6969 void * res = calloc (1 , size );
@@ -72,7 +72,7 @@ xmalloc0 (size_t size)
7272 return res ;
7373}
7474
75- static inline void *
75+ __attribute__ (( malloc )) static inline void *
7676xrealloc (void * ptr , size_t size )
7777{
7878 void * res = realloc (ptr , size );
@@ -223,7 +223,7 @@ path_is_slash_dev (const char *path)
223223 return true;
224224}
225225
226- int xasprintf (char * * str , const char * fmt , ...);
226+ int xasprintf (char * * str , const char * fmt , ...) __attribute__ (( format ( printf , 2 , 3 ))) ;
227227
228228int crun_path_exists (const char * path , libcrun_error_t * err );
229229
@@ -302,7 +302,7 @@ int run_process_with_stdin_timeout_envp (char *path, char **args, const char *cw
302302
303303int mark_or_close_fds_ge_than (int n , bool close_now , libcrun_error_t * err );
304304
305- void get_current_timestamp (char * out );
305+ void get_current_timestamp (char * out , size_t len );
306306
307307int set_blocking_fd (int fd , int blocking , libcrun_error_t * err );
308308
@@ -336,7 +336,7 @@ int safe_openat (int dirfd, const char *rootfs, size_t rootfs_len, const char *p
336336
337337ssize_t safe_write (int fd , const void * buf , ssize_t count );
338338
339- int append_paths (char * * out , libcrun_error_t * err , ...);
339+ int append_paths (char * * out , libcrun_error_t * err , ...) __attribute__ (( sentinel )) ;
340340
341341int str2sig (const char * name );
342342
0 commit comments