public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* fixed-point support in c++
@ 2010-03-16  1:28 Sean D'Epagnier
  2010-03-16  1:32 ` Dave Korn
  0 siblings, 1 reply; 6+ messages in thread
From: Sean D'Epagnier @ 2010-03-16  1:28 UTC (permalink / raw)
  To: gcc

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: ‘_Accum’ was not declared in this scope

So I modified c-common.c:

Index: c-common.c
===================================================================
--- 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 ‘_Accum’

Does anyone have clues as to the problem?  I have tried a few other
things with no success.


Thanks
Sean

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-04-13 15:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-16  1:28 fixed-point support in c++ Sean D'Epagnier
2010-03-16  1:32 ` Dave Korn
2010-03-16 10:12   ` Sean D'Epagnier
2010-03-19 13:04     ` Dave Korn
2010-04-13 15:34       ` Sean D'Epagnier
2010-04-13 16:33         ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).