From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4476 Path: news.gmane.org!not-for-mail From: David Wuertele Newsgroups: gmane.linux.lib.musl.general Subject: Am I using PRIxPTR wrong? Musl-libc complains, glibc doesn't Date: Tue, 14 Jan 2014 20:36:36 +0000 (UTC) Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1389731832 15836 80.91.229.3 (14 Jan 2014 20:37:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 14 Jan 2014 20:37:12 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4480-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jan 14 21:37:18 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1W3Ajb-0002tU-3d for gllmg-musl@plane.gmane.org; Tue, 14 Jan 2014 21:37:15 +0100 Original-Received: (qmail 30688 invoked by uid 550); 14 Jan 2014 20:37:13 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 30677 invoked from network); 14 Jan 2014 20:37:13 -0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 205.234.27.227 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36) Xref: news.gmane.org gmane.linux.lib.musl.general:4476 Archived-At: /* test.c - demo difference between glibc and musl-libc wrt PRIxPTR ** ** Both native (x86_64 glibc) and target (arm musl-libc) define ** PRIxPTR as "lx", but uintptr_t as unsigned int: ** ** $ gcc -E test.c | grep uintptr_t ** typedef unsigned long int uintptr_t; ** printf ("main is at 0x%""l" "x""\n", (uintptr_t) main); ** ** $ arm-linux-musleabishf-gcc -E test.c | grep uintptr_t ** typedef unsigned int uintptr_t; ** printf ("main is at 0x%""lx""\n", (uintptr_t) main); ** ** While native gcc doesn't complain, target gcc does: ** ** $ gcc -c test.c -Wformat ** ** $ arm-linux-musleabishf-gcc -c test.c -Wformat ** test.c: In function ‘main’: ** test.c:6:3: warning: format ‘%lx’ expects argument of type ** ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat] */ #include #include int main (int ac, char *av[]) { printf ("main is at 0x%"PRIxPTR"\n", (uintptr_t) main); return 0; }