X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E5784566F6 for ; Mon, 21 Mar 2005 19:46:38 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30483-03 for ; Mon, 21 Mar 2005 19:46:35 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id D205C566FB for ; Mon, 21 Mar 2005 19:46:32 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j2LJkTKd001275; Mon, 21 Mar 2005 14:46:29 -0500 (EST) To: Kelly Burkhart Cc: Peter Eisentraut , Kelly Burkhart , pgsql-odbc@postgresql.org Subject: Re: 32-bit ints on 64-bit linux In-reply-to: <1111433339.26601.89.camel@krb06> References: <4224F80D.2080103@kkcsm.net> <422727B1.9040104@kkcsm.net> <200503181625.09496.peter_e@gmx.net> <1111433339.26601.89.camel@krb06> Comments: In-reply-to Kelly Burkhart message dated "Mon, 21 Mar 2005 13:28:59 -0600" Date: Mon, 21 Mar 2005 14:46:29 -0500 Message-ID: <1274.1111434389@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/88 X-Sequence-Number: 5106 Kelly Burkhart writes: > Can anyone with a better understanding of the libc standard comment on > the "correctness" of the following lines? > int8_t i1; > int16_t i2; > printf("%d", i1); > printf("%d", i2); That's perfectly correct, unless int is narrower than 16 bits on your platform ;-). Anything narrower than int is implicitly coerced to int when it's passed to printf. The existence of the h modifier in the printf format syntax is for scanf, not printf; scanf does have to know the difference between int and narrower-than-int variables. regards, tom lane