From owner-svn-src-all@FreeBSD.ORG Wed May 23 00:04:32 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79A69106566B; Wed, 23 May 2012 00:04:32 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 14BD68FC0C; Wed, 23 May 2012 00:04:32 +0000 (UTC) Received: from sa-nc-mfg-99.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q4N04MMB064893 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 22 May 2012 17:04:30 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: Marcel Moolenaar In-Reply-To: Date: Tue, 22 May 2012 17:04:16 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201205221818.q4MII7lk019626@svn.freebsd.org> <20120523050739.H3621@besplex.bde.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1278) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "David E. O'Brien" , Bruce Evans 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: Wed, 23 May 2012 00:04:32 -0000 On May 22, 2012, at 2:07 PM, mdf@FreeBSD.org wrote: > On Tue, May 22, 2012 at 1:05 PM, Bruce Evans = wrote: >> On Tue, 22 May 2012, David E. O'Brien wrote: >>=20 >>> Log: >>> Do not incorrectly warn when printing a quad_t using "%qd" on = 64-bit >>> platforms. >>=20 >>=20 >> I think I like this, since it is technically correct, and will find a >> different set of type mismatches. >=20 > 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: >=20 > --- 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. long > + long) on i386 and another type (e.g. long) on amd64. This = prevents > + the use of a common format specifier. Treat equal sized = integer types > + 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); > } >=20 >=20 > If there's no objections, I (or David or anyone else) can commit to > the FreeBSD repository. I think such would make support for external (i.e. non-FreeBSD) = toolchains even more problematic. Our format extensions are a big hurdle already. I think we should not tweak the compiler. --=20 Marcel Moolenaar marcel@xcllnt.net