Message ID | 4EF25B36.3010905@flensrocker.de |
---|---|
State | New |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <dvb@flensrocker.de>) id 1RdUUa-00079A-IK for vdr@linuxtv.org; Wed, 21 Dec 2011 23:18:32 +0100 X-tubIT-Incoming-IP: 82.140.32.186 Received: from mxweb3.versatel.de ([82.140.32.186]) by mail.tu-berlin.de (exim-4.75/mailfrontend-2) with esmtps [TLSv1:AES256-SHA:256] for <vdr@linuxtv.org> id 1RdUUa-0002xz-HC; Wed, 21 Dec 2011 23:18:32 +0100 Received: from ens28fl.versatel.de [82.140.32.10] (helo=ens28fl.versatel.de) by mxweb3.versatel.de (82.140.32.186) with id pBLMIVaB028707; Wed, 21 Dec 2011 23:18:31 +0100 Received: from cinnamon-sage.de (i577A8ACF.versanet.de [87.122.138.207]) (authenticated bits=0) by ens28fl.versatel.de (8.12.11.20060308/8.12.11) with SMTP id pBLMIVfK032049 for <vdr@linuxtv.org>; Wed, 21 Dec 2011 23:18:31 +0100 Received: from 192.168.23.2:51898 by cinnamon-sage.de for <vdr@linuxtv.org> ; 21.12.2011 23:18:32 Message-ID: <4EF25B36.3010905@flensrocker.de> Date: Wed, 21 Dec 2011 23:18:30 +0100 From: Lars Hanisch <dvb@flensrocker.de> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: VDR Mailing List <vdr@linuxtv.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV version 0.92, clamav-milter version 0.92 on 82.140.32.176 X-Virus-Status: Clean X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.12.21.220914 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1300_1399 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, NO_URI_FOUND 0, __CP_MEDIA_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __USER_AGENT 0' X-LSpam-Score: -1.9 (-) X-LSpam-Report: No, score=-1.9 required=5.0 tests=BAYES_00=-1.9 autolearn=ham Subject: [vdr] [PATCH] vdr/config.c: memset has wrong parameters X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: VDR Mailing List <vdr@linuxtv.org> List-Id: VDR Mailing List <vdr.linuxtv.org> List-Unsubscribe: <http://www.linuxtv.org/cgi-bin/mailman/options/vdr>, <mailto:vdr-request@linuxtv.org?subject=unsubscribe> List-Archive: <http://www.linuxtv.org/pipermail/vdr> List-Post: <mailto:vdr@linuxtv.org> List-Help: <mailto:vdr-request@linuxtv.org?subject=help> List-Subscribe: <http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr>, <mailto:vdr-request@linuxtv.org?subject=subscribe> X-List-Received-Date: Wed, 21 Dec 2011 22:18:33 -0000 Status: O X-Status: X-Keywords: X-UID: 25492 |
Commit Message
L. Hanisch
Dec. 21, 2011, 10:18 p.m. UTC
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: Regards, Lars.
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 >
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); }