From owner-freebsd-questions Fri May 17 17:34:46 2002 Delivered-To: freebsd-questions@freebsd.org Received: from uplift.sunquest.com (uplift.hosp.misyshealthcare.com [149.138.10.246]) by hub.freebsd.org (Postfix) with ESMTP id 1C64937B403 for ; Fri, 17 May 2002 17:34:43 -0700 (PDT) Received: (from terry@localhost) by uplift.sunquest.com (8.9.3/8.9.3) id RAA53968; Fri, 17 May 2002 17:34:27 -0700 (MST) (envelope-from terry) Date: Fri, 17 May 2002 17:34:27 -0700 (MST) From: "Terry R. Friedrichsen" Message-Id: <200205180034.RAA53968@uplift.sunquest.com> To: jonc@chen.org.nz, questions@FreeBSD.ORG Subject: re: printf(3) problem? Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Sigh. On a second review, the problem here is that you're supplying > an "int" sized value when the format string expects a "long" sized > value. I perceive. More precisely, I'm supplying a "long long" value (off_t), when the format string expects a "long" value. Blame FreeBSD/AXP, where this code originally came from. And yes, I was too stupid to tell cc to do "-Wall" ... I can see that the printf() statement in the real code this example came from is gonna turn into an #ifdef farm. It'd be rather nice if the C pre- processor could do "sizeof" in #if conditionals ... but of course it can't. It may be best to generate the format string at run-time. Thanks to all who replied. Terry R. Friedrichsen terry@uplift.sunquest.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message