diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index cafbf152500..dce67605121 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -203,6 +203,8 @@ static void createDumpFile(const Settings& settings, << " long_bit=\"" << settings.platform.long_bit << '\"' << " long_long_bit=\"" << settings.platform.long_long_bit << '\"' << " pointer_bit=\"" << (settings.platform.sizeof_pointer * settings.platform.char_bit) << '\"' + << " wchar_t_bit=\"" << (settings.platform.sizeof_wchar_t * settings.platform.char_bit) << '\"' + << " size_t_bit=\"" << (settings.platform.sizeof_size_t * settings.platform.char_bit) << '\"' << "/>" << '\n'; } diff --git a/test/cli/other_test.py b/test/cli/other_test.py index a133875ea3c..829e9f2c7d7 100644 --- a/test/cli/other_test.py +++ b/test/cli/other_test.py @@ -2261,3 +2261,18 @@ def test_ignore_project_2(tmpdir): exitcode, stdout, _ = cppcheck(args, cwd=tmpdir) assert exitcode == 1, stdout assert stdout.splitlines() == lines_exp + + +def test_dumpfile_platform(tmpdir): + test_file = os.path.join(tmpdir, 'test.c') + with open(test_file, 'wt') as f: + f.write('x=1;\n') + cppcheck('--dump --platform=unix64 test.c'.split(), cwd=tmpdir) + platform = '' + with open(test_file + '.dump', 'rt') as f: + for line in f: + if line.find('