Two additional errors of GCC 2.96

Iain Woolf iainw@nortelnetworks.com
Tue Aug 24 05:23:00 GMT 2004


jiayu 33576 wrote:
> 
> The problem we meeted last have not solved. The code is so large and I
> am trying to simplify it. We meeted two additional problems.All the
> errors took place when we were compiling C or C++ using Tornado 2.2
> for MIPS. The compiler is GCC 2.96 suppiled by WindRiver. Please help
> us! Thanks a lot
> 
> 1. The compiler can't compare an element of enum and an unsigned short
> variable
> Error information:
> ../../../src/momu/src/mnt/cmnt_int.cpp:3736: Internal compiler error
> in `copy_to_mode_reg', at explow.c:710
> 
> cmnt_int.cpp:3736:
>     if ( LID_OMU != g_uwLogicBoardType )   /* Error occurs here */
>     {
>         vos_printf("error");
>     }
> 
> The related defination:
> typedef enum
> {
>     LID_OMU = 0x0100,  /*256 MOMU,FOMU*/
>     ...
> }
> VOS_UINT16         g_uwLogicalBoardNo = VOS_NULL_WORD;
> typedef unsigned short VOS_UINT16;
> #define VOS_NULL_WORD 0xFFFF

You say the error occurs on the line with g_uwLogicBoardType, but you
supply a definition for g_uwLogicalBoardNo.

I have the same compiler and tried the following sample code. It
compiled fine

//------------------------------------------------------

#include <stdio.h>

#define VOS_NULL_WORD 0xFFFF
typedef unsigned short VOS_UINT16; 
VOS_UINT16         g_uwLogicalBoardNo = VOS_NULL_WORD; 

typedef enum 
{ 
    LID_OMU = 0x0100,  /*256 MOMU,FOMU*/ 
}; 

void somefn(void)
{
   if ( LID_OMU != g_uwLogicalBoardNo )   /* No error here */ 
   { 
      printf("error"); 
   } 
}

//------------------------------------------------------


> 2. The compiler can't assign by structure
> ../../../src/momu/src/mnt/cmnt_int.cpp:3751: Internal compiler error
> in `move_by_pieces', at expr.c:1505

I don't see why it would give you an internal compiler error, but
gcc2.96 (Windriver's compiler based on GNU's gcc2.95) is more ANSI
compliant than the previous version of the Windriver compiler (gcc2.72).

One of the restrictions is not being able to assign one structure to
another. Presumably this is why you have a function called
"move_by_pieces". You didn't provide the definition for SYS_T, but I'm
guessing this is a structure itself.

Cheers,

 Iain



More information about the Gcc-help mailing list