This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70275] New: -w disables all -Werror flags


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70275

            Bug ID: 70275
           Summary: -w disables all -Werror flags
           Product: gcc
           Version: 5.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fuscated at gmail dot com
  Target Milestone: ---

It happens with all versions I have access to (4.4.7, 4.8.x, 4.9.x, 5.3.0).

To reproduce:
> cat c++noreturn.cpp 
int test() {}

int main() {
        return 0;
}

> g++-5.3.0 c++noreturn.cpp -Werror=return-type 
c++noreturn.cpp: In function âint test()â:
c++noreturn.cpp:1:13: error: no return statement in function returning non-void
[-Werror=return-type]
 int test() {}
             ^
cc1plus: some warnings being treated as errors
>

> g++-5.3.0    c++noreturn.cpp -Werror=return-type -w
>

And the output of clang:

> clang++ c++noreturn.cpp -Werror=return-type -w
c++noreturn.cpp:1:13: error: control reaches end of non-void function
[-Werror,-Wreturn-type]
int test() {}
            ^
1 error generated.


For me the behaviour of clang is more predictable and the expected one.

Why we're disabling warnings is another matter. :)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]