From owner-svn-src-all@FreeBSD.ORG Tue May 22 21:07:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F1F6106566B; Tue, 22 May 2012 21:07:23 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id D12398FC23; Tue, 22 May 2012 21:07:22 +0000 (UTC) Received: by dadv36 with SMTP id v36so9505296dad.13 for ; Tue, 22 May 2012 14:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=bQ5SH0aFxzkj3Aog1vsspkBM+ERDfE68kWgWEByryF4=; b=NNYTshrNmE9uedJutZjCAmUeMym9uXimDbRY9ddJcx+4Yp9cNTmmgK9MuC/ujsvB3g 8w1CPRmooZHBgATWgxe3TMrbnQHUh0H+3Hg30LiYJE3khpMCBFUkucVsJvv9xzVjkRZd MLQPQOviXDlAfSuMk/MRwutSRgaqz38Ca/RcXKQJYS0q7305fZqH4V+hbqA6CmrrHMb1 DNjI28BXljXmxJFUmcgn+OseL4SkVQeM2iomlffXsQyTovilMCVEgwnTiU8vyhUdn+yK wB6G9mV56YedzhcP4D+eKYn5fxdYHkuy8uzxSuAYW4YV3dwar1zfu4cjmSe6U2AfzS6B s7cg== MIME-Version: 1.0 Received: by 10.68.224.103 with SMTP id rb7mr2905721pbc.23.1337720842458; Tue, 22 May 2012 14:07:22 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.68.237.226 with HTTP; Tue, 22 May 2012 14:07:22 -0700 (PDT) In-Reply-To: <20120523050739.H3621@besplex.bde.org> References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> Date: Tue, 22 May 2012 14:07:22 -0700 X-Google-Sender-Auth: waTy4SSV8TkWFusznzhEYUw4-gw Message-ID: From: mdf@FreeBSD.org To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "David E. O'Brien" Subject: Re: svn commit: r235797 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2012 21:07:23 -0000 On Tue, May 22, 2012 at 1:05 PM, Bruce Evans wrote: > On Tue, 22 May 2012, David E. O'Brien wrote: > >> Log: >> =A0Do not incorrectly warn when printing a quad_t using "%qd" on 64-bit >> platforms. > > > I think I like this, since it is technically correct, and will find a > different set of type mismatches. We run with the following at Isilon, which is somewhat bogus because it allows a bit of sloppiness in types, but is also terribly convenient since it means no casting on printf arguments is needed: --- contrib/gcc/c-format.c 2012-05-22 14:08:23.538266746 -0700 +++ /data/sb/head/src/contrib/gcc/c-format.c 2012-05-16 12:59:40.937016702 -0700 @@ -2298,10 +2570,20 @@ check_format_types (format_wanted_type * equivalent but the above test won't consider them equivalent. */ if (wanted_type =3D=3D char_type_node && (!pedantic || i < 2) && char_type_flag) continue; + + /* Isilon: FreeBSD defines int64_t (and others) as one type (e.g. lo= ng + long) on i386 and another type (e.g. long) on amd64. This prevents + the use of a common format specifier. Treat equal sized integer ty= pes + as equivalent. */ + if (TREE_CODE (wanted_type) =3D=3D INTEGER_TYPE + && TREE_CODE (cur_type) =3D=3D INTEGER_TYPE + && int_size_in_bytes (wanted_type) =3D=3D int_size_in_bytes (cur_= type)) + continue; + /* Now we have a type mismatch. */ format_type_warning (types->name, format_start, format_length, wanted_type, types->pointer_count, types->wanted_type_name, orig_cur_type, arg_num)= ; } If there's no objections, I (or David or anyone else) can commit to the FreeBSD repository. Cheers, matthew