On Tue, 2008-06-17 at 07:02 +0200, Quentin Mathé wrote: > However I get a warning about getopt() being an implicit function. In > fact, the function doesn't seem to be declared directly in unistd.h as > expected, and the man page doesn't mention any preprocessor variables > to define in addition to unistd.h include. If somebody knows where the > problem lies, let me know :-)
What's your dev platform? If you're on something weird/old, stdio.h might have it, or you have to include getopt.h directly. On my Gentoo setup with glibc-2.5, unistd.h includes getopt.h ifdef'd on a declaration of POSIX v2. GCC uses C extensions that don't conflict with ANSI C -- I believe POSIX v2 is in this category. The example program on the man page "just works." FreeBSD declares it in both unistd.h and getopt.h; the latter is for compatibility with GNU programs which include getopt.h directly. HTH, Sourav _______________________________________________ Etoile-discuss mailing list [email protected] https://mail.gna.org/listinfo/etoile-discuss
