From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id 5B51C386F442 for ; Sat, 25 Apr 2020 17:15:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5B51C386F442 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-207-Ysb6Kd17POeUYd2brBhupA-1; Sat, 25 Apr 2020 13:15:27 -0400 X-MC-Unique: Ysb6Kd17POeUYd2brBhupA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 24203835B8B; Sat, 25 Apr 2020 17:15:26 +0000 (UTC) Received: from greed.delorie.com (ovpn-112-52.phx2.redhat.com [10.3.112.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E829B2618B; Sat, 25 Apr 2020 17:15:25 +0000 (UTC) Received: from greed.delorie.com.redhat.com (localhost [127.0.0.1]) by greed.delorie.com (8.14.7/8.14.7) with ESMTP id 03PHFNIB022861; Sat, 25 Apr 2020 13:15:23 -0400 From: DJ Delorie To: Andreas Schwab Cc: libc-alpha@sourceware.org Subject: Re: [patch] Use unsigned constants for ICMP6 filters [BZ #22489] In-Reply-To: <87imhondz7.fsf@linux-m68k.org> (message from Andreas Schwab on Sat, 25 Apr 2020 10:53:16 +0200) Date: Sat, 25 Apr 2020 13:15:23 -0400 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Apr 2020 17:15:33 -0000 Andreas Schwab writes: > That explanation doesn't make sense. This has nothing to do with > signedness of bitfields, it is about shifting a value out of its range. The struct has this: uint32_t icmp6_filt[8]; It's not a "gcc bitfield" it's an "icmp filter bitfield" The logic in the test case boils down to: (uint32_t) icmp6_filt[] &=3D (int) -65 GCC complains that -65 doesn't fit in "uint32_t" and was converted to (unsigned) 0xffffffbf.