Date: Fri, 8 Jan 1999 03:46:44 +0900 (JST) From: dcs@newsguy.com To: FreeBSD-gnats-submit@FreeBSD.ORG Cc: dcs@newsguy.com Subject: misc/9373: Incomplete include file Message-ID: <199901071846.DAA03169@local.ocn.ne.jp>
next in thread | raw e-mail | index | archive | help
>Number: 9373 >Category: misc >Synopsis: Getopt external variable is not declared >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 7 11:00:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: Daniel C. Sobral >Release: FreeBSD 3.0-CURRENT i386 >Organization: >Environment: Current and, possibly, stable, though the patches below also include current's libstand. >Description: POSIX introduced optreset to deal with multiple invocations of getopt (as in, multiple input lines :). This is documented in the man page and is used in the code, but unistd.h and stand.h do not declare it. Incidentally, it prevents me fixing a bug in loader's code... :-) >How-To-Repeat: If you are using "loader", try: ls -? /kernel load /kernel >Fix: Apply the following patches (notice that I don't know if my placement of optreset in unistd is in the appropriate place): --- include/unistd.h.orig Fri Jan 8 03:31:10 1999 +++ include/unistd.h Fri Jan 8 03:31:41 1999 @@ -199,6 +199,7 @@ void *valloc __P((size_t)); /* obsoleted by malloc() */ pid_t vfork __P((void)); +extern optreset; /* getopt(3) external variable */ extern char *suboptarg; /* getsubopt(3) external variable */ int getsubopt __P((char **, char * const *, char **)); #endif /* !_POSIX_SOURCE */ --- lib/libstand/stand.h.orig Fri Jan 8 03:33:45 1999 +++ lib/libstand/stand.h Fri Jan 8 03:35:04 1999 @@ -220,7 +220,7 @@ extern long strtol(const char *, char **, int); extern char * strerror(int err); extern char *optarg; /* getopt(3) external variables */ -extern int optind, opterr, optopt; +extern int optind, opterr, optopt, optreset; extern int getopt(int, char * const [], const char *); /* pager.c */ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901071846.DAA03169>