Path: utzoo!attcan!uunet!wuarchive!cs.utexas.edu!rutgers!maverick.ksu.ksu.edu!ksuvax1!proot From: proot@ksuvax1 (Paul T. Root) Newsgroups: comp.unix.aix Subject: Re: getopt (3) problem? Message-ID: <1990Sep13.134059.18678@maverick.ksu.ksu.edu> Date: 13 Sep 90 13:40:59 GMT References: <1990Sep12.011152.26067@maverick.ksu.ksu.edu> Sender: news@maverick.ksu.ksu.edu (The News Guru) Organization: Kansas State University, Dept. of Computing and Information Sciences Lines: 29 In article <1990Sep12.011152.26067@maverick.ksu.ksu.edu> proot@ksuvax1.cis.ksu.edu (Paul T. Root) writes: >I've used getopt quite a bit on Suns, Vax, PS/2's, 370's, so I don't think >its operator error. But then again it probably is. I didn't think that to see what EOF was (I had been thinking that it was 0). Oh, well. What it comes down to is that c in the example below is a character instead of an integer. And (char) -1 != (int) -1. I would have expected a casting error (after all of the (int)NULL's I've done in AIX. > >The work around I use is like this: > > while(( c = getopt( argc, argv, "d:m" )), c != EOF && c != -1 ) { > switch( c ) { > . > . > . > } > } > Oh well, all's well with the Rios now. Is anybody working on GNU emacs with X-Windows now? I think that's the next project. Paul.