[rtems commit] dhrystone/dhry_1.c: Fix may be used uninitialized warning

Gedare Bloom gedare at rtems.org
Wed Apr 26 00:04:30 UTC 2017


On Mon, Apr 24, 2017 at 6:21 PM, Joel Sherrill <joel at rtems.org> wrote:
> Module:    rtems
> Branch:    master
> Commit:    906e67fe88658122d515a5dcc0570ee56a02877d
> Changeset: http://git.rtems.org/rtems/commit/?id=906e67fe88658122d515a5dcc0570ee56a02877d
>
> Author:    Joel Sherrill <joel at rtems.org>
> Date:      Sun Apr 23 11:50:46 2017 -0500
>
> dhrystone/dhry_1.c: Fix may be used uninitialized warning
>
> ---
>
>  testsuites/benchmarks/dhrystone/dhry_1.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/testsuites/benchmarks/dhrystone/dhry_1.c b/testsuites/benchmarks/dhrystone/dhry_1.c
> index 36ac303..9b64d3a 100644
> --- a/testsuites/benchmarks/dhrystone/dhry_1.c
> +++ b/testsuites/benchmarks/dhrystone/dhry_1.c
> @@ -143,6 +143,11 @@ execution_start:
>    Begin_Time = time ( (long *) 0);
>  #endif
>
> +#ifdef __rtems__
> +  /* avoid used uninitialized warning */
> +  Int_2_Loc = 0;
> +#endif
> +
This looks like unnecessarily catering to the compiler. At any rate,
this kind of change should be located before the call to the timer,
since it maybe perturbs the benchmark timing.

>    for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
>    {
>
>
> _______________________________________________
> vc mailing list
> vc at rtems.org
> http://lists.rtems.org/mailman/listinfo/vc


More information about the devel mailing list