Subject: [clisp-list] Problems with latest CVS version of comment5.c: data flow analysis

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Fri Aug 2 04:12:15 2002

Hi again,

just doing a dataflow analysis on the code below shows that it cannot be correct.
perror() doesn't get as input the file handle for which to print an error, so what can it do?

input-output flow into functions analysis is a very revealing technique.

As a result from the below use of the perror function, everyone can conclude that it can at best only say something about the last error that happened in the system (and this is actually what the manpage says), using hidden communication channels (typically errno).

Therefore, perror(infilename) cannot reliably report the error that occured when closing the input file, since a subsequent error may have occured when closing the output file: that one would be reported instead and falsely attributed to the input file.

The code is not correct (w.r.t. to an imaginary specification derived by "Do What I Intended"), aka broken.

>   120    /* close files: */
>   121    fclose(infile);
>   122    fclose(outfile);
>   123    if (ferror(infile))
>   124      { perror(infilenamebuffer); exit(__LINE__); }
>   125    if (ferror(outfile))
>   126      { perror(outfilenamebuffer); exit(__LINE__); }
>   127    exit(0); /* OK */

Note however that this issue is independent of the implementation issue of whether ferror() produces meaningful results after fclose() is called. I believe it should, in order to be useful, but the answer must come from the specification of the ANSI C I/O - hopefully.

Involved problem areas: should calls reset errno before they try to do anything, e.g. at function entry? Should functions like fwrite() do anything in case ferror() on the given FILE* is set or must one clearerr()? etc.

Regards,
	Jorg Hohle.

---

From: Grzegorz Chrupala <[email-masked]>
Date: Fri Aug 2 05:23:12 2002

Hi all,

Just a quick question: how do I get completion when
running clisp in an Emacs *inferior-lisp* buffer?
I tried ESC-TAB but I get a "no tags table loaded"
message.
I do have completion with the tab key in a Linux
terminal window, but not in MS Windows.

Thanks,

Greg

_______________________________________________________________
Yahoo! Messenger
Nueva versión: Webcam, voz, y mucho más ¡Gratis! 
Descárgalo ya desde http://messenger.yahoo.es

---

From: Sam Steingold <[email-masked]>
Date: Fri Aug 2 08:25:04 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] Completion in Emacs and terminal"
> * Sent on Fri, 2 Aug 2002 14:22:11 +0200 (CEST)
> * Honorable Grzegorz Chrupala <[email-masked]> writes:
>

1. do not give CLISP "-I" command line switch.

2. (define-key inferior-lisp-mode-map "\C-i"
  (lambda () (interactive) (process-send-string (get-buffer-process
  inferior-lisp-buffer) "\C-i")))

> but not in MS Windows.
you should get it with cygwin.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
What was the best thing before sliced bread?