From patchwork Wed Jun 10 18:24:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 136808 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AFE0243150E5 for ; Wed, 10 Jun 2026 18:25:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AFE0243150E5 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=V7k+bH+h X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id DE6ED434FF85 for ; Wed, 10 Jun 2026 18:24:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DE6ED434FF85 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DE6ED434FF85 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781115900; cv=none; b=JAGOjQkh7CMg4NFxDTOa+rRPY/FuKHwLBRLGuWrlek4Tr6BfpZ9AzVICF6K87XC4mCBwmkkQ7R6Ecl/Tm6DvMKjFJRteJqIfDQpclQ/1ELFnCcBa00aij67OkG+2r2knz8jkSoEbAPJiqh7Kii5/Y6siR392wGqjZdPK5ufAym8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781115900; c=relaxed/simple; bh=tVvc+5E4eg05xUKVjn/I+H/6dF4itZafJ/1Jz4jg5WU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=x7WoFk7RgJVcGnOpCznu/6z4Vy8wtQci/ZMmQu+JW4T1Xgma0ZxxFy34/NlxKFGKgSvxobqsT/LV6Yr33KTsaBKCrYOe2MQsNJl3L5exqyYKR6BQmsllQe3nT8zVFHyzYoqjVql8Bzy4YBy71jDiQEavN2XRnf5P+vhPUQeUN60= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=V7k+bH+h DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE6ED434FF85 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781115899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=0gb2tRoA+rblIzwMAHdUcgCpiyAAbZ04Lt6u0PU6PXA=; b=V7k+bH+heRPJz/M1iueNDpW1hheyFrT6SBZFUfpKkWPU7b6tOLs1ZMQdAK4LbR0UADQTWL u2BNkgxJS/xyhfclBV88jPEQKF8jcXCRJwyBKJaXkyKGOBRC2L6ryBitxcyg0IOOf4Kon8 La9xIDtLK3bCUvIikHDwDmzlvaAcu3k= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-390-AJyc44V4NLe0WEkFP6kkrw-1; Wed, 10 Jun 2026 14:24:58 -0400 X-MC-Unique: AJyc44V4NLe0WEkFP6kkrw-1 X-Mimecast-MFC-AGG-ID: AJyc44V4NLe0WEkFP6kkrw_1781115897 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-45efa7755faso2782714f8f.1 for ; Wed, 10 Jun 2026 11:24:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781115897; x=1781720697; h=mime-version:message-id:subject:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0gb2tRoA+rblIzwMAHdUcgCpiyAAbZ04Lt6u0PU6PXA=; b=PVgYoDLzAf51MVqKUxMqsxZUdxI/Hsj4zFeeY4AzrPoAic1WaHNAuYTA4xvTOojAg0 VwVT1mFtHi2H9D1sOlH7eW0Xmo+MYVH1lwAaZI+HoA7p3Iqvq60n/5oallq1LpC+5pVt VEQbEAI9EbHO0kbFLxRSGPgL/7iUz2n/1m03wZu8sz+DgUFEkzPFWSz/5vUXmy+hyeuy q297mfp+dwilR9P/vEisrfqGmR/b9JTi4Jq6uMwaMN4d5JFbNfvQJDXC1B+4NhleiT4t C0sGAMxkemJ0CkGJ4Z88Zh90AUO3qKLV3zWn+mEzNoTuy0ZAgdLrvLM6Nx+KVgUx86CM 4iHw== X-Gm-Message-State: AOJu0Yyub65p+Qt0yj62Lm0fBmCAy0bwCe2qldPzTof+pYwrlxwuPwmH tw04ZGXfa0yDugIwGh9uh9qm8+EI98h5pyPprcW6+meJBSSb2xRHpIj8L7LUXM38ErB0WYts82q VL1lhLNVS/cbkJA66cpPq+aMcekkPKOmSvLOaJDhzyuZFDUke+Thgbpe0/HAG2e1W/+jUJI3/kV UpRGJ8HyPPj+7Cg2GDS49wpkKaU6qruw/KZUDRnTvGWIGeZQ== X-Gm-Gg: Acq92OF9R5Wfp01IWxmR421vfLBTKY8+vO1wOR4Edh2HfzRozGdZFy0n12vpa3LJzsZ dK2XJHJSI/wYCJv0gSoX1TVPsLcz810XoNhUfVxos30PF33q6M9kYYc4r9G5Yi2BqNrptLqqzh5 HwEaaEQXVi7u05P0oQGjQZwGpLeEwea4Hg9SbKnbcSWv5kclqSRZ+/JrGZMNYBvglA5xX6r/VlN 0O447oDSltEAFsq/K4tlxVlvj3sGjYssEFfrMRDPUJ9vWNMBSYnlOEbcA90H6+TD0cJ+9eFNwQa hq7Hum0oJucbDeJGxYeYDn1740R67WVjcXetWDrqdsqikAEYcoZa+3n6vRUasbOv7BlPEvrwfrX 8xnaBx2bnxGQr10WUc+wEsnnsuHdHDetkjf7190Nqt4Tc0gnqFDxZZOz5aML4xtM= X-Received: by 2002:a05:6000:25c3:b0:460:660a:3647 with SMTP id ffacd0b85a97d-460660a36b6mr218688f8f.25.1781115896855; Wed, 10 Jun 2026 11:24:56 -0700 (PDT) X-Received: by 2002:a05:6000:25c3:b0:460:660a:3647 with SMTP id ffacd0b85a97d-460660a36b6mr218635f8f.25.1781115896391; Wed, 10 Jun 2026 11:24:56 -0700 (PDT) Received: from digraph.polyomino.org.uk (digraph.polyomino.org.uk. [2001:8b0:bf73:93f7::51bb:e332]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4602cda3651sm62564575f8f.32.2026.06.10.11.24.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2026 11:24:55 -0700 (PDT) Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.98.2) (envelope-from ) id 1wXNbj-00000000psI-05tK for libc-alpha@sourceware.org; Wed, 10 Jun 2026 18:24:55 +0000 Date: Wed, 10 Jun 2026 18:24:55 +0000 (UTC) From: Joseph Myers To: libc-alpha@sourceware.org Subject: Fix -Wconstant-logical-operand error for Hurd Message-ID: <8971a89d-0703-9a51-de16-105294a94cff@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: EgDSvMq4Da4ESZ88MB4qPFA1ETDw98P0BOL0xV4WqEc_1781115897 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Building for Hurd with GCC mainline produces an error in pt-block.c (here MSG_OPTIONS is a macro that may be defined before pt-block.c is included by another source file): In file included from ../sysdeps/mach/htl/pt-block-intr.c:6: ../sysdeps/mach/htl/pt-block.c: In function '__pthread_block_intr': ../sysdeps/mach/htl/pt-block.c:49:42: error: use of logical '&&' with constant operand '1024' [-Werror=constant-logical-operand] 49 | if ((MSG_OPTIONS & MACH_RCV_INTERRUPT) && err == MACH_RCV_INTERRUPTED) | ^~ ../sysdeps/mach/htl/pt-block.c:49:42: note: use '&' for bitwise operation 49 | if ((MSG_OPTIONS & MACH_RCV_INTERRUPT) && err == MACH_RCV_INTERRUPTED) | ^~ | & Fix this, and a similar error in pt-timedblock.c, with an explicit != 0. Tested with build-many-glibcs.py (compilers and glibcs builds) for i686-gnu and x86_64-gnu. Reviewed-by: Samuel Thibault diff --git a/sysdeps/mach/htl/pt-block.c b/sysdeps/mach/htl/pt-block.c index 40f65130bb..efc58059f0 100644 --- a/sysdeps/mach/htl/pt-block.c +++ b/sysdeps/mach/htl/pt-block.c @@ -46,7 +46,7 @@ __pthread_block (struct __pthread *thread) err = __mach_msg (&msg, MACH_RCV_MSG | MSG_OPTIONS, 0, sizeof msg, thread->wakeupmsg.msgh_remote_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - if ((MSG_OPTIONS & MACH_RCV_INTERRUPT) && err == MACH_RCV_INTERRUPTED) + if ((MSG_OPTIONS & MACH_RCV_INTERRUPT) != 0 && err == MACH_RCV_INTERRUPTED) RETURN(EINTR); assert_perror (err); RETURN(0); diff --git a/sysdeps/mach/htl/pt-timedblock.c b/sysdeps/mach/htl/pt-timedblock.c index 99fdcd0dec..06244bde6c 100644 --- a/sysdeps/mach/htl/pt-timedblock.c +++ b/sysdeps/mach/htl/pt-timedblock.c @@ -63,7 +63,7 @@ __pthread_timedblock (struct __pthread *thread, timeout, MACH_PORT_NULL); if (err == EMACH_RCV_TIMED_OUT) return ETIMEDOUT; - if ((MSG_OPTIONS & MACH_RCV_INTERRUPT) && err == MACH_RCV_INTERRUPTED) + if ((MSG_OPTIONS & MACH_RCV_INTERRUPT) != 0 && err == MACH_RCV_INTERRUPTED) return EINTR; assert_perror (err);