# [PATCH] object.c: Fix a sparse warning

2 messages from 2013-06-01 to 2013-06-02. Participants: Ramsay Jones, Michael Haggerty.
Thread: https://gitlist.dev/t/34009

## Ramsay Jones, 2013-06-01 17:46

Subject: [PATCH] object.c: Fix a sparse warning
Message-ID: <51AA3363.8030705@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/51AA3363.8030705%40ramsay1.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

```

## Michael Haggerty, 2013-06-02 06:12

Subject: Re: [PATCH] object.c: Fix a sparse warning
Message-ID: <51AAE25A.6080009@alum.mit.edu>
URL: https://gitlist.dev/e/51AAE25A.6080009%40alum.mit.edu
In-Reply-To: <51AA3363.8030705@ramsay1.demon.co.uk>

```
On 06/01/2013 07:46 PM, Ramsay Jones wrote:
> 
> 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).

Ramsay, thanks for fixing this.

Junio, it doesn't seem worth spamming the list with a re-roll for this
and the other 1-line fixup commit that I already sent.  Would you mind
either pulling the re-rolled version that I published here:

    git://github.com/mhagger/git.git
    branch reflife-v3, 50f7a18ee9ad537a7bf7992d6eb145299a4884b9

or squashing them onto the patch series yourself?  Let me know if this
is inconvenient.

Thanks,
Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/

```
