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

clang warnings on windows #554

Closed
edwardhartnett opened this issue Nov 6, 2024 · 0 comments · Fixed by #544
Closed

clang warnings on windows #554

edwardhartnett opened this issue Nov 6, 2024 · 0 comments · Fixed by #544
Assignees
Labels
bug Something isn't working

Comments

@edwardhartnett
Copy link
Contributor

D:/a/NCEPLIBS-g2c/NCEPLIBS-g2c/g2c/src/g2cdegrib2.c:200:13: warning: absolute value function 'abs' given an argument of type 'long long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
200 | itemp = abs(ipdtmpl[iutpos + 1]) * iunit;
| ^
D:/a/NCEPLIBS-g2c/NCEPLIBS-g2c/g2c/src/g2cdegrib2.c:200:13: note: use function 'llabs' instead
200 | itemp = abs(ipdtmpl[iutpos + 1]) * iunit;
| ^~~
| llabs
D:/a/NCEPLIBS-g2c/NCEPLIBS-g2c/g2c/src/g2cdegrib2.c:220:18: warning: absolute value function 'abs' given an argument of type 'long long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
220 | itemp2 = abs(ipdtmpl[iutpos2]) * iunit2;
| ^
D:/a/NCEPLIBS-g2c/NCEPLIBS-g2c/g2c/src/g2cdegrib2.c:220:18: note: use function 'llabs' instead
220 | itemp2 = abs(ipdtmpl[iutpos2]) * iunit2;
| ^~~
| llabs
D:/a/NCEPLIBS-g2c/NCEPLIBS-g2c/g2c/src/g2cdegrib2.c:660:59: warning: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned long long') [-Wformat]
660 | fprintf(f, " GRIB MESSAGE %ld starts at %ld\n", msg->msg_num + 1, msg->bytes_to_msg + 1);
| ~~~ ^~~~~~~~~~~~~~~~
| %zu
D:/a/NCEPLIBS-g2c/NCEPLIBS-g2c/g2c/src/g2cdegrib2.c:660:77: warning: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned long long') [-Wformat]
660 | fprintf(f, " GRIB MESSAGE %ld starts at %ld\n", msg->msg_num + 1, msg->bytes_to_msg + 1);
| ~~~ ^~~~~~~~~~~~~~~~~~~~~
| %zu
D:/a/NCEPLIBS-g2c/NCEPLIBS-g2c/g2c/src/g2cdegrib2.c:662:65: warning: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned long long') [-Wformat]

662 | fprintf(f, " SECTION 0: %d 2 %ld\n", msg->discipline, msg->bytes_in_msg);

  |                                        ~~~                      ^~~~~~~~~~~~~~~~~

  |                                        %zu
@edwardhartnett edwardhartnett added the bug Something isn't working label Nov 6, 2024
@edwardhartnett edwardhartnett self-assigned this Nov 6, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in NCEPLIBS-g2c-2.1.0 Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant