From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29277 invoked by alias); 23 Aug 2004 16:48:30 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 29254 invoked from network); 23 Aug 2004 16:48:28 -0000 Received: from unknown (HELO zcars04f.nortelnetworks.com) (47.129.242.57) by sourceware.org with SMTP; 23 Aug 2004 16:48:28 -0000 Received: from zcard303.ca.nortel.com (zcard303.ca.nortel.com [47.129.242.59]) by zcars04f.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id i7NGmMC05552; Mon, 23 Aug 2004 12:48:22 -0400 (EDT) Received: from americasm01.nt.com (acart502.ca.nortel.com [47.130.17.159]) by zcard303.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id NALTGQWC; Mon, 23 Aug 2004 12:48:21 -0400 Message-ID: <412A1FC4.66A6CAA7@americasm01.nt.com> Date: Tue, 24 Aug 2004 05:23:00 -0000 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: "Iain Woolf" Organization: Nortel Networks MIME-Version: 1.0 To: jiayu 33576 CC: gcc-help@gcc.gnu.org Subject: Re: Two additional errors of GCC 2.96 References: <6e9e1201.12016e9e@huawei.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00216.txt.bz2 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 #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