Submitter | L. Hanisch |
---|---|
Date | Dec. 21, 2011, 10:18 p.m. |
Message ID | <4EF25B36.3010905@flensrocker.de> |
Download | mbox | patch |
Permalink | /patch/12917/ |
State | New |
Headers | show |
Comments
On 21.12.2011 23:18, Lars Hanisch wrote: > Hi, > > 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 config.c:72:39: > /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)); > FromString(s); > } 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. Klaus
Am 21.12.2011 23:31, schrieb Klaus Schmidinger: > On 21.12.2011 23:18, Lars Hanisch wrote: >> Hi, >> >> 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 config.c:72:39: >> /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)); >> FromString(s); >> } > > 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. Fine! :-) Lars. > > Klaus > > _______________________________________________ > vdr mailing list > vdr@linuxtv.org > http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr >
Patch
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)); FromString(s); }