Re: linux-5.8-rc4/scripts/kconfig/qconf.cc: 2 * bad delete ?

From: Masahiro Yamada
Date: Tue Jul 28 2020 - 22:15:28 EST


On Mon, Jul 6, 2020 at 6:22 PM David Binderman <dcb314@xxxxxxxxxxx> wrote:
>
> Hello there,
>
> linux-5.8-rc4/scripts/kconfig/qconf.cc:1242:10: error: Mismatching allocation and deallocation: data [mismatchAllocDealloc]
> linux-5.8-rc4/scripts/kconfig/qconf.cc:1255:10: error: Mismatching allocation and deallocation: data [mismatchAllocDealloc]
>
> new [] needs delete [].
>
> Regards
>
> David Binderman


Thanks for the report, and sorry for the delay.

Will you send a patch, or shall I do it?


BTW, I guess those error messages are from cppcheck.


Could you please teach me how to reproduce them?


I ran cppcheck against qconf.cc
but no success to check it.




masahiro@oscar:~/ref/linux$ cppcheck scripts/kconfig/qconf.cc
Checking scripts/kconfig/qconf.cc ...
masahiro@oscar:~/ref/linux$ cppcheck --enable=all scripts/kconfig/qconf.cc
Checking scripts/kconfig/qconf.cc ...
scripts/kconfig/qconf.cc:0:0: information: This file is not analyzed.
Cppcheck failed to extract a valid configuration. Use -v for more
details. [noValidConfiguration]

^
nofile:0:0: information: Cppcheck cannot find all the include files
(use --check-config for details) [missingIncludeSystem]

masahiro@oscar:~/ref/linux$ cppcheck -v --enable=all scripts/kconfig/qconf.cc
Checking scripts/kconfig/qconf.cc ...
Defines:
Undefines:
Includes:
Platform:Native
scripts/kconfig/qconf.cc:0:0: information: This file is not analyzed.
Cppcheck failed to extract a valid configuration. The tested
configurations have these preprocessor errors:
'' : [scripts/kconfig/qconf.moc:12] #error "The header file 'qconf.h'
doesn't include <QObject>."
Q_MOC_OUTPUT_REVISION : [scripts/kconfig/qconf.moc:14] #error "This
file was generated using the moc from 5.12.8. It"
[noValidConfiguration]

^
nofile:0:0: information: Cppcheck cannot find all the include files.
Cppcheck can check the code without the include files found. But the
results will probably be more accurate if all the include files are
found. Please check your project's include directories and add all of
them as include directories for Cppcheck. To see what files Cppcheck
cannot find use --check-config. [missingIncludeSystem]







--
Best Regards
Masahiro Yamada