RESOLVED FIXED 145128
Fix the libusrsctp build with clang
https://bugs.webkit.org/show_bug.cgi?id=145128
Summary Fix the libusrsctp build with clang
Csaba Osztrogonác
Reported 2015-05-18 04:47:47 PDT
libusrsctp isn't buildable with clang: netinet/sctp_timer.c:685:46: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] if (((&stcb->asoc.send_queue)->tqh_first == ((void*)0))) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ netinet/sctp_timer.c:1167:50: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] if (((&stcb->asoc.asconf_send_queue)->tqh_first == ((void*)0))) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ netinet/sctp_input.c:3421:45: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] if (((&stcb->asoc.send_queue)->tqh_first == ((void*)0))) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ netinet/sctp_input.c:3625:51: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] if (((&stcb->asoc.control_send_queue)->tqh_first == ((void*)0))) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ netinet/sctp_input.c:4193:48: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] { if (((&(stcb)->asoc.free_chunks)->tqh_first == ((void*)0))) { (chk) = (struct sctp_tmit_chunk *)malloc(system_base_info.sctppcbinfo.ipi_zone_chunk);; if ((chk)) { do { (void) __sync_fetch_and_add(&system_base_info.sctppcbinfo.ipi_count_chunk, 1); } while (0); (chk)->whoTo = ((void*)0); (chk)->holds_key_ref = 0; } } else { (chk) = ((&(stcb)->asoc.free_chunks)->tqh_first); do { if ((((chk))->sctp_next.tqe_next) != ((void*)0)) ((chk))->sctp_next.tqe_next->sctp_next.tqe_prev = ((chk))->sctp_next.tqe_prev; else (&(stcb)->asoc.free_chunks)->tqh_last = ((chk))->sctp_next.tqe_prev; *((chk))->sctp_next.tqe_prev = ((chk))->sctp_next.tqe_next; } while ( 0); (void) __sync_fetch_and_sub(&system_base_info.sctppcbinfo.ipi_free_chunks, 1); (chk)->holds_key_ref = 0; (void) __sync_fetch_and_add(&system_base_info.sctpstat.sctps_cached_chk, 1); (stcb)->asoc.free_chunk_cnt--; } }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ ... Of course these errors should be fixed in upstream, but we should disable parentheses-equality for this jhbuild module until the proper fix.
Attachments
Patch (2.25 KB, patch)
2015-06-10 01:31 PDT, Csaba Osztrogonác
no flags
Patch (2.25 KB, patch)
2015-06-10 02:21 PDT, Csaba Osztrogonác
no flags
Csaba Osztrogonác
Comment 1 2015-06-10 01:30:56 PDT
I disabled this warning on the github repository: https://github.com/ossy-szeged/sctp-refimpl/commit/05b66a4f9b09fa841128073e1a248918d11118d3 Let's bump to this new tag.
Csaba Osztrogonác
Comment 2 2015-06-10 01:31:33 PDT
Csaba Osztrogonác
Comment 3 2015-06-10 01:51:35 PDT
Comment on attachment 254635 [details] Patch removing r?, unfortunately this change isn't enough.
Csaba Osztrogonác
Comment 4 2015-06-10 02:02:55 PDT
(In reply to comment #3) > Comment on attachment 254635 [details] > Patch > > removing r?, unfortunately this change isn't enough. netinet/sctp_output.c:4411:9: error: explicitly assigning value of variable of type 'struct mbuf *' to itself [-Werror,-Wself-assign] o_pak=o_pak; ~~~~~^~~~~~ netinet/sctp_output.c:11638:9: error: explicitly assigning value of variable of type 'struct mbuf *' to itself [-Werror,-Wself-assign] o_pak=o_pak; ~~~~~^~~~~~ sctp_os_userspace.h: #define SCTP_ENABLE_UDP_CSUM(m) m=m This self assignment is ridiculous and doesn't add anything to the project, only a build failure. I'll remove it.
Csaba Osztrogonác
Comment 5 2015-06-10 02:17:04 PDT
Csaba Osztrogonác
Comment 6 2015-06-10 02:21:50 PDT
Gyuyoung Kim
Comment 7 2015-06-10 17:45:18 PDT
Comment on attachment 254640 [details] Patch rs=me
WebKit Commit Bot
Comment 8 2015-06-12 03:03:42 PDT
Comment on attachment 254640 [details] Patch Clearing flags on attachment: 254640 Committed r185494: <http://trac.webkit.org/changeset/185494>
WebKit Commit Bot
Comment 9 2015-06-12 03:03:47 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.