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

Re: [PATCH 1/3] for-each-ref: introduce %C(...) for color

From: Antoine Pelisse <hidden>
Date: 2016-06-15 22:57:27

On Sat, May 25, 2013 at 1:50 PM, Ramkumar Ramachandra
[off-list ref] wrote:
Antoine Pelisse wrote:
quoted
Is it not possible for "color" to be used uninitialized here ?
My compiler didn't complain; what am I missing?  Doesn't the
declaration char color[COLOR_MAXLEN]; initialize an empty string?
As John said, this is allocated on the stack.
What do you want it to be initialized to ?
Filled with zeros ? That's overkill because only the first char needs
to be zeroed.
The compiler can't know what to do and it lets you to take the best action.
More importantly, aren't there numerous instances of this in the
codebase?
I think Valgrind would be mad at us if there was many instances of
this. By the way Ramkumar, could you check if Valgrind complains with
your patch ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help