From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=DKIM_ADSP_ALL,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id B24EB22359 for ; Fri, 29 Mar 2024 17:57:08 +0100 (CET) Received: (qmail 25724 invoked by uid 550); 29 Mar 2024 16:52:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 25654 invoked from network); 29 Mar 2024 16:52:11 -0000 Authentication-Results: citrusmail; dkim=pass header.i=@ovsienko.info DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ovsienko.info; s=2022-04-13; t=1711731415; bh=SPgrhkP6F8TWpLqCB8iqx0DitscsObKUtYo8G9oGNYM=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding; b=LNKkvO+XL6WP6vlsqAZSpUFeT0tWVzgoatEk847ngihXAlIQe+MH8eS7JIqhDtMIt BGGz0gOGSVe85VTgd5qymSvJsFj3SjUUcO71o7O/WzCqgU/JhOKngxvKAi6OCtf9Oy MElFBvVZZRp7T8g7GSu0Oe0DP7u6HuMAI4vrZYOy5C08knGxq7qO4g5NnlRhmxHZK5 b8BylLSy0/PBulpA1PXhGDQlLA93gX9EkVPTyBz+kn+qe2cWhJfpmFLnfp6TqEmBjn 3dJOWsQmCohB/tFg6zpi672IUNRIiEPVSzZoYxQLN2bdLIindfsD9h1Z10RRJgDZ9G Htcik2+0QngEQ== X-Citrus-Remote-IP: 129.151.92.78 Date: Fri, 29 Mar 2024 16:50:47 +0000 From: Denis Ovsienko To: musl@lists.openwall.com Message-ID: <20240329165047.6bc7a7c9@atlas-11> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Citrus-Version: 6.0.3ba253c X-Citrus-ID: 742TGutW3007070 X-Citrus-Spam: Whitelisted X-Citrus-Trust: Trusted Subject: [musl] musl CMSG_NXTHDR() triggers a -Wsign-compare from Clang Hello all. To see how well libpcap compiles with musl libc, I used Alpine Linux 3.19 and noticed that one of the musl headers triggers warnings in libpcap source, which in development environments tends to use -Werror because normally it produces no compiler warnings. The warning in musl libc becomes a warning in libpcap pcap-bt-linux.c and fails the build. The workaround is not difficult, but fixing it in upstream would make more sense from my point of view. The problem reproduces using Clang only. $ /usr/lib/libc.so musl libc (x86_64) Version 1.2.4_git20230717 Dynamic Program Loader Usage: /usr/lib/libc.so [options] [--] pathname [args] $ clang --version Alpine clang version 17.0.5 Target: x86_64-alpine-linux-musl Thread model: posix InstalledDir: /usr/bin Configuration file: /etc/clang17/x86_64-alpine-linux-musl.cfg $ clang -fvisibility=hidden -W -Wall -Wcomma -Wdocumentation -Wformat-nonliteral -Wmissing-noreturn -Wmissing-prototypes -Wmissing-variable-declarations -Wnull-pointer-subtraction -Wpointer-arith -Wpointer-sign -Wshadow -Wshorten-64-to-32 -Wsign-compare -Wstrict-prototypes -Wundef -Wunreachable-code -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-parameter -Wused-but-marked-unused -fpic -I. -I/usr/include/libnl3 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -DBUILDING_PCAP -Dpcap_EXPORTS -DHAVE_CONFIG_H -Werror -c ./pcap-bt-linux.c ./pcap-bt-linux.c:373:10: error: comparison of integers of different signs: 'unsigned long' and 'long' [-Werror,-Wsign-compare] 373 | cmsg = CMSG_NXTHDR(&msg, cmsg); | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/sys/socket.h:358:44: note: expanded from macro 'CMSG_NXTHDR' 358 | __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [Makefile:87: pcap-bt-linux.o] Error 1 -- Denis Ovsienko