Skip to content

Flag for single line warning/error? #138990

@LevoDeLellis

Description

@LevoDeLellis

Is there a flag or env var I can use to have less verbose warnings? I don't need the ascii art

z.cpp:5:13: warning: implicit truncation from 'E' to bit-field changes value from 2 to -2 [-Wbitfield-constant-conversion]
    5 |         S s{E::C};
      |             ^~~~

Seeing the line and pointing to s does nothing for me. I only want the first line. I tried looking for an option on this page but its large and I didn't see it https://clang.llvm.org/docs/DiagnosticsReference.html

Code:

#include <cstdio>
enum E : int { A, B, C, D };
struct S { E v : 2; };
int main() {
        S s{E::C};
        switch (s.v) {
                case E::C: printf("Got C\n"); return 0;
                default: printf("Got %d\n", s.v); return 0;
        }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions