Skip to content

Commit bf7dca6

Browse files
randomizedcoderclaude
authored andcommitted
Add __printf attribute to homa_metric_append
* Lets the compiler check the format strings passed by every caller (none are wrong today) and clears gcc W=1's -Wsuggest-attribute=format warning in homa_metrics.c. Resolves #125. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent ee5a0a2 commit bf7dca6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎homa_metrics.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,8 @@ static inline struct homa_metrics *homa_metrics_per_cpu(void)
869869

870870
extern struct homa_metrics_output homa_mout;
871871

872-
void homa_metric_append(const char *name, u64 value, const char *format, ...);
872+
void homa_metric_append(const char *name, u64 value,
873+
const char *format, ...) __printf(3, 4);
873874
void homa_metrics_end(void);
874875
int homa_metrics_init(void);
875876
loff_t homa_metrics_lseek(struct file *file, loff_t offset,

0 commit comments

Comments
 (0)