Skip to content

Conversation

@danmar
Copy link
Owner

@danmar danmar commented Nov 17, 2025

The file-less warning generated from cppcheckexecutor.cpp is removed. the --errorlist message should match the real message.

@danmar danmar marked this pull request as draft November 17, 2025 20:35
@firewave
Copy link
Collaborator

Looks like we are lacking tests for this (and --check-config).

@danmar
Copy link
Owner Author

danmar commented Nov 18, 2025

Looks like we are lacking tests for this (and --check-config).

Yeah I was expecting some testfailures

@danmar danmar changed the title Experimental fix for #13825 (toomanyconfigs lacks file information) Fix #13825 (toomanyconfigs lacks file information) Nov 18, 2025
@danmar danmar marked this pull request as ready for review November 18, 2025 09:21
f.write(f'#{dir} defined(X{i})\nx = {i};\n')
f.write('#endif\n')

args = ['--enable=information', '--template=daca2', str(test_file)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are using the daca2 template?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because default template writes 3 lines instead of 1.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any 1-line template format will do here imho

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple is usually used in the tests.

// if maxConfigs has default value then report information message that configurations are skipped
if (mSettings.maxConfigs == 12 && mSettings.severity.isEnabled(Severity::information))
tooManyConfigsError(Path::toNativeSeparators(file.spath()), configurations.size());

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels very strange.

Also the check for the default value should not be hard-coded - use a default Settings object to check against.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote a comment to describe it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Seems to make sense but I have not thought too much about it - as I have not dug too much into #7424.

But I have to from a different angle anyways as part of preprocessor work I am doing. But merging this should be fine (possibly even helpful as there is less code to go through).

@danmar danmar marked this pull request as draft November 19, 2025 07:04
@sonarqubecloud
Copy link

@danmar danmar marked this pull request as ready for review November 19, 2025 18:54
@danmar danmar merged commit 33ff194 into danmar:main Nov 20, 2025
55 checks passed
@danmar danmar deleted the fix-13825 branch November 20, 2025 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants