This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Circular references?


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]