From owner-freebsd-current@FreeBSD.ORG Thu Jul 11 16:09:51 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 30C9D8E2 for ; Thu, 11 Jul 2013 16:09:51 +0000 (UTC) (envelope-from imb@protected-networks.net) Received: from sarah.protected-networks.net (sarah.protected-networks.net [202.12.127.65]) by mx1.freebsd.org (Postfix) with ESMTP id 051AF17BC for ; Thu, 11 Jul 2013 16:09:50 +0000 (UTC) Received: from toshi.auburn.protected-networks.net (toshi.auburn.protected-networks.net [202.12.127.84]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "Iain Michael Butler", Issuer "Protected Networks Certificate Authority" (verified OK)) (Authenticated sender: imb@protected-networks.net) by sarah.protected-networks.net (Postfix) with ESMTPSA id F3ED36148 for ; Thu, 11 Jul 2013 12:09:43 -0400 (EDT) DomainKey-Signature: a=rsa-sha1; s=200509; d=protected-networks.net; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:to:subject: references:in-reply-to:x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=XJarNhtrwqXteIr0+vd6ITWf9giNPi6h0vINgY5+EqqHC5x7Xet/mY0g0yBrYjABY VdemA7H15mK/rHzEv2WR6jGBmUi3VHmCb5JP49difN9uBrn2mS3IrF3yT47AiQ/ Message-ID: <51DED8C6.6020807@protected-networks.net> Date: Thu, 11 Jul 2013 12:09:42 -0400 From: Michael Butler User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130710 Thunderbird/17.0.7 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: fix for SVN r253208 breaking buildkernel with gcc References: <51DED84D.30300@protected-networks.net> In-Reply-To: <51DED84D.30300@protected-networks.net> X-Enigmail-Version: 1.5.1 OpenPGP: id=0442D492 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jul 2013 16:09:51 -0000 On 07/11/13 12:07, Michael Butler wrote: > Seems gcc is rather fussy about propagating 'const' and fails to compile > /usr/src/sys/crypto/siphash/siphash.c after SVN r253208. > > I believe the attached patch is correct but please review .. > > imb grr .. missing attachment :-( Index: /usr/src/sys/crypto/siphash/siphash.c =================================================================== --- /usr/src/sys/crypto/siphash/siphash.c (revision 253210) +++ /usr/src/sys/crypto/siphash/siphash.c (working copy) @@ -119,7 +119,8 @@ void SipHash_Update(SIPHASH_CTX *ctx, const void *src, size_t len) { - uint64_t m, *p; + uint64_t m; + const uint64_t *p; const uint8_t *s; size_t rem; @@ -144,13 +145,13 @@ /* Optimze for 64bit aligned/unaligned access. */ if (((uintptr_t)s & 0x7) == 0) { - for (p = (uint64_t *)s; len > 0; len--, p++) { + for (p = (const uint64_t *)s; len > 0; len--, p++) { m = le64toh(*p); ctx->v[3] ^= m; SipRounds(ctx, 0); ctx->v[0] ^= m; } - s = (uint8_t *)p; + s = (const uint8_t *)p; } else { for (; len > 0; len--, s += 8) { m = le64dec(s);