lkml.org 
[lkml]   [2020]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: linux-5.8-rc4/scripts/kconfig/qconf.cc: 2 * bad delete ?
On Wed, Jul 29, 2020 at 3:28 PM David Binderman <dcb314@hotmail.com> wrote:
>
> Hello there,
>
> >Will you send a patch, or shall I do it?
>
> Option 2 please. I gave up doing kernel patches a long time ago.

OK, I will send a patch.


> >Could you please teach me how to reproduce them?
>
> --language=c++ looks like a good candidate for a fix.
>
> Regards
>
> David Binderman
>

--language=c++ made no difference, but
I figured out why cppcheck did not work for me.


If scripts/kconfig/qconf.moc is remaining,
cppcheck does not work.


After I deleted it, cppcheck worked for me.


masahiro@oscar:~/workspace/linux$ make build_xconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/images.o
HOSTCC scripts/kconfig/confdata.o
HOSTCC scripts/kconfig/expr.o
LEX scripts/kconfig/lexer.lex.c
YACC scripts/kconfig/parser.tab.[ch]
HOSTCC scripts/kconfig/lexer.lex.o
HOSTCC scripts/kconfig/parser.tab.o
HOSTCC scripts/kconfig/preprocess.o
HOSTCC scripts/kconfig/symbol.o
HOSTCC scripts/kconfig/util.o
UPD scripts/kconfig/qconf-cfg
MOC scripts/kconfig/qconf.moc
HOSTCXX scripts/kconfig/qconf.o
HOSTLD scripts/kconfig/qconf
masahiro@oscar:~/workspace/linux$ cppcheck scripts/kconfig/qconf.cc
Checking scripts/kconfig/qconf.cc ...
masahiro@oscar:~/workspace/linux$ rm -f scripts/kconfig/qconf.moc
masahiro@oscar:~/workspace/linux$ cppcheck scripts/kconfig/qconf.cc
Checking scripts/kconfig/qconf.cc ...
scripts/kconfig/qconf.cc:1242:10: error: Mismatching allocation and
deallocation: data [mismatchAllocDealloc]
delete data;
^
scripts/kconfig/qconf.cc:1236:15: note: Mismatching allocation and
deallocation: data
char *data = new char[count + 1];
^
scripts/kconfig/qconf.cc:1242:10: note: Mismatching allocation and
deallocation: data
delete data;
^
scripts/kconfig/qconf.cc:1255:10: error: Mismatching allocation and
deallocation: data [mismatchAllocDealloc]
delete data;
^
scripts/kconfig/qconf.cc:1236:15: note: Mismatching allocation and
deallocation: data
char *data = new char[count + 1];
^
scripts/kconfig/qconf.cc:1255:10: note: Mismatching allocation and
deallocation: data
delete data;
^








--
Best Regards
Masahiro Yamada

\
 
 \ /
  Last update: 2020-07-29 17:15    [W:0.041 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site