Skip to content

change the rules of relativeness preserving to depend on the source file including it for relative path includes #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tal500
Copy link
Contributor

@Tal500 Tal500 commented Jun 15, 2025

The specification from danmar/cppcheck#7554 (comment) :

A path (both for (1) top-level source files and (2) header files - i.e. files that are introduced by #include) will be absolute if and only if at least one of the condition is true:

  1. The top-level source file (for headers it is the one that includes it) is given as an input file to simplecpp in its absolute form, except for the case that this is a header file that its inclusion was resolved by inclusion dirs (i.e. -I) - and this condition is false in that latter case (note that sometimes condition 3 can be true in that case, resulting in absolute flavor).
  2. For header files only that are not system includes(i.e. #include "..."): The include path is absolute.
  3. For header files that were resolved by inclusion dirs (i.e. -I): The resolved inclusion dir is absolute.

Whenever the same file is introduced twice or more, only the first occurrence that simplecpp sees will determine the absoluteness flavor.

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.

1 participant