This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
other/1502: Nonexistent -W options not diagnosed
- To: gcc-gnats at gcc dot gnu dot org
- Subject: other/1502: Nonexistent -W options not diagnosed
- From: Joseph Myers <jsm28 at cam dot ac dot uk>
- Date: Fri, 22 Dec 2000 20:37:29 +0000
- Cc: jsm28 at cam dot ac dot uk
>Number: 1502
>Category: other
>Synopsis: Nonexistent -W options not diagnosed
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: accepts-illegal
>Submitter-Id: net
>Arrival-Date: Fri Dec 22 12:46:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Joseph S. Myers
>Release: 2.97 20001222 (experimental)
>Organization:
none
>Environment:
System: Linux decomino 2.2.18 #1 Thu Dec 14 19:30:45 UTC 2000 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-cvs/configure --prefix=/opt/gcc/snapshot --disable-shared --enable-threads=posix --with-system-zlib
>Description:
GCC, for both C and C++, fails to give any diagnostic when a
non-existent -W option is used.
GCC 2.95.2 gave proper diagnostics for such nonsense options.
>How-To-Repeat:
gcc -c -Wnonexistent-option t.c
gcc -c -Wnonexistent-option t.C
(for any t.c, t.C, e.g. empty).
>Fix:
I suspect cpp_handle_option is to blame for returning 1 here for any
option starting -W, whether recognised or not. This makes
c_decode_option / lang_decode_option return 1 even if they didn't
understand and consume any arguments.
>Release-Note:
>Audit-Trail:
>Unformatted: