Hi, On Mon, Jan 02, 2006 at 10:45:03PM +0000, Glyn Kennington wrote:
Jorge Arellano Cid wrote:
Hi Glyn,
On Mon, Jan 02, 2006 at 09:36:05PM +0000, Glyn Kennington wrote:
[...] downloads.cc: In function 'void read_req_cb(int, void*)': downloads.cc:915: error: jump to label 'end' downloads.cc:901: error: from here downloads.cc:907: error: crosses initialization of 'DLAction action' [...]
Putting the DlAction block within its own scope solves the problem, but I'm sure it's not as simple as that.
Really weird. What compiler are you using?
gcc 4.0.3, in Debian testing. I get the same result with gcc 3.3.6.
I'm using gcc version 3.4.5. No problem with this one.
From a distance look like the compiler gets confused trying to catch uninitialized variables.
There's an entry about it in the g++ FAQ:
http://theory.uwinnipeg.ca/gnu/libg++/g++FAQ_42.html
The draft standard does not allow a goto or a jump to a case label to skip over an initialization of a variable or a class object.
I'm quite surprised that nobody else has got this error, though.
Thanks for the information. I commited a patch to avoid this problem. -- Cheers Jorge.-