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

unused-but-set-variable warnings lead to build failure with Apple clang 16 #717

Open
fxcoudert opened this issue Sep 5, 2024 · 1 comment

Comments

@fxcoudert
Copy link

Building on macOS 15 with clang 16, as part of Homebrew testing, fails due to unused-but-set-variable warnings being turned on:

/tmp/libusrsctp-20240905-96128-qgeo1n/usrsctp-0.9.5.0/usrsctplib/netinet/sctp_cc_functions.c:767:23: error: variable 't_cwnd' set but not used [-Werror,-Wunused-but-set-variable]
  767 |         uint32_t t_ssthresh, t_cwnd, incr;
      |                              ^
1 error generated.
gmake[2]: *** [usrsctplib/CMakeFiles/usrsctp.dir/build.make:135: usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_cc_functions.c.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/tmp/libusrsctp-20240905-96128-qgeo1n/usrsctp-0.9.5.0/usrsctplib/netinet/sctp_indata.c:3323:6: error: variable 'tot_retrans' set but not used [-Werror,-Wunused-but-set-variable]
 3323 |         int tot_retrans = 0;
      |             ^
1 error generated.
gmake[2]: *** [usrsctplib/CMakeFiles/usrsctp.dir/build.make:163: usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_indata.c.o] Error 1
/tmp/libusrsctp-20240905-96128-qgeo1n/usrsctp-0.9.5.0/usrsctplib/netinet/sctp_pcb.c:7946:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
 7946 | sctp_drain()
      |           ^
      |            void
1 error generated.
gmake[2]: *** [usrsctplib/CMakeFiles/usrsctp.dir/build.make:205: usrsctplib/CMakeFiles/usrsctp.dir/netinet/sctp_pcb.c.o] Error 1
/tmp/libusrsctp-20240905-96128-qgeo1n/usrsctp-0.9.5.0/usrsctplib/netinet/sctp_output.c:9973:33: error: variable 'cnt_thru' set but not used [-Werror,-Wunused-but-set-variable]
 9973 |         int no_fragmentflg, bundle_at, cnt_thru;
      |                                        ^
/tmp/libusrsctp-20240905-96128-qgeo1n/usrsctp-0.9.5.0/usrsctplib/netinet/sctp_output.c:13419:13: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
 13419 |         int error, len;
       |                    ^
2 errors generated.
@fxcoudert
Copy link
Author

Full list of errors by file:

/tmp/libusrsctp-20240905-3949-dnagdo/usrsctp-0.9.5.0/usrsctplib/user_socket.c:2860:6: error: variable 'send_count' set but not used [-Werror,-Wunused-but-set-variable]
 2860 |         int send_count;
      |             ^
/tmp/libusrsctp-20240905-3949-dnagdo/usrsctp-0.9.5.0/usrsctplib/user_socket.c:3005:6: error: variable 'send_count' set but not used [-Werror,-Wunused-but-set-variable]
 3005 |         int send_count;
      |             ^

and

/tmp/libusrsctp-20240905-3949-dnagdo/usrsctp-0.9.5.0/usrsctplib/netinet/sctp_sysctl.c:64:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
   64 | sctp_init_sysctls()
      |                  ^
      |                   void

and

/tmp/libusrsctp-20240905-3949-dnagdo/usrsctp-0.9.5.0/usrsctplib/netinet/sctp_pcb.c:7946:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
 7946 | sctp_drain()
      |           ^
      |            void

and

/tmp/libusrsctp-20240905-3949-dnagdo/usrsctp-0.9.5.0/usrsctplib/netinet/sctp_output.c:9973:33: error: variable 'cnt_thru' set but not used [-Werror,-Wunused-but-set-variable]
 9973 |         int no_fragmentflg, bundle_at, cnt_thru;
      |                                        ^
/tmp/libusrsctp-20240905-3949-dnagdo/usrsctp-0.9.5.0/usrsctplib/netinet/sctp_output.c:13419:13: error: variable 'len' set but not used [-Werror,-Wunused-but-set-variable]
 13419 |         int error, len;
       |                    ^

and

/tmp/libusrsctp-20240905-3949-dnagdo/usrsctp-0.9.5.0/usrsctplib/netinet/sctp_indata.c:3323:6: error: variable 'tot_retrans' set but not used [-Werror,-Wunused-but-set-variable]
 3323 |         int tot_retrans = 0;
      |             ^

and

/tmp/libusrsctp-20240905-3949-dnagdo/usrsctp-0.9.5.0/usrsctplib/netinet/sctp_cc_functions.c:767:23: error: variable 't_cwnd' set but not used [-Werror,-Wunused-but-set-variable]
  767 |         uint32_t t_ssthresh, t_cwnd, incr;
      |                              ^

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