This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Speed-up sprintf() family of functions.


Jonathan Larmour <jifl@eCosCentric.com> writes:

> Sergei Organov wrote:
>> Andrew Lunn <andrew@lunn.ch> writes:
>>
>>>>The updated patch is attached.
>>>>
>>>
>>>Hi Sergei
>>>
>>>Im looking at the patch now ready for including into anoncvs. I have
>>>one minor problem which needs fixing. When i compile for the linux
>>>target with gcc 4.1.2 i get a warning:
>>
>>
>> There doesn't seem to be a way to actually fix this warning, only some
>> hacks to shut-up GCC. What hack in particular do you use to prevent this
>> kind of warnings in other places of eCos where it occurs?
>
> There is a correct solution. Create a one-off union type, containing a
> FILE and a Cyg_VsnprintfStream and assign the stream to the
> Cyg_VsnprintfStream, and then take the address of the FILE
> member. Alignment constraints are dealt with by the fact that streams
> are created with the correct alignment - but GCC doesn't know that.

In my previous answer I forgot to mention another correct solution to
the problem, -- compiling eCos with -fno-strict-aliasing.

So which one should we finally choose?

-- Sergei Organov.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]