clone 376616 -1
reassign 376616 gcc-snapshot 20060626-1
thanks

I can reproduce this bug with attached file (test.c):

% LD_LIBRARY_PATH=/usr/lib/gcc-snapshot/lib PATH=/usr/lib/gcc-snapshot/bin:$PATH
% export LD_LIBRARY_PATH
% gcc -c -W -Wall test.c
test.c: In function 'fun':
test.c:9: warning: statement with no effect

The code looks unusual but it is correct IMHO and I see no reason for
this warning, so I think it is bug in gcc itself.

4 липня 2006 о 00:50 +0200 Martin Michlmayr написав(-ла):
> Your package fails to build with GCC 4.2.  Version 4.2 has not been
> released yet but I'm building with a snapshot in order to find errors
> and give people an advance warning.  The bug below is likely in your
> package though and not because I'm using a snapshot of the compiler so
> please take a look at it.  You can reproduce this with the
> gcc-snapshot package.
> 
> 
> > Automatic build of systemtap_0.0.20060610-1 on usurper by sbuild/amd64 0.46
> ...
> > if gcc -D_GNU_SOURCE -DHAVE_CONFIG_H 
> > -DOBJDIR=\"/build/tbm/systemtap-0.0.20060610/build-tree/src/build-elfutils/libebl\"
> >  -I. -I../../../../build-tree/elfutils-0.121/libebl -I.. 
> > -I../../../../build-tree/elfutils-0.121/libebl 
> > -I../../../../build-tree/elfutils-0.121/libelf 
> > -I../../../../build-tree/elfutils-0.121/libdw 
> > -I../../../../build-tree/elfutils-0.121/lib -I..   -fpic -Wall -Wshadow 
> > -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 -g -O2 -MT eblobjnote.o -MD 
> > -MP -MF ".deps/eblobjnote.Tpo" -c -o eblobjnote.o 
> > ../../../../build-tree/elfutils-0.121/libebl/eblobjnote.c; \
> >     then mv -f ".deps/eblobjnote.Tpo" ".deps/eblobjnote.Po"; else rm -f 
> > ".deps/eblobjnote.Tpo"; exit 1; fi
> > cc1: warnings being treated as errors
> > ../../../../build-tree/elfutils-0.121/libebl/eblobjnote.c: In function 
> > 'ebl_object_note':
> > ../../../../build-tree/elfutils-0.121/libebl/eblobjnote.c:80: warning: 
> > statement with no effect
> > make[4]: *** [eblobjnote.o] Error 1
> > make[4]: Leaving directory 
> > `/build/tbm/systemtap-0.0.20060610/build-tree/src/build-elfutils/libebl'
> > make[3]: *** [all-recursive] Error 1
> 

-- 
Eugeniy Meshcheryakov
#include <inttypes.h>

void * fun(char *desc, int descsz)
{
	struct
	{
		uint32_t os;
		uint32_t version[descsz / 4 - 1];
	} *tag = (__typeof (tag)) desc;

	return tag;
}

Attachment: signature.asc
Description: Digital signature

Reply via email to