Re: [PATCH] xen: Use -Wuninitialized and -Winit-self

2024-04-25 Thread Stefano Stabellini
On Thu, 28 Dec 2023, Andrew Cooper wrote: > The use of uninitialised data is undefined behaviour. At -O2 with trivial > examples, both Clang and GCC delete the variable, and in the case of a > function return, the caller gets whatever was stale in %rax prior to the call. > > Clang includes

Re: [PATCH] xen: Use -Wuninitialized and -Winit-self

2024-01-05 Thread Roberto Bagnara
On 2024-01-05 07:56, Jan Beulich wrote: On 04.01.2024 21:43, Roberto Bagnara wrote: On 2024-01-04 15:33, Andrew Cooper wrote: On 04/01/2024 1:41 pm, Jan Beulich wrote: On 28.12.2023 20:39, Andrew Cooper wrote: The use of uninitialised data is undefined behaviour. At -O2 with trivial

Re: [PATCH] xen: Use -Wuninitialized and -Winit-self

2024-01-04 Thread Jan Beulich
On 04.01.2024 16:33, Jan Beulich wrote: > On 04.01.2024 15:33, Andrew Cooper wrote: >> On 04/01/2024 1:41 pm, Jan Beulich wrote: >>> Furthermore this initialize-to-self is a well known pattern to suppress the >>> -Wuninitialized induced warnings, originally used by Linux'es >>>

Re: [PATCH] xen: Use -Wuninitialized and -Winit-self

2024-01-04 Thread Jan Beulich
On 04.01.2024 21:43, Roberto Bagnara wrote: > On 2024-01-04 15:33, Andrew Cooper wrote: >> On 04/01/2024 1:41 pm, Jan Beulich wrote: >>> On 28.12.2023 20:39, Andrew Cooper wrote: The use of uninitialised data is undefined behaviour. At -O2 with trivial examples, both Clang and GCC

Re: [PATCH] xen: Use -Wuninitialized and -Winit-self

2024-01-04 Thread Stefano Stabellini
On Thu, 4 Jan 2024, Roberto Bagnara wrote: > On 2024-01-04 15:33, Andrew Cooper wrote: > > On 04/01/2024 1:41 pm, Jan Beulich wrote: > > > On 28.12.2023 20:39, Andrew Cooper wrote: > > > > The use of uninitialised data is undefined behaviour. At -O2 with > > > > trivial > > > > examples, both

Re: [PATCH] xen: Use -Wuninitialized and -Winit-self

2024-01-04 Thread Tamas K Lengyel
> > Getting ~0 back is strictly less bad than getting stack rubble because > > at least it's obviously wrong. > > But then why not change things so there's no issue anymore? Plus I'm not > sure how / whether "obviously wrong" would manifest. I expect it would > be an entirely unobvious boot hang,

Re: [PATCH] xen: Use -Wuninitialized and -Winit-self

2024-01-04 Thread Roberto Bagnara
On 2024-01-04 15:33, Andrew Cooper wrote: On 04/01/2024 1:41 pm, Jan Beulich wrote: On 28.12.2023 20:39, Andrew Cooper wrote: The use of uninitialised data is undefined behaviour. At -O2 with trivial examples, both Clang and GCC delete the variable, and in the case of a function return, the

Re: [PATCH] xen: Use -Wuninitialized and -Winit-self

2024-01-04 Thread Jan Beulich
On 04.01.2024 15:33, Andrew Cooper wrote: > On 04/01/2024 1:41 pm, Jan Beulich wrote: >> On 28.12.2023 20:39, Andrew Cooper wrote: >>> The use of uninitialised data is undefined behaviour. At -O2 with trivial >>> examples, both Clang and GCC delete the variable, and in the case of a >>> function

Re: [PATCH] xen: Use -Wuninitialized and -Winit-self

2024-01-04 Thread Andrew Cooper
On 04/01/2024 1:41 pm, Jan Beulich wrote: > On 28.12.2023 20:39, Andrew Cooper wrote: >> The use of uninitialised data is undefined behaviour. At -O2 with trivial >> examples, both Clang and GCC delete the variable, and in the case of a >> function return, the caller gets whatever was stale in

Re: [PATCH] xen: Use -Wuninitialized and -Winit-self

2024-01-04 Thread Jan Beulich
On 28.12.2023 20:39, Andrew Cooper wrote: > The use of uninitialised data is undefined behaviour. At -O2 with trivial > examples, both Clang and GCC delete the variable, and in the case of a > function return, the caller gets whatever was stale in %rax prior to the call. > > Clang includes

[PATCH] xen: Use -Wuninitialized and -Winit-self

2023-12-28 Thread Andrew Cooper
The use of uninitialised data is undefined behaviour. At -O2 with trivial examples, both Clang and GCC delete the variable, and in the case of a function return, the caller gets whatever was stale in %rax prior to the call. Clang includes -Wuninitialized within -Wall, but GCC only includes it in