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

[PATCH] object.c: Fix a sparse warning

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Jun 1, 2013, 17:46 UTC
Message-ID
<51AA3363.8030705@ramsay1.demon.co.uk>

Sparse issues an "'object_array_slopbuf' not declared. Should it be static?" warning. In order to suppress the warning, since this symbol does not need more than file visibility, we simply add the static modifier to its declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Hi Michael,

If you need to re-roll the patches in your 'mh/reflife' branch, could you please squash this into the patch corresponding to commit cbdeb23e ("object_array_entry: fix memory handling of the name field", 25-05-2013).

Thanks!

ATB, Ramsay Jones

 object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/object.c b/object.c
index 2976b2e..0de4c91 100644
--- a/object.c
+++ b/object.c
@@ -269,7 +269,7 @@ int object_list_contains(struct object_list *list, struct object *obj)
  * A zero-length string to which object_array_entry::name can be
  * initialized without requiring a malloc/free.
  */
-char object_array_slopbuf[1];
+static char object_array_slopbuf[1];
 
 static void add_object_array_with_mode_context(struct object *obj, const char *name,
 					       struct object_array *array,
-- 
1.8.3
Next: Michael Haggerty
Message 1 of 2 in “object.c: Fix a sparse warning”
  1. object.c: Fix a sparse warningRamsay Jones, Jun 1, 2013
  2. Michael HaggertyJun 2, 2013

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.