git/vcs-svn
David Barr 4a5de8dd79 vcs-svn: avoid self-assignment in dummy initialization of pre_off
Without this change, clang complains:

 vcs-svn/svndiff.c:298:3: warning: Assigned value is garbage or undefined
                 off_t pre_off = pre_off; /* stupid GCC... */
                 ^               ~~~~~~~

This code uses an old and common idiom for suppressing an
"uninitialized variable" warning, and clang is wrong to warn about it.
The idiom tells the compiler to leave the variable uninitialized,
which saves a few bytes of code size, and, more importantly, allows
valgrind to check at runtime that the variable is properly initialized
by the time it is used.

But MSVC and clang do not know that idiom, so let's avoid it in
vcs-svn/ code.

Initialize pre_off to -1, a recognizably meaningless value, to allow
future code changes that cause pre_off to be used before it is
initialized to be caught early.

Signed-off-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2012-07-05 23:26:52 -05:00
..
fast_export.c vcs-svn: drop no-op reset methods 2012-07-05 23:26:51 -05:00
fast_export.h vcs-svn: drop no-op reset methods 2012-07-05 23:26:51 -05:00
LICENSE Merge branch 'db/delta-applier' into db/text-delta 2011-05-26 02:27:48 -05:00
line_buffer.c vcs-svn: drop no-op reset methods 2012-07-05 23:26:51 -05:00
line_buffer.h vcs-svn: drop no-op reset methods 2012-07-05 23:26:51 -05:00
line_buffer.txt vcs-svn: remove buffer_read_string 2011-03-26 00:17:35 -05:00
repo_tree.c Fix a bitwise negation assignment issue spotted by Sun Studio 2011-12-21 10:19:40 -08:00
repo_tree.h Merge branch 'db/svn-fe-code-purge' into svn-fe 2011-05-26 02:12:14 -05:00
sliding_window.c vcs-svn: suppress -Wtype-limits warning 2012-02-02 05:33:37 -06:00
sliding_window.h vcs-svn: cap number of bytes read from sliding view 2011-06-15 02:15:22 -05:00
svndiff.c vcs-svn: avoid self-assignment in dummy initialization of pre_off 2012-07-05 23:26:52 -05:00
svndiff.h vcs-svn: skeleton of an svn delta parser 2011-03-27 22:41:38 -05:00
svndump.c vcs-svn: drop no-op reset methods 2012-07-05 23:26:51 -05:00
svndump.h vcs-svn: Check for errors from open() 2010-11-24 14:51:42 -08:00