Sorry, I report this bug with a Major severity, because it applies to all
front-ends and backends.

Consider the following code:
----
static void f() __attribute__((warning("should not be linked")));
void f() {}
int main() { f(); }
---
You just can't compile it without removing -Werror,
because there is no diagnostic option associated:
==================================================
$ gcc -Werror -fdiagnostics-show-option -c test.c
..
test.c:3: error: call to ‘f’ declared with attribute warning: should not be
linked

============== Context ==========
I think that serious developpers compile their code with options like
-Wall -Werror....
and on some files or builds disable either a warning:
-Wno-unused-parameter
or let the warning be shown but don't make it an error:
-Wno-error=unused-parameter  (e.g. in debug builds)

The conditions depend on the files, type of build, organization preferences,
etc;
combining -Wall.. and -Werror is for me a prerequisite for high-quality code,
so removing -Werror is barely unacceptable; it'll go in the makefiles, be
dumped
into the source-control, and time will be lost looking for a bug which would
have been detected and blocked by the compiler instead of on the field.

I would just recommend that within gcc, it would be impossible to emit a
warning
without having it associated to a diagnostic.

I'm not providing a patch yet, but if you think that the idea is valuable, I'll
consider digging into the code. The amount of work fixing all backends is
probably huge,
so it should be incremental.

Sincerely


-- 
           Summary: Some warnings are not linked to diagnostics options
           Product: gcc
           Version: 4.4.4
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: driver
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eric dot estievenart at free dot fr
 GCC build triplet: ALL
  GCC host triplet: ALL
GCC target triplet: ALL


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44209

Reply via email to