Bug 28433 - objc_write_type fails for floats and doubles
Summary: objc_write_type fails for floats and doubles
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: libobjc (show other bugs)
Version: 3.3.5
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-19 11:07 UTC by Issac Trotts
Modified: 2010-09-08 18:16 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-07-19 11:12:26


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Issac Trotts 2006-07-19 11:07:56 UTC
ijtrotts@localhost:/tmp$ gcc objc_float_bug.m  -lobjc
ijtrotts@localhost:/tmp$ ./a.out
objc_write_type: cannot parse typespec: f
Aborted
ijtrotts@localhost:/tmp$ cat objc_float_bug.m
#include <objc/Object.h>

int main()
{
    float x=1.25;
    TypedStream* stream =
        objc_open_typed_stream_for_file("foo",OBJC_WRITEONLY);
    objc_write_type(stream, @encode(float), &x);
    objc_close_typed_stream(stream);
    return 0;
}

ijtrotts@localhost:/tmp$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/specs
Configured with: ../gcc-3.3.5/configure --enable-languages=c,c++,f77,objc --enable-objc-gc
Thread model: posix
gcc version 3.3.5
Comment 1 Andrew Pinski 2006-07-19 11:12:26 UTC
Right, it was never did.
Comment 2 Nicola Pero 2010-09-08 18:16:42 UTC
objc/typedstream.h has been deprecated in 4.6.0 and will be removed in the next GCC release.  There is no point in trying to fix a bug in it.

Please use gnustep-base or some other Foundation-type library if you need serialization/deserialization of objects!  gnustep-base has wonderful support for that, in many different shapes and forms! :-)

Thanks