getopt (3) problem?

Guy Harris guy at auspex.auspex.com
Sat Sep 15 06:35:14 AEST 1990


 >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....



More information about the Comp.unix.aix mailing list