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]

C++ compiler problems


> Hi,
> 
> I've found a few errors in the egcs version of gcc.
> 
> The following code gives me errors:
> 
> // Class fg_Cockpit          This class is a holder for the heads up
> display
> //                          and is initialized with a
> class fg_Cockpit  {
>   private:
>     int  Code;
>     int  Status;
> 
>   public:
>     fg_Cockpit   () : Code(1), Status(0) {};
>     int   code  ( void ) { return Code; }
>     int   status( void ) { return Status; }
> };
> 
> c++ -DHAVE_CONFIG_H -I. -I. -I../../src/Include -I../.. -I../../src 
> -I/usr/local/FlightGear/include -I/usr/local/include  -g -O2 -c
> cockpit.cxx
> cockpit.hxx:43: declaration does not declare anything
> cockpit.hxx:43: extraneous `int' ignored
> In file included from cockpit.cxx:53:
> cockpit.hxx:46: parse error before ';' token
> In file included from cockpit.cxx:53:
> cockpit.hxx:48: parse error before ';' token
> make[2]: *** [cockpit.o] Error 1
> 
> Changing Code to xCode and Status to xStats solves the problems!!
> 
> Furthermore I had to make the following patch for the same project to
> get it past the compiler. It seems egcs strugles with a variable name A0
> !!!
> 
> 
> diff -Nuar FlightGear.orig/src/WeatherCM/linintp2.inl
> FlightGear/src/WeatherCM/linintp2.inl
> --- FlightGear.orig/src/WeatherCM/linintp2.inl  Fri Jul 14 16:08:48 2000
> +++ FlightGear/src/WeatherCM/linintp2.inl       Tue Aug 29 09:07:50 2000
> @@ -101,17 +101,17 @@
>  void mgcLinInterp2D<T>::ComputeBarycenter (Vertex& v0, Vertex& v1,
> Vertex& v2,
>                                             Vertex& ver, double c[3])
>  {
> -    double A0 = v0.x-v2.x;
> -    double B0 = v0.y-v2.y;
> +    double A3 = v0.x-v2.x;
> +    double B3 = v0.y-v2.y;
>      double A1 = v1.x-v2.x;
>      double B1 = v1.y-v2.y;
>      double A2 = ver.x-v2.x;
>      double B2 = ver.y-v2.y;
> 
> -    double m00 = A0*A0+B0*B0;
> -    double m01 = A0*A1+B0*B1;
> +    double m00 = A3*A3+B3*B3;
> +    double m01 = A3*A1+B3*B1;
>      double m11 = A1*A1+B1*B1;
> -    double r0 = A2*A0+B2*B0;
> +    double r0 = A2*A3+B2*B3;
>      double r1 = A2*A1+B2*B1;
>      double det = m00*m11-m01*m01;
> 
> Regards,
> 
>   Erik Hofman
> 
> 
> BTW. I'm using the latest egcs snapshot.

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