[GCC-XML]Default values

Tony Cook tony at bci.gb.com
Tue Oct 21 05:35:37 EDT 2003


Sorry to bring this one up again! I do have a suggestion that might
help. Instead of emitting something like:

default="0x00000000000000000080ff3f0000000000000000" or
init="0x00000000000000000080ff3f0000000000000000"

would it be possible to emit these float/double values as
exponent/mantissa value pairs? In the current form I am at a loss to
know what the hex value is trying to represent (presumably a hex dump of
some combined mantissa/exponent word known only to gcc) and thus
translating it into the syntax of another language is - well - awkward! 

If instead I could see: 

mantissa="12345" exponent="-4"

I can easily translate this into whatever alternate form "1.2345" or
"12345E-4" etc needed in my target language. This is the only glitch in
GCC_XML that is causing me grief translating C/C++ interfaces into stuff
like VB6 and COM interfaces.

Would this be possible to do? 

Cheers, Tony  

PS Nicodemus - what was the workaround BTW


>Thanks for the suggestion Brad! I found a way to workaround this 
>limitation in my own code thought.

>Thanks again,
>Nicodemus.

>Brad King wrote:

>>>void foo(double x=0.45, drange r = drange(0.5, 4.5));
>>>    
>>>
>>[snip]
>>  
>>
>>>Is possible to improve this part of the output of GCCXML? Any
>>>suggestions on how to extract the correct values would be welcomed
too.
>>>    
>>>
>>
>>This limitation is because function body dumping is not supported.
>>Default values can be almost arbitrary expressions.  Dumping of
>>expressions is not supported.  It can be added, but I have no time to
do
>>it.  Contact me privately if you want help adding it yourself.
>>
>>You might be able to use the file/source line number from the dump to
>>extract the default expression with a relatively simple parser.
>>
>>-Brad
>>
>>_______________________________________________
>>gccxml mailing list
>>gccxml at www.gccxml.org
>>http://www.gccxml.org/mailman/listinfo/gccxml
>>
>>.






More information about the gccxml mailing list