xinxinlx / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

missing break after case statement in opj_dwt_decode_real #274

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
            switch(j) {
            case 3: aj[k+w*2] = h.wavelet[k].f[2];
            case 2: aj[k+w  ] = h.wavelet[k].f[1];
            case 1: aj[k    ] = h.wavelet[k].f[0];
            }

Original issue reported on code.google.com by boxe...@gmail.com on 5 Mar 2014 at 3:25

GoogleCodeExporter commented 9 years ago
I do not see why ?

Original comment by mathieu.malaterre on 7 Mar 2014 at 10:09

GoogleCodeExporter commented 9 years ago
It forces the code to check all three case statements without a break.
Also, looks like perhaps it was forgotten. 
Best practice is to add a break.

Original comment by boxe...@gmail.com on 7 Mar 2014 at 1:14

GoogleCodeExporter commented 9 years ago
Please either:
- provide a test case to understand what is wrong with this *valid* code
- or point to the section in part1 you think is incorrect.

From here, it looks as if you are reporting some kind of warning from your 
compiler.

Marking as wontfix for now.

Original comment by mathieu.malaterre on 7 Mar 2014 at 2:29

GoogleCodeExporter commented 9 years ago
Hi Mathieu,
IMHO, the less warnings the better. After more than, say 20 compiler warnings,
one tends to not look too carefully at them, and one might miss an actual bug.
Aaron

Original comment by boxe...@gmail.com on 7 Mar 2014 at 3:52

GoogleCodeExporter commented 9 years ago
All 20 OS (Win/Lin/Mac) & Compilers (clang, gcc, VS) configurations are here: 
http://my.cdash.org/index.php?project=OPENJPEG

Where do you see this warning ?

Original comment by mathieu.malaterre on 7 Mar 2014 at 4:02

GoogleCodeExporter commented 9 years ago
I am using Eclipse CDT Codan:

https://wiki.eclipse.org/CDT/designs/StaticAnalysis

Original comment by boxe...@gmail.com on 7 Mar 2014 at 4:36

GoogleCodeExporter commented 9 years ago
Codan gives me about 22 warnings

Original comment by boxe...@gmail.com on 7 Mar 2014 at 4:42