Skip to content

Conversation

firewave
Copy link
Collaborator

@firewave firewave commented Feb 15, 2024

std::ifstream can open directories and read from them without issue. Nothing will be read though - it is like an empty file. This would have treated an include which actually pointed to a directory as existing (e.g. #include </>).

@firewave
Copy link
Collaborator Author

No tests added since we still do not have tests for additional files ... but I just realized that certain directories always exists so at least on Linux it can be tested.

Moving code is problematic though as Cppcheck is GPL and this would re-license it under 0BSD.

@firewave
Copy link
Collaborator Author

Moving code is problematic though as Cppcheck is GPL and this would re-license it under 0BSD.

@danmar

After we resolved and merged this we should create another release so we can sync it to Cppcheck.

@firewave firewave changed the title do not treat directories like regular files in existence checks fixed #342/#343 - do not treat directories like regular files in existence checks Aug 5, 2025
@firewave
Copy link
Collaborator Author

The helper functions need to be adjusted so they align with the current usage in Cppcheck.

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