This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Apparent GCC 2.95.2 bug(s): -std documentation; using -std= with -ansi
- To: bug-gcc at gnu dot org
- Subject: Apparent GCC 2.95.2 bug(s): -std documentation; using -std= with -ansi
- From: pfaffben at msu dot edu (Ben Pfaff)
- Date: Sun, 18 Jun 2000 01:29:50 -0400
- Reply-to: pfaffben at msu dot edu
There seem to actually be two bugs that I've found. First, the
Info documentation, in node "C Dialect Options", says that
-fstd=... is a gcc option, but the actual option appears to be
-std=...; note lack of `f'.
Second, gcc doesn't seem to like -std=ID where ID is not a gnu*
option to be used along with -ansi. Maybe these options aren't
supposed to be used together, but in that case I think that the
error message should be better:
blp:~/tmp(0)$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000313 (Debian GNU/Linux)
blp:~/tmp(0)$ cat > test.c
int main (void) { return 0; }
blp:~/tmp(1)$ gcc -fstd=iso9899:199x test.c
cc1: Invalid option `-fstd=iso9899:199x'
blp:~/tmp(1)$ gcc -std=iso9899:199x -ansi test.c
test.c:0: malformed option `-D __STRICT_ANSI__-trigraphs'
blp:~/tmp(1)$ gcc -std=iso9899:199x test.c
blp:~/tmp(0)$
I think that the problem is probably related to code like lines
616-617 from gcc.c in 2.95.2:
%{ansi|std=*:%{!std=gnu*:-trigraphs -D__STRICT_ANSI__}}\
%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
but I'm sure you're more of an expert on this than I am ;-)
This is with the Debian packaged version:
blp:~/tmp(1)$ dpkg -s gcc
Package: gcc
Status: install ok installed
Priority: standard
Section: devel
Installed-Size: 2258
Maintainer: Debian GCC maintainers <gcc@packages.debian.org>
Source: gcc (2.95.2-12)
Version: 1:2.95.2-12
Replaces: egcc
Provides: egcc, c-compiler
Depends: libc6 (>= 2.1.2), cpp (>= 1:2.95.2-10), cpp (<< 1:2.95.3), binutils (>= 2.9.5.0.12)
Recommends: libc-dev
Suggests: gcc-doc (>= 1:2.95.2-10)
Conflicts: libc5-dev, egcc (<< 2.91.63-1.1)
Description: The GNU C compiler.
This is the GNU C compiler, a fairly portable optimizing compiler which
supports multiple languages. This package includes support for C, C++,
and Objective C.
blp:~/tmp(0)$
Thanks,
Ben.
--
"A computer is a state machine.
Threads are for people who cant program state machines."
--Alan Cox