[Pdbg] [PATCH] libpdbg: Initialize to avoid build errors with -O3

Alistair Popple alistair at popple.id.au
Mon Aug 13 15:20:17 AEST 2018


Thanks Amitay!

- Alistair

On Wednesday, 8 August 2018 7:17:40 PM AEST Amitay Isaacs wrote:
> Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
> ---
>  libpdbg/chip.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libpdbg/chip.c b/libpdbg/chip.c
> index 079592c..3cf33ec 100644
> --- a/libpdbg/chip.c
> +++ b/libpdbg/chip.c
> @@ -325,7 +325,7 @@ int ram_state_thread(struct pdbg_target *thread, struct thread_regs *regs)
>  {
>  	struct thread_regs _regs;
>  	struct thread *t;
> -	uint64_t value;
> +	uint64_t value = 0;
>  	int i;
>  
>  	if (!regs)
> @@ -362,7 +362,7 @@ int ram_state_thread(struct pdbg_target *thread, struct thread_regs *regs)
>  
>  	regs->cr = 0;
>  	for (i = 0; i < 8; i++) {
> -		uint64_t cr;
> +		uint64_t cr = 0;
>  		ram_getcr(thread, i, &cr);
>  		regs->cr |= cr;
>  	}
> 




More information about the Pdbg mailing list