From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: [PATCH 5/5 V2] kvm tools: Initialize and use VESA and VNC Date: Tue, 24 May 2011 21:00:23 +0200 Message-ID: <20110524190023.GC6561@elte.hu> References: <1306149553-26793-5-git-send-email-levinsasha928@gmail.com> <20110523113824.GE4042@elte.hu> <4DDB6E55.8080408@redhat.com> <20110524085024.GA31453@elte.hu> <4DDB75EC.7000300@redhat.com> <4DDB9510.8030501@redhat.com> <4DDB96CA.1030206@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Paolo Bonzini , Sasha Levin , john@jfloren.net, kvm@vger.kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com To: Pekka Enberg Return-path: Received: from mx2.mail.elte.hu ([157.181.151.9]:48963 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932073Ab1EXTAd (ORCPT ); Tue, 24 May 2011 15:00:33 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: * Pekka Enberg wrote: > We switched to u64 and friends for two reasons: (1) using uint*_t turned out > to be painful when using kernel headers (e.g., mptables, e820, etc.) and (2) > we want to be as close as possible to the coding style of tools/perf to be > able to reuse their code in the future. 3) uint*_t caused frequent type mismatches and breakages with format strings if accidentally an uint*_t was stuck into a regular printf format - it would trigger a warning only on 64-bit or only on 32-bit systems, causing frequent flux. This is not a very good data type model. 4) uint*_t also causes absolute brain-damaged printf format hacks like: fprintf(stderr, "%s: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n", event_name(counter), count[0], count[1], count[2]); instead of the much cleaner: fprintf(stderr, "%s: %Lu %Lu %Lu\n", event_name(counter), count[0], count[1], count[2]); So we can use uint*_t where absolutely necessary due to external ABI constraints, but otherwise it's discouraged for tools/kvm/ internal code. Thanks, Ingo