Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating Invalid in libjasper/jpc/jpc_enc.c #260

Closed
DavidHuber-NOAA opened this issue Jan 13, 2021 · 2 comments · Fixed by #261
Closed

Floating Invalid in libjasper/jpc/jpc_enc.c #260

DavidHuber-NOAA opened this issue Jan 13, 2021 · 2 comments · Fixed by #261

Comments

@DavidHuber-NOAA
Copy link

When compiled with the Intel compilers (version 18.0.3 20180410, JasPer version 2.0.22), the ternary operation at lines 1393-1395 returns a floating invalid when cp->totalsize == UINT_FAST32_MAX. Replacing the ternary operation with the if-else block located on lines 1397-1401 returns the expected value of UINT_FAST32_MAX.

@jubalh
Copy link
Member

jubalh commented Jan 18, 2021

What's the compiler define macro for that intel compilers?
On the other hand I don't get why we wouldn't want the more readable expression on the latter lines in all cases. I'll create a PR for this and let @mdadams review it.

jubalh added a commit to jubalh/jasper that referenced this issue Jan 18, 2021
If this ternary operation creates a problem on some clang version.
Why not just use the more readable if clause in all cases?

jasper-software#260 further reports
that it also creates problems on intel compilers.

Instead of adding more and more checks for compatible compilers let's
just use the if clause.

Fixes jasper-software#260
@mdadams
Copy link
Collaborator

mdadams commented Jan 19, 2021

@jubalh Removing the ternary operator seems like a reasonable solution to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants