From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vl3Fs-00011f-8h for qemu-devel@nongnu.org; Mon, 25 Nov 2013 15:59:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vl3Fk-0007GW-0j for qemu-devel@nongnu.org; Mon, 25 Nov 2013 15:59:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vl3Fj-0007GS-Oi for qemu-devel@nongnu.org; Mon, 25 Nov 2013 15:59:31 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAPKxVeb009212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 25 Nov 2013 15:59:31 -0500 Date: Mon, 25 Nov 2013 23:02:47 +0200 From: "Michael S. Tsirkin" Message-ID: <20131125210247.GK12689@redhat.com> References: <1385379990-32093-1-git-send-email-mst@redhat.com> <1385379990-32093-4-git-send-email-mst@redhat.com> <5293B215.4030108@redhat.com> <20131125203152.GB12689@redhat.com> <5293B517.8090108@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5293B517.8090108@redhat.com> Subject: Re: [Qemu-devel] [PULL for-1.7 v2 3/6] acpi-build: fix build on glib < 2.22 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Paolo Bonzini , qemu-devel@nongnu.org On Tue, Nov 26, 2013 at 06:37:43AM +1000, Richard Henderson wrote: > On 11/26/2013 06:31 AM, Michael S. Tsirkin wrote: > > On Tue, Nov 26, 2013 at 06:24:53AM +1000, Richard Henderson wrote: > >> On 11/25/2013 09:48 PM, Michael S. Tsirkin wrote: > >>> g_string_vprintf was only introduced in 2.24 so switch to vsnprintf > >>> instead. A bit uglier but name size is fixed at 4 bytes here so it's > >>> easy. > >> > >> You list 2.24 here, > >> > >>> - GString *s = g_string_new(""); > >>> + /* It would be nicer to use g_string_vprintf but it's only there in 2.22 */ > >> > >> ... 2.22 here. > >> > >> But https://developer.gnome.org/glib/2.28/glib-Strings.html#g-string-vprintf > >> > >> says "since 2.14". > >> > >>> + char s[] = "XXXX"; > >> > >> char s[5]; > >> > >> Initializing it is a waste of time. > >> > >> > >> r~ > > > > It's sets the length in a nice way. > > > > Then do something like > > char s[sizeof("XXXX")]; > > so that the actual initialization doesn't happen. > > > r~ In any case it's too late to play with cosmetic changes for 1.7. We can revisit for 1.8.