Re: [vdr] [PATCH] Fix undefined behaviour

2022-12-05 Thread Klaus Schmidinger
On 05.12.22 16:54, Marko Mäkelä wrote: Hi Klaus, Mon, Dec 05, 2022 at 04:08:45PM +0100, Klaus Schmidinger wrote: If NumCamSlots is 0, SlotPriority[] is never accessed. So why allocate memory for it if it is never used? Allocating a variable-length array of length 0 is undefined behaviour.

Re: [vdr] [PATCH] Fix undefined behaviour

2022-12-05 Thread Marko Mäkelä
Hi Klaus, Mon, Dec 05, 2022 at 04:08:45PM +0100, Klaus Schmidinger wrote: If NumCamSlots is 0, SlotPriority[] is never accessed. So why allocate memory for it if it is never used? Allocating a variable-length array of length 0 is undefined behaviour. The compiler is allowed to assume

Re: [vdr] [PATCH] Fix undefined behaviour

2022-12-05 Thread Klaus Schmidinger
On 04.12.22 13:19, Marko Mäkelä wrote: ... 0001-Fix-GCC-8.3.0-fsanitize-undefined.patch From b69ff7105d4bb8d933f0214f34b103fda8e8b155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Sun, 4 Dec 2022 13:42:57 +0200 Subject: [PATCH] Fix GCC 8.3.0 -fsanitize=undefined