From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5227 invoked by alias); 26 Jun 2009 14:44:51 -0000 Received: (qmail 5216 invoked by uid 22791); 26 Jun 2009 14:44:49 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Jun 2009 14:44:43 +0000 Received: from zps77.corp.google.com (zps77.corp.google.com [172.25.146.77]) by smtp-out.google.com with ESMTP id n5QEidH6004843 for ; Fri, 26 Jun 2009 15:44:39 +0100 Received: from fg-out-1718.google.com (fgbl27.prod.google.com [10.86.88.27]) by zps77.corp.google.com with ESMTP id n5QEiUJ6014238 for ; Fri, 26 Jun 2009 07:44:36 -0700 Received: by fg-out-1718.google.com with SMTP id l27so52012fgb.7 for ; Fri, 26 Jun 2009 07:44:36 -0700 (PDT) Received: by 10.86.93.17 with SMTP id q17mr3784293fgb.75.1246027476237; Fri, 26 Jun 2009 07:44:36 -0700 (PDT) Received: from localhost.localdomain.google.com ([67.218.106.187]) by mx.google.com with ESMTPS id 3sm623111fge.12.2009.06.26.07.44.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 26 Jun 2009 07:44:35 -0700 (PDT) To: laurent@guerby.net Cc: Eric Botcazou , Richard Guenther , gcc@gcc.gnu.org Subject: Re: Phase 1 of gcc-in-cxx now complete (Ada) References: <1245966606.4922.217.camel@localhost> <84fc9c000906251516n3a74abe2hcf888f940fccce79@mail.gmail.com> <1246015098.4922.307.camel@localhost> From: Ian Lance Taylor Date: Fri, 26 Jun 2009 14:48:00 -0000 In-Reply-To: <1246015098.4922.307.camel@localhost> (Laurent GUERBY's message of "Fri\, 26 Jun 2009 13\:18\:18 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00604.txt.bz2 Laurent GUERBY writes: > What is the way forward: fixing in some way the Ada Makefile? Or doing > search and replace in case of keyword/identifier conflict? If > search/replace, do AdaCore people have an opinion on the best way > to proceed to avoid maintenance issues in the various trees? (eg: commit > of those trivial patches directly on trunk or on AdaCore tree then > trunk?) I can't answer that--it's up to the Ada maintainers. > I don't know much about C++/C compatibilities and the way to solve > them choosen on the gcc-in-cxx branch, is there a document somewhere? No. In some cases the warnings given by -Wc++-compat will be more helpful. > Next error is related to enum in for loop: > > g++ -c -g -g -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -fno-common -DHAVE_CONFIG_H -I.. -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I/opt/cfarm/gmp-4.2.4//include -I/opt/cfarm/mpfr-2.4.1//include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber ../../gcc/gcc/ada/gcc-interface/misc.c -o ada/misc.o > ../../gcc/gcc/ada/gcc-interface/misc.c: In function 'void enumerate_modes(void (*)(int, int, int, int, int, int, unsigned int))': > ../../gcc/gcc/ada/gcc-interface/misc.c:734: error: invalid conversion from 'int' to 'machine_mode' > ../../gcc/gcc/ada/gcc-interface/misc.c:734: error: no 'operator++(int)' declared for postfix '++', trying prefix operator instead > ../../gcc/gcc/ada/gcc-interface/misc.c:734: error: no match for 'operator++' in '++i' In the C/C++ common subset you can not write loops in which the index variable has enum type. Loops like these must be written as something along the lines of int iloop; for (iloop = 0; iloop < NUM_MACHINE_MODES; iloop++) { enum machine_mode i = (enum machine_mode) iloop; ... } > Another kind of error on struct declarations: > > << > g++ -c -g -g -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -fno-common -DHAVE_CONFIG_H -I.. -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I/opt/cfarm/gmp-4.2.4//include -I/opt/cfarm/mpfr-2.4.1//include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber ../../gcc/gcc/ada/gcc-interface/trans.c -o ada/trans.o > ../../gcc/gcc/ada/gcc-interface/trans.c:111: error: conflicting declaration 'typedef struct parm_attr* parm_attr' > ../../gcc/gcc/ada/gcc-interface/trans.c:103: error: 'struct parm_attr' has a previous declaration as 'struct parm_attr' In C++, if a typedef and a struct tag have the same name, they must name the same type. I've been addressing these issues by consistently renaming the struct with a "_d" suffix. See, e.g., struct alias_set_entry_d and alias_set_entry in alias.c. > Last error is on void* arithmetic: > > << > g++ -c -g -g -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -fno-common -Wno-error -DHAVE_CONFIG_H -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I/opt/cfarm/gmp-4.2.4//include -I/opt/cfarm/mpfr-2.4.1//include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber \ > -I. -Iada -I../../gcc/gcc -I../../gcc/gcc/ada -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I/opt/cfarm/gmp-4.2.4//include -I/opt/cfarm/mpfr-2.4.1//include -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber -fno-omit-frame-pointer ../../gcc/gcc/ada/tracebak.c -o ada/tracebak.o > In file included from ../../gcc/gcc/ada/tracebak.c:396: > ../../gcc/gcc/ada/tb-gcc.c: In function '_Unwind_Reason_Code trace_callback(_Unwind_Context*, uw_data_t*)': > ../../gcc/gcc/ada/tb-gcc.c:86: error: pointer of type 'void *' used in arithmetic Here pc has type "void *", but the code computes "pc + PC_ADJUST". This is not permitted in C either, and is actually a gcc extension. The fix is to change pc to "char *". Ian