git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] usage: fix a sparse 'redeclared with different type' error

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
May 16, 2017, 01:11 UTC
Message-ID
<52ef158a-0719-c71a-b72b-4961cf8f96d5@ramsayjones.plus.com>
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Jeff,

If you need to re-roll your 'jk/bug-to-abort' branch, could you please squash this into the relevant patch (commit d8193743e0 "usage.c: add BUG() function", 12-05-2017).

[Just FYI, sparse complains thus:
  usage.c:212:6: error: symbol 'BUG_fl' redeclared with different type
  (originally declared at git-compat-util.h:1076) - different modifiers
]
Thanks!

ATB, Ramsay Jones

 usage.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/usage.c b/usage.c
index 545136734..918b539bc 100644
--- a/usage.c
+++ b/usage.c
@@ -209,6 +209,7 @@ static NORETURN void BUG_vfl(const char *file, int line, const char *fmt, va_lis
 }
 
 #ifdef HAVE_VARIADIC_MACROS
+__attribute__((format (printf, 3, 4))) NORETURN
 void BUG_fl(const char *file, int line, const char *fmt, ...)
 {
 	va_list ap;
@@ -217,6 +218,7 @@ void BUG_fl(const char *file, int line, const char *fmt, ...)
 	va_end(ap);
 }
 #else
+__attribute__((format (printf, 1, 2))) NORETURN
 void BUG(const char *fmt, ...)
 {
 	va_list ap;
-- 
2.13.0
Next: Jeff King
Message 1 of 4 in “usage: fix a sparse 'redeclared with different type' error”
  1. usage: fix a sparse 'redeclared with different type' errorRamsay Jones, May 16, 2017
  2. Jeff KingMay 16, 2017
  3. Ramsay JonesMay 16, 2017
  4. Luc Van OostenryckMay 23, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.