On Thu, Jan 25, 2007 at 01:21:23PM +0300, Sergei Organov wrote:
> Andrew Lunn <[EMAIL PROTECTED]> 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:
> >
> > [EMAIL PROTECTED]:~/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:

[EMAIL PROTECTED]:~/eCos/anoncvs-clean/packages$ cvs up language/c/libc/stdio

So this shows i have a clean version of stdio.

[EMAIL PROTECTED]:~/eCos/anoncvs-clean/packages$ cd ~/eCos/work/
[EMAIL PROTECTED]:~/eCos/work$ rm -fr *
[EMAIL PROTECTED]:~/eCos/work$ ecosconfig new linux
U CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT, new inferred value 0
U CYGNUM_LIBC_MAIN_DEFAULT_STACK_SIZE, new inferred value 16384
[EMAIL PROTECTED]:~/eCos/work$ ecosconfig tree
[EMAIL PROTECTED]:~/eCos/work$ make -s
headers finished
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx: In function 
'int diag_sprintf(char*, const char*, ...)':
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx:535: warning: 
dereferencing type-punned pointer will break strict-aliasing rules
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx: In function 
'int diag_snprintf(char*, size_t, const char*, ...)':
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx:551: warning: 
dereferencing type-punned pointer will break strict-aliasing rules
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx: In function 
'int diag_vsprintf(char*, const char*, char*)':
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx:565: warning: 
dereferencing type-punned pointer will break strict-aliasing rules
/home/lunn/eCos/anoncvs-clean/packages/kernel/current/src/sync/mbox.cxx: In 
member function 'void* Cyg_Mbox::get()':
/home/lunn/eCos/anoncvs-clean/packages/kernel/current/src/sync/mbox.cxx:114: 
warning: 'p' is used uninitialized in this function
cc1: warning: command line option "-Woverloaded-virtual" is valid for 
C++/ObjC++ but not for C
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not 
for C
build finished

There are no warnings from stdio files.

[EMAIL PROTECTED]:~/eCos/work$ cd ~/eCos/anoncvs-clean/packages/
[EMAIL PROTECTED]:~/eCos/anoncvs-clean/packages$ patch -p1 < 
~/ecos_sprintf_speedup.patch 
patching file language/c/libc/stdio/current/ChangeLog
patching file language/c/libc/stdio/current/include/stream.hxx
patching file language/c/libc/stdio/current/src/common/stream.cxx
patching file language/c/libc/stdio/current/src/common/vsnprintf.cxx
patching file language/c/libc/stdio/current/src/output/vfnprintf.cxx
[EMAIL PROTECTED]:~/eCos/anoncvs-clean/packages$ cd ~/eCos/work/
[EMAIL PROTECTED]:~/eCos/work$ rm -fr *
[EMAIL PROTECTED]:~/eCos/work$ ecosconfig new linux 
U CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT, new inferred value 0
U CYGNUM_LIBC_MAIN_DEFAULT_STACK_SIZE, new inferred value 16384
[EMAIL PROTECTED]:~/eCos/work$ ecosconfig tree
[EMAIL PROTECTED]:~/eCos/work$ make -s
headers finished
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx: In function 
'int diag_sprintf(char*, const char*, ...)':
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx:535: warning: 
dereferencing type-punned pointer will break strict-aliasing rules
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx: In function 
'int diag_snprintf(char*, size_t, const char*, ...)':
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx:551: warning: 
dereferencing type-punned pointer will break strict-aliasing rules
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx: In function 
'int diag_vsprintf(char*, const char*, char*)':
/home/lunn/eCos/anoncvs-clean/packages/infra/current/src/diag.cxx:565: warning: 
dereferencing type-punned pointer will break strict-aliasing rules
/home/lunn/eCos/anoncvs-clean/packages/kernel/current/src/sync/mbox.cxx: In 
member function 'void* Cyg_Mbox::get()':
/home/lunn/eCos/anoncvs-clean/packages/kernel/current/src/sync/mbox.cxx:114: 
warning: 'p' is used uninitialized in this function
/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
cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++
 but not for C
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not fo
r C
build finished

Now there is a warning....

    Andrew

Reply via email to