Fossil SCM

Initialized a pointer to 0 to squish a bogus complaint from GCC 11 on MinGW 9. The code passes ASAN on macOS Clang without this, so I believe GCC is just doing over-eager static analysis across function calls, not realizing that the pointer *will* be initialized before it's used.

wyoung 2021-06-22 16:36 fossil-spawn
Commit 54febc1f72c2ac779dda9c8ceadaec1e9c2a6feef582d1015c1b73b56fca88ff
1 file changed +1 -1
+1 -1
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -950,11 +950,11 @@
950950
int verboseFlag; /* True if -v or --verbose flag is used */
951951
const char *zFrom; /* Source version number */
952952
const char *zTo; /* Target version number */
953953
const char *zCheckin; /* Check-in version number */
954954
const char *zBranch; /* Branch to diff */
955
- const char **azDiffCmd; /* External diff cmd and optional args */
955
+ const char **azDiffCmd = 0;/* External diff cmd and optional args */
956956
size_t nDiffCmdValues = 0; /* Number of elements in azDiffCmd; 0 for internal */
957957
const char *zBinGlob = 0; /* Treat file names matching this as binary */
958958
int fIncludeBinary = 0; /* Include binary files for external diff */
959959
int againstUndo = 0; /* Diff against files in the undo buffer */
960960
u64 diffFlags = 0; /* Flags to control the DIFF */
961961
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -950,11 +950,11 @@
950 int verboseFlag; /* True if -v or --verbose flag is used */
951 const char *zFrom; /* Source version number */
952 const char *zTo; /* Target version number */
953 const char *zCheckin; /* Check-in version number */
954 const char *zBranch; /* Branch to diff */
955 const char **azDiffCmd; /* External diff cmd and optional args */
956 size_t nDiffCmdValues = 0; /* Number of elements in azDiffCmd; 0 for internal */
957 const char *zBinGlob = 0; /* Treat file names matching this as binary */
958 int fIncludeBinary = 0; /* Include binary files for external diff */
959 int againstUndo = 0; /* Diff against files in the undo buffer */
960 u64 diffFlags = 0; /* Flags to control the DIFF */
961
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -950,11 +950,11 @@
950 int verboseFlag; /* True if -v or --verbose flag is used */
951 const char *zFrom; /* Source version number */
952 const char *zTo; /* Target version number */
953 const char *zCheckin; /* Check-in version number */
954 const char *zBranch; /* Branch to diff */
955 const char **azDiffCmd = 0;/* External diff cmd and optional args */
956 size_t nDiffCmdValues = 0; /* Number of elements in azDiffCmd; 0 for internal */
957 const char *zBinGlob = 0; /* Treat file names matching this as binary */
958 int fIncludeBinary = 0; /* Include binary files for external diff */
959 int againstUndo = 0; /* Diff against files in the undo buffer */
960 u64 diffFlags = 0; /* Flags to control the DIFF */
961

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button