Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.aix Subject: Re: getopt (3) problem? Message-ID: <4061@auspex.auspex.com> Date: 14 Sep 90 20:35:14 GMT References: <1990Sep12.011152.26067@maverick.ksu.ksu.edu> <1990Sep13.134059.18678@maverick.ksu.ksu.edu> Organization: Auspex Systems, Santa Clara Lines: 15 >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. OK, now I'm curious how the workaround: >>The work around I use is like this: >> >> while(( c = getopt( argc, argv, "d:m" )), c != EOF && c != -1 ) { worked, since EOF is -1 on the RIOS, and comparing "c" twice against -1 shouldn't yield any results different from doing it once....