From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 91248BC69 for ; Thu, 22 Mar 2007 11:56:26 +0100 (CET) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by discorde.inria.fr (8.13.6/8.13.6) with SMTP id l2MAuPjv031223 for ; Thu, 22 Mar 2007 11:56:26 +0100 Received: (qmail invoked by alias); 22 Mar 2007 10:56:25 -0000 Received: from p54A31A54.dip0.t-ipconnect.de (EHLO localhost) [84.163.26.84] by mail.gmx.net (mp024) with SMTP; 22 Mar 2007 11:56:25 +0100 X-Authenticated: #20477425 X-Provags-ID: V01U2FsdGVkX1/Gq7EVTP3Gr7BqO9v5rj139rMFk7utmdL+HuvQry aUGPtwKgXed5fI Date: Thu, 22 Mar 2007 11:56:24 +0100 From: micha To: caml-list@inria.fr Subject: 3.10 changes for scanf Message-ID: <20070322115624.7f1a04f7@localhost> X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Miltered: at discorde with ID 460260D9.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; scanf:01 scanf:01 cheers:01 char:01 exception:01 int:01 newline:02 string:02 let:03 let:03 spaces:04 fails:05 scan:06 reads:06 michael:07 I have a file with one int per line and when reading it with: let x = (Scanf.fscanf log "%d" (fun n -> n)) in let y = (Scanf.fscanf log "%d" (fun n -> n)) in let w = (Scanf.fscanf log "%d" (fun n -> n)) in let h = (Scanf.fscanf log "%d" (fun n -> n)) in .... it works in 3.09, but 3.10 fails with: Exception: Scanf.Scan_failure "scanf: bad input at char number 1: \n" so I must change the format string to " %d " (note the spaces around %d) to eat the newline too, is this a desired change? ( the c version reads the numbers with just "%d", I'm not sure what's the correct behavior) cheers, Michael