From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA02165; Thu, 23 Aug 2001 18:28:08 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA02117 for ; Thu, 23 Aug 2001 18:28:08 +0200 (MET DST) Received: from postoffice.mail.cornell.edu (postoffice.mail.cornell.edu [132.236.56.7]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f7NGS7H29745 for ; Thu, 23 Aug 2001 18:28:07 +0200 (MET DST) Received: from milhouse.cs.cornell.edu.cs.cornell.edu (dhcp99-208.cs.cornell.edu [128.84.99.208]) by postoffice.mail.cornell.edu (8.9.3/8.9.3) with ESMTP id MAA17393 for ; Thu, 23 Aug 2001 12:28:05 -0400 (EDT) To: caml-list@inria.fr Subject: [Caml-list] assert + -pp = wrong line number and filename in assert message From: Paul Stodghill Date: 23 Aug 2001 12:28:16 -0400 Message-ID: User-Agent: Gnus/5.090003 (Oort Gnus v0.03) XEmacs/21.4 (Academic Rigor) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk The "assert" construct generates an exception which contains the file name and line number where the "assert" appears. However, when a preprocessor is used (with the -pp option), the file name and line number that are recorded are relative to the preprocessor output file and not to original source file, even when the '# linenum "filename"' directives are inserted in the preprocessor output. A quick scanner of ocaml-3.02/parsing/lexer.mll seems to indicate that the line directive is completely ignored. milhouse$ uname -a CYGWIN_NT-5.0 MILHOUSE 1.3.2(0.39/3/2) 2001-05-20 23:28 i686 unknown milhouse$ ocamlc -v The Objective Caml compiler, version 3.02 Standard library directory: /usr/local/lib/ocaml milhouse$ milhouse$ milhouse$ cat preproc.sh #! /bin/sh echo '# 1 "'$1'"' cat $1 milhouse$ milhouse$ milhouse$ cat assert_bug.ml assert false;; milhouse$ milhouse$ milhouse$ ocamlc -o assert_bug.exe -pp './preproc.sh' assert_bug.ml milhouse$ ./assert_bug.exe Fatal error: uncaught exception Assert_failure("/home/stodghil/tmp/camlpp0", 20, 32) milhouse$ ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr