Skip to content

-Wstring-concatenation seems insufficiently alarmistΒ #153745

@r-barnes

Description

@r-barnes
int main()
{
    // Or this one
    const char* v3[]  = {
        "One",
        "Two" 
        "Three",
        "Four",
        "Five",
        "Six"
        "Seven",
        "Eight",
        "Nine",
        "Ten",
        "Eleven",
    };      
}

does not raise a -Wstring-concatenation warning because two commas are missing (godbolt).

Perhaps a better heuristic for -Wstring-concatenation is "if strings on either side of me are delimited by commas, I should probably have one as well".

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerfalse-negativeWarning doesn't fire when it should

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions