danmar / simplecpp

C++ preprocessor
BSD Zero Clause License
209 stars 83 forks source link

do not treat directories like regular files in existence checks #339

Open firewave opened 9 months ago

firewave commented 9 months ago

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 commented 9 months ago

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 commented 5 months ago

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.