public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/37187]  New: please provide a way to treat -pedantic as warning when using -Werror
@ 2008-08-21 13:26 edwintorok at gmail dot com
  2008-08-21 13:28 ` [Bug c/37187] " edwintorok at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: edwintorok at gmail dot com @ 2008-08-21 13:26 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1586 bytes --]

Consider this code snippet:
cat x.c
struct test {
        void *tst;
};
struct yy {
        void **z;
};
int foo(struct test *x)
{
        struct yy y[] ={
                {       (void**) &x->tst }
        };
        return 0;
}

$ gcc x.c -c -pedantic
x.c: In function ‘foo’:
x.c:10: warning: initializer element is not computable at load time
x.c:10: warning: initializer element is not computable at load time

I now use -Werror:

$ gcc -Werror x.c -c -pedantic
cc1: warnings being treated as errors
x.c: In function ‘foo’:
x.c:10: error: initializer element is not computable at load time
x.c:10: error: initializer element is not computable at load time

This is fine, but now I want -Werror (perhaps because I use -Wall or some other
-W flags), but I don't want warnings from -pedantic to be errors (but I still
want to see them!):
$ gcc -Wall x.c -c -pedantic -Werror -Wno-error=pedantic
cc1: error: -Werror=pedantic: No option -Wpedantic

This doesn't work, and I see no other way to downgrade -pedantic to warning
after I used -Werror.


-- 
           Summary: please provide a way to treat -pedantic as warning when
                    using -Werror
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: edwintorok at gmail dot com
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <bug-37187-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2021-07-29 17:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-21 13:26 [Bug c/37187] New: please provide a way to treat -pedantic as warning when using -Werror edwintorok at gmail dot com
2008-08-21 13:28 ` [Bug c/37187] " edwintorok at gmail dot com
2008-08-21 16:13 ` manu at gcc dot gnu dot org
2008-08-21 18:05 ` manu at gcc dot gnu dot org
2008-08-22 12:17 ` manu at gcc dot gnu dot org
     [not found] <bug-37187-4@http.gcc.gnu.org/bugzilla/>
2011-11-18 20:11 ` skunk at iskunk dot org
2012-04-22 20:03 ` manu at gcc dot gnu.org
2021-07-29 17:26 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).