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.


Andrew Lunn <andrew@lunn.ch> writes:
> On Thu, Jan 25, 2007 at 01:21:23PM +0300, 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:
>> >
>> > lunn@londo:~/eCos/work$ make -s
>> > headers finished
>> > /home/lunn/eCos/anoncvs-clean/packages/language/c/libc/stdio/current/src/common/vsnprintf.cxx: In function 'int vsnprintf(char*, size_t, const char*, char*)':
>> > /home/lunn/eCos/anoncvs-clean/packages/language/c/libc/stdio/current/src/common/vsnprintf.cxx:106: warning: dereferencing type-punned pointer will break strict-aliasing rules
>> > build finished
>> >
>> > Could you try to fix this please. Once i have a fix for this i will
>> > commit your change.
>> 
>> I don't think it's my patch problem, as initial vsnprintf implementation
>> had almost exactly the same line:
>> 
>>     rc = vfnprintf( (FILE *)&my_stream, size, format, arg );
>> 
>> and thus should have been triggering the same warning.
>
> Humm, i checked this before i posted. And i checked again:

Well, this is strange... I do know at least two ways to shut-up this gcc
warning, but I'd prefer to first understand what is actually going on
here. I think I'll need to try to reproduce it here, though it will
take me some time.

For now, could you please confirm that the line 106 in vsnprintf.cxx
indeed reads:

    return vfnprintf( (FILE *)&stream, size, format, arg );

in your sources after my patch is applied?

Thanks.

-- Sergei Organov.


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