Jerry Feldman <gaf@blu.org> [Fri, 30 May 2003 22:15:29 -0400]:
void GetOne()
<nitpick> This isn't a valid Prototype in ISO C, because the compiler can't distinguish between an empty parameter list and K&R definitions. So it should be void GetOne(void) </nitpick> I would agree with your nitpick here, but C89 very specifically allows
On Sat, 31 May 2003 05:49:51 +0200 Philipp Thomas <philipp.thomas@t-link.de> wrote: this. However, this was a quick hack. My copy of the ANSI specification, section 3.7.1 defines this. Also look at footnote 79 that has a specific example of an empty parameter list. (Note that the ISO version of the spec may have a different section number. My copy of C98 is a draft copy and is not at my fingertips).
int main()
<nitpick> Same here, this should be int main (void) </nitpick> Main is rarely used with a void argument list, but I guess it is more correct to specify void.
And you should have added that on Linux this needs to be linked against libncurses to get the lowlevel termio functions. Not true. Termios(3) is not dependent upon libncurses at all. I think you are confusing termio with termios. Check the man page for termios. The termios functions are in libc. gaf@gaf:~/src> nm /usr/lib/libncurses.a | grep tcgetattr U tcgetattr Note that this is an external reference. gaf@gaf:~/src> nm /usr/lib/libc.a | grep tcgetattr U __tcgetattr tcgetattr.o: 00000000 T __tcgetattr 00000000 W tcgetattr U __tcgetattr
In this case, in libc, tcgetattr is a weak symbol and __tcgetattr is the actual function name. -- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9