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.
Commit
54febc1f72c2ac779dda9c8ceadaec1e9c2a6feef582d1015c1b73b56fca88ff
Parent
202ea753e48cd2f…
1 file changed
+1
-1
+1
-1
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -950,11 +950,11 @@ | ||
| 950 | 950 | int verboseFlag; /* True if -v or --verbose flag is used */ |
| 951 | 951 | const char *zFrom; /* Source version number */ |
| 952 | 952 | const char *zTo; /* Target version number */ |
| 953 | 953 | const char *zCheckin; /* Check-in version number */ |
| 954 | 954 | 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 */ | |
| 956 | 956 | size_t nDiffCmdValues = 0; /* Number of elements in azDiffCmd; 0 for internal */ |
| 957 | 957 | const char *zBinGlob = 0; /* Treat file names matching this as binary */ |
| 958 | 958 | int fIncludeBinary = 0; /* Include binary files for external diff */ |
| 959 | 959 | int againstUndo = 0; /* Diff against files in the undo buffer */ |
| 960 | 960 | u64 diffFlags = 0; /* Flags to control the DIFF */ |
| 961 | 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; /* 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 |