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

Warnings when building with GCC #85

Open
bkmgit opened this issue Dec 1, 2022 · 0 comments
Open

Warnings when building with GCC #85

bkmgit opened this issue Dec 1, 2022 · 0 comments

Comments

@bkmgit
Copy link

bkmgit commented Dec 1, 2022

Get the following warning when building with GCC 12.2.1 for float

[ 40%] Building C object tools/CMakeFiles/psdpng.dir/psdpng.c.o
/home/kissfft/kissfft-131.1.0/tools/psdpng.c: In function ‘val2rgb’:
/home/kissfft/kissfft-131.1.0/tools/psdpng.c:87:22: warning: using integer absolute value function ‘abs’ when argument is of floating-point type ‘double’ [-Wabsolute-value]
   87 |     p->r = (int)(255*abs(sin(x*pi*3/2)));
      |                      ^~~
/home/kissfft/kissfft-131.1.0/tools/psdpng.c:88:22: warning: using integer absolute value function ‘abs’ when argument is of floating-point type ‘double’ [-Wabsolute-value]
   88 |     p->b = (int)(255*abs(sin(x*pi*5/2)));
      |                      ^~~

when building double get

[ 40%] Building C object tools/CMakeFiles/psdpng.dir/psdpng.c.o
/home/kissfft/kissfft-131.1.0/tools/psdpng.c: In function ‘val2rgb’:
/home/kissfft/kissfft-131.1.0/tools/psdpng.c:87:22: warning: using integer absolute value function ‘abs’ when argument is of floating-point type ‘double’ [-Wabsolute-value]
   87 |     p->r = (int)(255*abs(sin(x*pi*3/2)));
      |                      ^~~
/home/kissfft/kissfft-131.1.0/tools/psdpng.c:88:22: warning: using integer absolute value function ‘abs’ when argument is of floating-point type ‘double’ [-Wabsolute-value]
   88 |     p->b = (int)(255*abs(sin(x*pi*5/2)));
      |                      ^~~
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

No branches or pull requests

1 participant