initialise dc variable to satisfy old compilers.

When compiling with -Wall on a machine with an old compiler it gives a false
positive that the dc variable which is a structure of type DISPLAY_COLUMNS
could be used uninitialised. In fact the dc variable's members will always get
set in the case it is used, otherwise it is left uninitialised.
This fix just causes the dc variable's members to always get initialised to 0
at declaration, so the false positive will not get flagged.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5337)
This commit is contained in:
Steve Linsell 2018-02-22 13:24:13 -05:00 committed by Rich Salz
parent 6f4b929af0
commit d16a2c1931

View File

@ -520,7 +520,7 @@ static void list_type(FUNC_TYPE ft, int one)
{ {
FUNCTION *fp; FUNCTION *fp;
int i = 0; int i = 0;
DISPLAY_COLUMNS dc; DISPLAY_COLUMNS dc = {0};
if (!one) if (!one)
calculate_columns(&dc); calculate_columns(&dc);