public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/26494] New: -pedantic-errors can be overridden by -W*
@ 2006-02-28 11:35 fn_x at hotmail dot com
2006-02-28 13:11 ` [Bug c/26494] " pinskia at gcc dot gnu dot org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: fn_x at hotmail dot com @ 2006-02-28 11:35 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]
This simple incorrect program:
int main() { puts("Hello"); }
when compiled with gcc -std=c99 -pedantic-errors is rejected with
test.c: In function main:
test.c:1: error: implicit declaration of function puts
However, add -Wall to the options, and it becomes:
test.c: In function main:
test.c:1: warning: implicit declaration of function puts
and the program compiles and runs without errors. I think gcc should not
compile it. Also, reordering the options doesn't change anything.
Given how old this is (I can see it with gcc 3.3.6, 3.4.5, 4.0.2 and
4.1(20060223)), I'm a bit surprised if it hasn't come up before, but I searched
bugzilla and didn't find anything. Sorry for anything I missed.
--
Summary: -pedantic-errors can be overridden by -W*
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fn_x at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/26494] -pedantic-errors can be overridden by -W*
2006-02-28 11:35 [Bug c/26494] New: -pedantic-errors can be overridden by -W* fn_x at hotmail dot com
@ 2006-02-28 13:11 ` pinskia at gcc dot gnu dot org
2007-01-22 23:48 ` manu at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-28 13:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2006-02-28 12:59 -------
Confirmed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2006-02-28 12:59:24
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/26494] -pedantic-errors can be overridden by -W*
2006-02-28 11:35 [Bug c/26494] New: -pedantic-errors can be overridden by -W* fn_x at hotmail dot com
2006-02-28 13:11 ` [Bug c/26494] " pinskia at gcc dot gnu dot org
@ 2007-01-22 23:48 ` manu at gcc dot gnu dot org
2007-01-23 0:05 ` truedfx at gentoo dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-01-22 23:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from manu at gcc dot gnu dot org 2007-01-22 23:47 -------
Does it happen with any other option apart from
-Wimplicit-function-declaration?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/26494] -pedantic-errors can be overridden by -W*
2006-02-28 11:35 [Bug c/26494] New: -pedantic-errors can be overridden by -W* fn_x at hotmail dot com
2006-02-28 13:11 ` [Bug c/26494] " pinskia at gcc dot gnu dot org
2007-01-22 23:48 ` manu at gcc dot gnu dot org
@ 2007-01-23 0:05 ` truedfx at gentoo dot org
2007-01-23 0:08 ` truedfx at gentoo dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: truedfx at gentoo dot org @ 2007-01-23 0:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from truedfx at gentoo dot org 2007-01-23 00:05 -------
-Wendif-labels and -Wimplicit-int don't turn errors into warnings, so probably,
yes. I did notice something else of interest while testing, though:
int main(char a) {}
gcc bug.c -ansi -pedantic
compiles this without any error or warning.
gcc bug.c -ansi -pedantic -Wmain
reports
bug.c:1: warning: first argument of ‘main’ should be
‘int’
bug.c:1: warning: ‘main’ takes only zero or two arguments
and compiles this.
gcc bug.c -ansi -pedantic-errors
compiles this without any error or warning.
gcc bug.c -ansi -pedantic-errors -Wmain
reports
bug.c:1: error: first argument of ‘main’ should be
‘int’
bug.c:1: error: ‘main’ takes only zero or two arguments
and does not compile this.
Is that close enough to be covered by this bug report, should I report that as
a new bug, or should I not report that at all?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/26494] -pedantic-errors can be overridden by -W*
2006-02-28 11:35 [Bug c/26494] New: -pedantic-errors can be overridden by -W* fn_x at hotmail dot com
` (2 preceding siblings ...)
2007-01-23 0:05 ` truedfx at gentoo dot org
@ 2007-01-23 0:08 ` truedfx at gentoo dot org
2007-01-23 0:10 ` manu at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: truedfx at gentoo dot org @ 2007-01-23 0:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from truedfx at gentoo dot org 2007-01-23 00:08 -------
(In reply to comment #3)
> -Wendif-labels and -Wimplicit-int don't turn errors into warnings, so probably,
> yes.
So probably, no, it does not happen with any other option. Sorry, I read your
question wrong.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/26494] -pedantic-errors can be overridden by -W*
2006-02-28 11:35 [Bug c/26494] New: -pedantic-errors can be overridden by -W* fn_x at hotmail dot com
` (3 preceding siblings ...)
2007-01-23 0:08 ` truedfx at gentoo dot org
@ 2007-01-23 0:10 ` manu at gcc dot gnu dot org
2007-01-23 0:23 ` truedfx at gentoo dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-01-23 0:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from manu at gcc dot gnu dot org 2007-01-23 00:10 -------
Open a new bug report, please. I am going to submit a patch to fix this one and
reviewers don't like patches that do many things and the same time.
Add me to the CC list of the new report and I will look at it as soon as I can.
Thanks.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/26494] -pedantic-errors can be overridden by -W*
2006-02-28 11:35 [Bug c/26494] New: -pedantic-errors can be overridden by -W* fn_x at hotmail dot com
` (4 preceding siblings ...)
2007-01-23 0:10 ` manu at gcc dot gnu dot org
@ 2007-01-23 0:23 ` truedfx at gentoo dot org
2007-01-24 19:10 ` patchapp at dberlin dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: truedfx at gentoo dot org @ 2007-01-23 0:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from truedfx at gentoo dot org 2007-01-23 00:23 -------
Thank you, and done.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/26494] -pedantic-errors can be overridden by -W*
2006-02-28 11:35 [Bug c/26494] New: -pedantic-errors can be overridden by -W* fn_x at hotmail dot com
` (5 preceding siblings ...)
2007-01-23 0:23 ` truedfx at gentoo dot org
@ 2007-01-24 19:10 ` patchapp at dberlin dot org
2007-01-25 9:55 ` patchapp at dberlin dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: patchapp at dberlin dot org @ 2007-01-24 19:10 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from patchapp at dberlin dot org 2007-01-24 19:10 -------
Subject: Bug number PR 26494
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02023.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/26494] -pedantic-errors can be overridden by -W*
2006-02-28 11:35 [Bug c/26494] New: -pedantic-errors can be overridden by -W* fn_x at hotmail dot com
` (6 preceding siblings ...)
2007-01-24 19:10 ` patchapp at dberlin dot org
@ 2007-01-25 9:55 ` patchapp at dberlin dot org
2007-02-15 22:31 ` manu at gcc dot gnu dot org
2007-02-15 22:34 ` manu at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: patchapp at dberlin dot org @ 2007-01-25 9:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from patchapp at dberlin dot org 2007-01-25 09:55 -------
Subject: Bug number PR 26494
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-01/msg02068.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/26494] -pedantic-errors can be overridden by -W*
2006-02-28 11:35 [Bug c/26494] New: -pedantic-errors can be overridden by -W* fn_x at hotmail dot com
` (7 preceding siblings ...)
2007-01-25 9:55 ` patchapp at dberlin dot org
@ 2007-02-15 22:31 ` manu at gcc dot gnu dot org
2007-02-15 22:34 ` manu at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-02-15 22:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from manu at gcc dot gnu dot org 2007-02-15 22:31 -------
Subject: Bug 26494
Author: manu
Date: Thu Feb 15 22:31:17 2007
New Revision: 122017
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122017
Log:
2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c/26494
* doc/invoke.texi (Warning Options): Remove
-Werror-implicit-function-declaration.
(Wimplicit-function-declaration): Update description.
* opts.c (common_handle_option): Move handling of -Werror=* to...
(enable_warning_as_error): ...here.
* opts.h (enable_warning_as_error): Declare.
* c-decl.c (implicit_decl_warning): Unless
-Wno-implicit-function-declaration is given, emit a pedwarn if
-std=c99 or emit a warning if -Wimplicit-function-declaration.
* c.opt (Wimplicit-function-declaration): Replace
mesg_implicit_function_declaration with
warn_implicit_function_declaration.
* c-opts.c (c_common_handle_option):
-Werror-implicit-function-declaration is exactly equal as
-Werror=implicit-function-declaration.
(set_Wimplicit): Replace mesg_implicit_function_declaration with
warn_implicit_function_declaration.
(c_common_post_options): -Wimplict-function-declaration is enabled
by default by -std=c99, otherwise is disabled by default.
* c-objc-common.c (c_objc_common_init): Remove flawed logic.
testsuite/
* gcc.dg/Wimplicit-function-declaration-c89.c: New.
* gcc.dg/Wimplicit-function-declaration-c89-default.c: New.
* gcc.dg/Wimplicit-function-declaration-c89-pedantic.c: New.
* gcc.dg/Wimplicit-function-declaration-c99.c: New.
* gcc.dg/Wimplicit-function-declaration-c99-pedantic.c: New.
* gcc.dg/Werror-implicit-function-declaration.c: New.
Added:
trunk/gcc/testsuite/gcc.dg/Werror-implicit-function-declaration.c
trunk/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89-default.c
trunk/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89-pedantic.c
trunk/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c89.c
trunk/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c99-pedantic.c
trunk/gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c99.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-decl.c
trunk/gcc/c-objc-common.c
trunk/gcc/c-opts.c
trunk/gcc/c.opt
trunk/gcc/doc/invoke.texi
trunk/gcc/opts.c
trunk/gcc/opts.h
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/26494] -pedantic-errors can be overridden by -W*
2006-02-28 11:35 [Bug c/26494] New: -pedantic-errors can be overridden by -W* fn_x at hotmail dot com
` (8 preceding siblings ...)
2007-02-15 22:31 ` manu at gcc dot gnu dot org
@ 2007-02-15 22:34 ` manu at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-02-15 22:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from manu at gcc dot gnu dot org 2007-02-15 22:33 -------
Fixed in GCC 4.3
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26494
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-02-15 22:34 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-28 11:35 [Bug c/26494] New: -pedantic-errors can be overridden by -W* fn_x at hotmail dot com
2006-02-28 13:11 ` [Bug c/26494] " pinskia at gcc dot gnu dot org
2007-01-22 23:48 ` manu at gcc dot gnu dot org
2007-01-23 0:05 ` truedfx at gentoo dot org
2007-01-23 0:08 ` truedfx at gentoo dot org
2007-01-23 0:10 ` manu at gcc dot gnu dot org
2007-01-23 0:23 ` truedfx at gentoo dot org
2007-01-24 19:10 ` patchapp at dberlin dot org
2007-01-25 9:55 ` patchapp at dberlin dot org
2007-02-15 22:31 ` manu at gcc dot gnu dot org
2007-02-15 22:34 ` manu at gcc dot gnu dot 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).