Skip to content

reduced unnecessary usage of emptyString#7229

Merged
chrchr-github merged 5 commits into
cppcheck-opensource:mainfrom
firewave:emptystring
Jan 22, 2025
Merged

reduced unnecessary usage of emptyString#7229
chrchr-github merged 5 commits into
cppcheck-opensource:mainfrom
firewave:emptystring

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

No description provided.

@firewave
Copy link
Copy Markdown
Collaborator Author

emptyString is used for const std::string& return values and as an optimization in some cases. But those are insolated cases.

The goal is to remove it from config.h because that file should only contain "configuration" related stuff.

Also the <string> makes this one of the heavier headers.

Even worse though is the fact that the include affects the preprocessor checks. We are (were?) checking non-compiler/built-in defines which were transiently included leading to portability issues.

@firewave firewave changed the title removed unnecessary usage of emptyString reduced unnecessary usage of emptyString Jan 16, 2025
@firewave
Copy link
Copy Markdown
Collaborator Author

Even worse though is the fact that the include affects the preprocessor checks. We are (were?) checking non-compiler/built-in defines which were transiently included leading to portability issues.

I think this also implies that config.h always needs to be the very first include. Something for later ... as usual.

@firewave firewave marked this pull request as draft January 16, 2025 15:01
@firewave firewave marked this pull request as ready for review January 16, 2025 15:12
@firewave firewave marked this pull request as draft January 18, 2025 11:54
@firewave firewave marked this pull request as ready for review January 18, 2025 12:00
@chrchr-github chrchr-github merged commit 06e7663 into cppcheck-opensource:main Jan 22, 2025
@firewave firewave deleted the emptystring branch January 22, 2025 12:55
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