Skip to content

Do not include the full file path in check assertion output #46

@vchlin

Description

@vchlin

The current output of a check assertion includes std::source_location::file_name:

corofx/src/check.cpp

Lines 14 to 18 in 8e0d439

auto check(bool pred, std::source_location loc) noexcept -> void {
if (pred) return;
trace(loc.file_name(), ":", loc.line(), ": ", loc.function_name(), ": check failed");
std::terminate();
}

In certain implementations, this can expose the absolute path of the file being compiled, potentially revealing the directory structure of the developer's environment.

A better approach might be to keep only the file's base name or remove the path components leading up to the project's directory structure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions