From owner-freebsd-bugs Sun Mar 18 14:40: 9 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B67F937B719 for ; Sun, 18 Mar 2001 14:40:00 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f2IMe0112147; Sun, 18 Mar 2001 14:40:00 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id C8D3637B71A for ; Sun, 18 Mar 2001 14:38:06 -0800 (PST) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f2IMc6t11966; Sun, 18 Mar 2001 14:38:06 -0800 (PST) (envelope-from nobody) Message-Id: <200103182238.f2IMc6t11966@freefall.freebsd.org> Date: Sun, 18 Mar 2001 14:38:06 -0800 (PST) From: gh@raditex.se To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/25904: Error in the printf-function. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25904 >Category: misc >Synopsis: Error in the printf-function. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Mar 18 14:40:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Göran Hasse >Release: 4.2 >Organization: Raditex AB >Environment: Ordinary c-program >Description: The printf function seems to mix up whats a pointer and whats a value... ? >How-To-Repeat: Run this program #include #include main() { int * Var; float Value; int IntVar; Value = 2.4; IntVar = 4; Var = malloc(4); *Var = Value ; /* Why is it like this? - explain */ if( 0 ) printf("Value is %f \n", Value ); printf(" Var is %f \n", Var ); if( 1 ) printf("Value is %f \n", Value ); printf(" Var is %f \n", Var ); *Var = IntVar; if( 1 ) printf("Value is %d \n", IntVar ); printf(" Var is %d \n", *Var ); } >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message