This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Circular references?
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Circular references?
- From: Ramon Ferrer i Cancho <ramon at complex dot upc dot es>
- Date: Wed, 30 Aug 2000 22:15:53 +0200
- Organization: Complex Systems Research Group
GCC VERSION
Reading specs from
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
INPUT FILE (t.cpp)
#include <fstream.h>
const int x=x;
int main()
{
cout << x << endl;
return 0;
}
COMMAND ARGUMENTS
make t.cpp (equivalent to g++ t.cpp -o t)
TYPE OF MACHINE
SuSE Linux 6.2 (i386) kernel 2.2.10 (PENTIUM II-256 Mb RAM)
OPERANDS TO CONFIGURE
- (I did not installed the compiler but I have been told that the
installation procedure was typical)
NO MODIFICATIONS ON THE COMPILER SOURCE
DESCRIPTION OF THE "INCORRECT" BEHAVIOUR
The program output is 0 (on my computer) but the constant x has never
been given a value of 0. The compiler should have warned about
the circular reference. The same happens when
const int x=x;
is changed by
int x=x;
--
Ramon Ferrer i Cancho
Complex Systems Research Group
http://complex.upc.es/~ramon
ramon@complex.upc.es
voice: (34) 93 401 70 56 / fax: (34) 93 401 71 00
Deparment of Physics, Universitat Politècnica de Catalunya (UPC)
Campus Nord, Mòdul B5, 2on pis, Despatx B5202
O8034 Barcelona, SPAIN