[GEM-dev] gem2pdp

Mathieu Bouchard matju at artengine.ca
Thu Dec 22 18:20:56 CET 2005


On Wed, 21 Dec 2005, james tittle wrote:
> > pix_2pdp.cpp:137: error: jump to case label
> ...well, this is just a switch(), so maybe adding parentheses would help...?
> But, I tried it here with gcc 4.0.1, and get no errors/warnings at all:

This must be because your version of gcc does better dataflow analysis and
thus shrinks the scope of those variables, normally at the "}", up to the
last line where they are used, such that when switch() performs its goto
it doesn't really skip the initialization anymore. In other words, the new
GCC corrects the bug in the code by itself. As you can see, newer versions
of GCC aren't always more stringent, and in this case, Gcc4 is more slack.

The manual fix is to put braces after the "case:" until the "break;",
which is what the diff did (the one I posted in reply to my mail).

I used to use gcc 4.0.2 but I reverted to 3.3.5 because ltilib wouldn't
compile with gcc 4.0.2.

> here's my compile line:
> g++ -DPD -Os -funroll-loops -fomit-frame-pointer  -ffast-math -Wall -W
> -Wno-unused -Wno-parentheses -Wno-switch -DGEM2PDP_VERSION=\"0.7\" -g
> -I/Users/tigital/puredataDev/devel_0_39/pd/src -I. -I../pdp/include
> -I../../Gem/src -I/sw/include -o pix_2pdp.o -c pix_2pdp.cpp

Could you please explain why -Os instead of -O2 or -O3 ?? that's really 
puzzling me.

 _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montréal QC Canada




More information about the GEM-dev mailing list