This patch fixes the following compiler error with MinGW GCC 4.4.0/4.5.0:
g++ -c -D DEBUGLEVEL=0 -I ../src/mingw-get/src -I ../src/mingw-get/src/pkginfo -I ../src/mingw-get/tinyxml -g -O2 -o tarproc.o ../src/mingw-get/src/tarproc.cpp
../src/mingw-get/src/tarproc.cpp: In member function 'virtual int pkgTarArchiveProcessor::Process()':
../src/mingw-get/src/tarproc.cpp:256: error: jump to case label
../src/mingw-get/src/tarproc.cpp:247: error: crosses initialization of 'char* p'
Avoid a jump over initialization issue
Thanks Cesar,
GCC-3.4.5 doesn't seem to see this as an error. Would simply enclosing the offending initialisation, and the following `while' loop in braces fix it for GCC-4.x?
Either way, I have a significant tarproc.cpp change set almost ready for check-in, so I'll address this at the same time.
Fix it with braces
> Would simply enclosing
> the offending initialisation, and the following `while' loop in braces fix
> it for GCC-4.x?
Indeed it does.
> Either way, I have a significant tarproc.cpp change set almost ready for
> check-in, so I'll address this at the same time.
Sure. For reference, I attach a new patch with the above change.
Thanks Cesar.
Since it appears to solve the problem satisfactorily, I prefer the solution using braces -- it localises the pointer declaration and usage to the minimum possible scope. I've included the necessary change in my own patch set, (commit to CVS dated 2010-04-04). I believe this resolves the issue; please reopen, if the problem persists.
The issue is indeed solved, thanks!
Regards,
Cesar