Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH v2] Detailed diagnosis when parsing an object name fails.

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:47:50

Possibly related (same subject, not in this thread)

Junio C Hamano [off-list ref] writes:
Matthieu Moy [off-list ref] writes:

The second round still had a few compilation warnings (turned to errors in
my environment) so I fixed them up somewhat.
Thanks. For some reasons, I had CFLAGS=-g and I didn't see the
warnings :-(
I stopped before getting a
clean compile, though---you will still get:

  sha1_name.c: In function 'get_sha1_with_mode_1':
  sha1_name.c:956: error: 'object_name' may be used uninitialized in this function
This one is strange. I don't git it with gcc 4.4, even with -Wall
-Werror. And indeed, object_name is initialized when !gently, which is
precisely when we use it.

I did

-               char *object_name;
+               char *object_name = NULL;

to make sure the warning goes away on your machine, but I don't
understand what's going on.
 cache.h     |    4 ++--
 sha1_name.c |    2 +-
Squashed into v3, together with initialisation of object_name, and two
s/int/unsigned/ to please gcc -Wextra.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help