From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24602 invoked by alias); 15 Mar 2010 22:03:20 -0000 Received: (qmail 24590 invoked by uid 22791); 15 Mar 2010 22:03:19 -0000 X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-qy0-f177.google.com (HELO mail-qy0-f177.google.com) (209.85.221.177) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Mar 2010 22:03:15 +0000 Received: by qyk7 with SMTP id 7so2735134qyk.21 for ; Mon, 15 Mar 2010 15:03:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.59.134 with SMTP id l6mr1743401qah.224.1268690593634; Mon, 15 Mar 2010 15:03:13 -0700 (PDT) Date: Tue, 16 Mar 2010 01:28:00 -0000 Message-ID: Subject: fixed-point support in c++ From: "Sean D'Epagnier" To: gcc@gcc.gnu.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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: 2010-03/txt/msg00162.txt.bz2 It looks like my patches for avr target to get native fixed-point support may be included soon. I realized that many users use avr-g++ for their projects, and I cannot get the fixed point types working in c++. The question is generic and should apply to all targets. Compiling a simple test program: int main() { _Accum x; } Works fine in c, but under c++ I get: test.cpp:5: error: =91_Accum=92 was not declared in this scope So I modified c-common.c: Index: c-common.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- c-common.c (revision 157409) +++ c-common.c (working copy) @@ -561,9 +561,9 @@ { "_Decimal32", RID_DFLOAT32, D_CONLY | D_EXT }, { "_Decimal64", RID_DFLOAT64, D_CONLY | D_EXT }, { "_Decimal128", RID_DFLOAT128, D_CONLY | D_EXT }, - { "_Fract", RID_FRACT, D_CONLY | D_EXT }, - { "_Accum", RID_ACCUM, D_CONLY | D_EXT }, - { "_Sat", RID_SAT, D_CONLY | D_EXT }, + { "_Fract", RID_FRACT, D_EXT }, + { "_Accum", RID_ACCUM, D_EXT }, + { "_Sat", RID_SAT, D_EXT }, { "__FUNCTION__", RID_FUNCTION_NAME, 0 }, { "__PRETTY_FUNCTION__", RID_PRETTY_FUNCTION_NAME, 0 }, { "__alignof", RID_ALIGNOF, 0 }, Now the error is: test.cpp:5:4: error: expected primary-expression before =91_Accum=92 Does anyone have clues as to the problem? I have tried a few other things with no success. Thanks Sean