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
* [Bug c/37187] please provide a way to treat -pedantic as warning when using -Werror
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 ` edwintorok at gmail dot com
2008-08-21 16:13 ` manu at gcc dot gnu dot org
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: edwintorok at gmail dot com @ 2008-08-21 13:28 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]
------- Comment #1 from edwintorok at gmail dot com 2008-08-21 13:26 -------
Also -fdiagnostics-show-option doesn't show that the error is coming from
-pedantic:
$ gcc -Werror -pedantic x.c -c -fdiagnostics-show-option
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
$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.1-9'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3
--program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-mpfr --enable-cld --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.1 (Debian 4.3.1-9)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37187
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/37187] please provide a way to treat -pedantic as warning when using -Werror
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
3 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-08-21 16:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from manu at gcc dot gnu dot org 2008-08-21 16:12 -------
This is confirmed in trunk. Weird because the pedwarn is not conditional on
pedantic, so it should be given even without pedantic. This means that
-pedantic is changing something at a higher level.
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-08-21 16:12:08
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37187
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/37187] please provide a way to treat -pedantic as warning when using -Werror
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
3 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-08-21 18:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from manu at gcc dot gnu dot org 2008-08-21 18:04 -------
There are several bugs here:
1) -Wno-error=pendatic does not work. But neither does -Werror=pedantic or
-no-pedantic, so this is a feature request. We would need to implement
-Wpedantic as a synonym of -pedantic. I have been thinking about doing this for
a while anyway just for consistency. However, -pedantic-errors is not
equivalent to -Werror=pedantic, so not sure in which direction should the
inconsistency be solved.
2) The duplicated messages. This seems hard to fix: too many jumps around, too
many global variables being used...
x.c:10: warning: initializer element is not computable at load time
x.c:10: warning: initializer element is not computable at load time
3) -fdiagnostics-show-option does not show [-pedantic]. This is easy to fix.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37187
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c/37187] please provide a way to treat -pedantic as warning when using -Werror
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
` (2 preceding siblings ...)
2008-08-21 18:05 ` manu at gcc dot gnu dot org
@ 2008-08-22 12:17 ` manu at gcc dot gnu dot org
3 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-08-22 12:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from manu at gcc dot gnu dot org 2008-08-22 12:16 -------
The PR for (2) is PR 37200.
This concerns (1) and (3).
--
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).