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

MSYS2 clang64 build warnings #1541

Closed
mcuee opened this issue Oct 28, 2023 · 2 comments
Closed

MSYS2 clang64 build warnings #1541

mcuee opened this issue Oct 28, 2023 · 2 comments
Labels
wontfix This will not be worked on

Comments

@mcuee
Copy link
Collaborator

mcuee commented Oct 28, 2023

There are a few warnings when building using MSYS2 clang64.

[50/72] Building C object src/CMakeFiles/libavrdude.dir/ser_win32.c.obj
C:/work/avr/avrdude_test/avrdude/src/ser_win32.c:484:3: warning: comparison of integers of different signs: 'SOCKET' (aka 'unsigned long long') and 'const int' [-Wsign-compare]
  484 |                 FD_SET(fd->ifd, &rfds);
      |                 ^~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/psdk_inc/_fd_types.h:77:40: note: expanded from macro 'FD_SET'
   77 |                 if (((fd_set *)(set))->fd_array[__i] == (fd)) {         \
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^   ~~
C:/work/avr/avrdude_test/avrdude/src/ser_win32.c:643:3: warning: comparison of integers of different signs: 'SOCKET' (aka 'unsigned long long') and 'const int' [-Wsign-compare]
  643 |                 FD_SET(fd->ifd, &rfds);
      |                 ^~~~~~~~~~~~~~~~~~~~~~
C:/msys64/clang64/include/psdk_inc/_fd_types.h:77:40: note: expanded from macro 'FD_SET'
   77 |                 if (((fd_set *)(set))->fd_array[__i] == (fd)) {         \
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^   ~~
2 warnings generated.
@mcuee mcuee added the bug Something isn't working label Oct 28, 2023
@stefanrueger
Copy link
Collaborator

According to man FD_SET the function is called as it should be. I suspect Windows has a different internal representation and therefore triggers the warning. I suspect using FD_SET((unsigned long long) fd->ifd, &rfds); might silence the warning and still work, but it could be that different compilers have different macros and that you get warnings in other compilers. As far as I am concerned we could leave this as is.

@mcuee
Copy link
Collaborator Author

mcuee commented Oct 29, 2023

Okay, I will close this issue.

@mcuee mcuee closed this as not planned Won't fix, can't repro, duplicate, stale Oct 29, 2023
@mcuee mcuee added wontfix This will not be worked on and removed bug Something isn't working labels Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants