On 21.12.2011 23:18, Lars Hanisch wrote:

The compiler gives me:

:~/src/vdr$ make config.o
g++ -g -O3 -Wall -Woverloaded-virtual -Wno-parentheses -c -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE 
-DREMOTE_KBD -DLIRC_DEVICE=\"/var/run/lirc/lircd\" -DRCU_DEVICE=\"/dev/ttyS1\" -D_GNU_SOURCE 
-DVIDEODIR=\"/video\" -DCONFDIR=\"/video\" -DPLUGINDIR=\"./PLUGINS/lib\"
-DLOCDIR=\"./locale\" -I/usr/include/freetype2 config.c
In file included from /usr/include/string.h:642:0,
from config.h:16,
from config.c:10:
In Funktion »void* memset(void*, int, size_t)«,
eingefügt von »cSatCableNumbers::cSatCableNumbers(int, const char*)« bei 
/usr/include/x86_64-linux-gnu/bits/string3.h:82:32: Warnung: Aufruf von 
»__warn_memset_zero_len« mit Attributwarnung deklariert: memset used with 
constant zero length parameter; this could be due to transposed parameters 
[standardmäßig aktiviert]

I think, the memset arguments should be swapped:

diff --git a/config.c b/config.c
index 94f6845..53beb4b 100644
--- a/config.c
+++ b/config.c
@@ -69,7 +69,7 @@ cSatCableNumbers::cSatCableNumbers(int Size, const char *s)
size = Size;
array = MALLOC(int, size);
- memset(array, size * sizeof(int), 0);
+ memset(array, 0, size * sizeof(int));

Ville Skyttä already reported this to me and I have removed that call
altogether for the next developer version, because the array is initialized
explicitly, anyway.


vdr mailing list

Reply via email to