From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24617 invoked by alias); 9 Mar 2011 16:12:08 -0000 Received: (qmail 24592 invoked by uid 22791); 9 Mar 2011 16:12:07 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from bitwagon.com (HELO bitwagon.com) (74.82.39.175) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Wed, 09 Mar 2011 16:12:01 +0000 Received: from f14-64.local ([67.171.188.169]) by bitwagon.com for ; Wed, 9 Mar 2011 08:11:58 -0800 Message-ID: <4D77A6A7.4060906@bitwagon.com> Date: Wed, 09 Mar 2011 16:12:00 -0000 From: John Reiser User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Thunderbird/3.1.7 MIME-Version: 1.0 To: binutils@sourceware.org Subject: Re: gold patch committed: Check IOV_MAX References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00184.txt.bz2 Ian Lance Taylor wrote: > Andreas Schwab writes: > >> Ian Lance Taylor writes: >>> void >>> File_read::read_multiple(off_t base, const Read_multiple& rm) >>> { >>> + static size_t iov_max = GOLD_IOV_MAX; >> >> const? > > I've written the code this way because IOV_MAX need not be a constant. > It may be a call to sysconf. static size_t const iov_max = GOLD_IOV_MAX; That use of 'const' denotes a property of the local variable 'iov_max' which can be valuable for documentation, maintenance, and optimization. Nothing is implied regarding the initializing expression 'GOLD_IOV_MAX', which may be simple or arbitrarily complicated. If it is desired to emphasize that the expansion of GOLD_IOV_MAX might involve more than literal numeric constants, then perhaps an explicit [and superfluous] cast static size_t const iov_max = (size_t const) GOLD_IOV_MAX; might be appropriate. --