On Wed, Jun 17, 2015 at 08:53:57PM +0200, Fritjof Bornebusch wrote:
> Hi tech@,
>
> *edp1* and *edp2* could be used uninitialized, if *goto closem;* is called.
>
Such initializers hiding a false positive, cause the compiler does not
understand this case can never happen.
-> warning: 'edp1' may be used uninitialized in this function
-> warning: 'edp2' may be used uninitialized in this function
Sorry for beeing not that clear.
> Regards,
> --F.
>
>
> Index: diffdir.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/diff/diffdir.c,v
> retrieving revision 1.43
> diff -u -p -r1.43 diffdir.c
> --- diffdir.c 16 Jan 2015 06:40:07 -0000 1.43
> +++ diffdir.c 17 Jun 2015 18:50:57 -0000
> @@ -48,8 +48,8 @@ static void diffit(struct dirent *, char
> void
> diffdir(char *p1, char *p2, int flags)
> {
> - struct dirent *dent1, **dp1, **edp1, **dirp1 = NULL;
> - struct dirent *dent2, **dp2, **edp2, **dirp2 = NULL;
> + struct dirent *dent1, **dp1, **edp1 = NULL, **dirp1 = NULL;
> + struct dirent *dent2, **dp2, **edp2 = NULL, **dirp2 = NULL;
> size_t dirlen1, dirlen2;
> char path1[PATH_MAX], path2[PATH_MAX];
> int pos;
>