mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	enable and fix -Werror=suggest-attribute=format
This commit is contained in:
		
							parent
							
								
									020ac545a8
								
							
						
					
					
						commit
						bdeeebfdd4
					
				
					 7 changed files with 18 additions and 15 deletions
				
			
		| 
						 | 
					@ -52,6 +52,7 @@ if cc.get_id() == 'gcc'
 | 
				
			||||||
			'-Wimplicit-fallthrough',
 | 
								'-Wimplicit-fallthrough',
 | 
				
			||||||
			'-Wpointer-arith',
 | 
								'-Wpointer-arith',
 | 
				
			||||||
			'-Wformat-security',
 | 
								'-Wformat-security',
 | 
				
			||||||
 | 
								'-Werror=suggest-attribute=format',
 | 
				
			||||||
#			'-DSPA_DEBUG_MEMCPY',
 | 
					#			'-DSPA_DEBUG_MEMCPY',
 | 
				
			||||||
#			'-DFASTPATH',
 | 
					#			'-DFASTPATH',
 | 
				
			||||||
			language : 'c')
 | 
								language : 'c')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,7 +34,7 @@ extern "C" {
 | 
				
			||||||
#include <spa/utils/type.h>
 | 
					#include <spa/utils/type.h>
 | 
				
			||||||
#include <spa/support/log.h>
 | 
					#include <spa/support/log.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void spa_log_impl_logv(void *object,
 | 
					static inline SPA_PRINTF_FUNC(6, 0) void spa_log_impl_logv(void *object,
 | 
				
			||||||
				     enum spa_log_level level,
 | 
									     enum spa_log_level level,
 | 
				
			||||||
				     const char *file,
 | 
									     const char *file,
 | 
				
			||||||
				     int line,
 | 
									     int line,
 | 
				
			||||||
| 
						 | 
					@ -50,7 +50,7 @@ static inline void spa_log_impl_logv(void *object,
 | 
				
			||||||
                levels[level], strrchr(file, '/') + 1, line, func, text);
 | 
					                levels[level], strrchr(file, '/') + 1, line, func, text);
 | 
				
			||||||
        fputs(location, stderr);
 | 
					        fputs(location, stderr);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
static inline void spa_log_impl_log(void *object,
 | 
					static inline SPA_PRINTF_FUNC(6,7) void spa_log_impl_log(void *object,
 | 
				
			||||||
				    enum spa_log_level level,
 | 
									    enum spa_log_level level,
 | 
				
			||||||
				    const char *file,
 | 
									    const char *file,
 | 
				
			||||||
				    int line,
 | 
									    int line,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -63,7 +63,7 @@ struct impl {
 | 
				
			||||||
	unsigned int timestamp:1;
 | 
						unsigned int timestamp:1;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static SPA_PRINTF_FUNC(6,0) void
 | 
				
			||||||
impl_log_logv(void *object,
 | 
					impl_log_logv(void *object,
 | 
				
			||||||
	      enum spa_log_level level,
 | 
						      enum spa_log_level level,
 | 
				
			||||||
	      const char *file,
 | 
						      const char *file,
 | 
				
			||||||
| 
						 | 
					@ -125,7 +125,7 @@ impl_log_logv(void *object,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static SPA_PRINTF_FUNC(6,7) void
 | 
				
			||||||
impl_log_log(void *object,
 | 
					impl_log_log(void *object,
 | 
				
			||||||
	     enum spa_log_level level,
 | 
						     enum spa_log_level level,
 | 
				
			||||||
	     const char *file,
 | 
						     const char *file,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -316,7 +316,9 @@ struct pw_core_methods {
 | 
				
			||||||
#define pw_core_pong(c,...)		pw_core_method(c,pong,0,__VA_ARGS__)
 | 
					#define pw_core_pong(c,...)		pw_core_method(c,pong,0,__VA_ARGS__)
 | 
				
			||||||
#define pw_core_error(c,...)		pw_core_method(c,error,0,__VA_ARGS__)
 | 
					#define pw_core_error(c,...)		pw_core_method(c,error,0,__VA_ARGS__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline int
 | 
					
 | 
				
			||||||
 | 
					static inline
 | 
				
			||||||
 | 
					SPA_PRINTF_FUNC(5, 0) int
 | 
				
			||||||
pw_core_errorv(struct pw_core *core, uint32_t id, int seq,
 | 
					pw_core_errorv(struct pw_core *core, uint32_t id, int seq,
 | 
				
			||||||
		int res, const char *message, va_list args)
 | 
							int res, const char *message, va_list args)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -326,7 +328,8 @@ pw_core_errorv(struct pw_core *core, uint32_t id, int seq,
 | 
				
			||||||
	return pw_core_error(core, id, seq, res, buffer);
 | 
						return pw_core_error(core, id, seq, res, buffer);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline int
 | 
					static inline
 | 
				
			||||||
 | 
					SPA_PRINTF_FUNC(5, 6) int
 | 
				
			||||||
pw_core_errorf(struct pw_core *core, uint32_t id, int seq,
 | 
					pw_core_errorf(struct pw_core *core, uint32_t id, int seq,
 | 
				
			||||||
		int res, const char *message, ...)
 | 
							int res, const char *message, ...)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -208,7 +208,7 @@ struct pw_global {
 | 
				
			||||||
#define pw_core_resource_add_mem(r,...)		pw_core_resource(r,add_mem,0,__VA_ARGS__)
 | 
					#define pw_core_resource_add_mem(r,...)		pw_core_resource(r,add_mem,0,__VA_ARGS__)
 | 
				
			||||||
#define pw_core_resource_remove_mem(r,...)	pw_core_resource(r,remove_mem,0,__VA_ARGS__)
 | 
					#define pw_core_resource_remove_mem(r,...)	pw_core_resource(r,remove_mem,0,__VA_ARGS__)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void
 | 
					static inline SPA_PRINTF_FUNC(5,0) void
 | 
				
			||||||
pw_core_resource_errorv(struct pw_resource *resource, uint32_t id, int seq,
 | 
					pw_core_resource_errorv(struct pw_resource *resource, uint32_t id, int seq,
 | 
				
			||||||
		int res, const char *message, va_list args)
 | 
							int res, const char *message, va_list args)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -218,7 +218,7 @@ pw_core_resource_errorv(struct pw_resource *resource, uint32_t id, int seq,
 | 
				
			||||||
	pw_core_resource_error(resource, id, seq, res, buffer);
 | 
						pw_core_resource_error(resource, id, seq, res, buffer);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline void
 | 
					static inline SPA_PRINTF_FUNC(5,6) void
 | 
				
			||||||
pw_core_resource_errorf(struct pw_resource *resource, uint32_t id, int seq,
 | 
					pw_core_resource_errorf(struct pw_resource *resource, uint32_t id, int seq,
 | 
				
			||||||
		int res, const char *message, ...)
 | 
							int res, const char *message, ...)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -83,7 +83,7 @@ pw_properties_setf(struct pw_properties *properties,
 | 
				
			||||||
		   const char *key, const char *format, ...) SPA_PRINTF_FUNC(3, 4);
 | 
							   const char *key, const char *format, ...) SPA_PRINTF_FUNC(3, 4);
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
pw_properties_setva(struct pw_properties *properties,
 | 
					pw_properties_setva(struct pw_properties *properties,
 | 
				
			||||||
		   const char *key, const char *format, va_list args);
 | 
							   const char *key, const char *format, va_list args) SPA_PRINTF_FUNC(3,0);
 | 
				
			||||||
const char *
 | 
					const char *
 | 
				
			||||||
pw_properties_get(const struct pw_properties *properties, const char *key);
 | 
					pw_properties_get(const struct pw_properties *properties, const char *key);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -98,7 +98,7 @@ static void dot_str_clear(char **str)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void dot_str_vadd(char **str, const char *fmt, va_list varargs)
 | 
					static SPA_PRINTF_FUNC(2,0) void dot_str_vadd(char **str, const char *fmt, va_list varargs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	char *res = NULL;
 | 
						char *res = NULL;
 | 
				
			||||||
	char *fmt2 = NULL;
 | 
						char *fmt2 = NULL;
 | 
				
			||||||
| 
						 | 
					@ -122,7 +122,7 @@ static void dot_str_vadd(char **str, const char *fmt, va_list varargs)
 | 
				
			||||||
	*str = res;
 | 
						*str = res;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void dot_str_add(char **str, const char *fmt, ...)
 | 
					static SPA_PRINTF_FUNC(2,3) void dot_str_add(char **str, const char *fmt, ...)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	va_list varargs;
 | 
						va_list varargs;
 | 
				
			||||||
	va_start(varargs, fmt);
 | 
						va_start(varargs, fmt);
 | 
				
			||||||
| 
						 | 
					@ -149,7 +149,7 @@ static void draw_dict(char **str, const char *title,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void draw_vlabel(char **str, const char *name, uint32_t id, bool detail,
 | 
					static SPA_PRINTF_FUNC(7,0) void draw_vlabel(char **str, const char *name, uint32_t id, bool detail,
 | 
				
			||||||
		       const struct spa_dict *info_p, const struct spa_dict *p,
 | 
							       const struct spa_dict *info_p, const struct spa_dict *p,
 | 
				
			||||||
		       const char *fmt, va_list varargs)
 | 
							       const char *fmt, va_list varargs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -168,7 +168,7 @@ static void draw_vlabel(char **str, const char *name, uint32_t id, bool detail,
 | 
				
			||||||
	dot_str_add(str, "%s", "\"];\n");
 | 
						dot_str_add(str, "%s", "\"];\n");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void draw_label(char **str, const char *name, uint32_t id, bool detail,
 | 
					static SPA_PRINTF_FUNC(7,8) void draw_label(char **str, const char *name, uint32_t id, bool detail,
 | 
				
			||||||
		       const struct spa_dict *info_p, const struct spa_dict *p,
 | 
							       const struct spa_dict *info_p, const struct spa_dict *p,
 | 
				
			||||||
		       const char *fmt, ...)
 | 
							       const char *fmt, ...)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -233,8 +233,7 @@ static void draw_node(struct global *g)
 | 
				
			||||||
	dot_str_add(dot_str, "node_id: %u\\lname: %s\\lmedia_class: %s\\l",
 | 
						dot_str_add(dot_str, "node_id: %u\\lname: %s\\lmedia_class: %s\\l",
 | 
				
			||||||
		g->id,
 | 
							g->id,
 | 
				
			||||||
		spa_dict_lookup(info->props, PW_KEY_NODE_NAME),
 | 
							spa_dict_lookup(info->props, PW_KEY_NODE_NAME),
 | 
				
			||||||
		spa_dict_lookup(info->props, PW_KEY_MEDIA_CLASS),
 | 
							spa_dict_lookup(info->props, PW_KEY_MEDIA_CLASS));
 | 
				
			||||||
		spa_dict_lookup(info->props, PW_KEY_OBJECT_ID));
 | 
					 | 
				
			||||||
	if (g->data->show_detail) {
 | 
						if (g->data->show_detail) {
 | 
				
			||||||
		draw_dict(dot_str, "info_props", info->props);
 | 
							draw_dict(dot_str, "info_props", info->props);
 | 
				
			||||||
		draw_dict(dot_str, "properties", &g->props->dict);
 | 
							draw_dict(dot_str, "properties", &g->props->dict);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue