delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/15/03:44:03

Date: Fri, 15 Jun 2001 10:42:24 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Mark E." <snowball3 AT bigfoot DOT com>
Message-Id: <3028-Fri15Jun2001104224+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9
CC: djgpp-workers AT delorie DOT com
In-reply-to: <3B28F8FD.8890.1095C9@localhost> (snowball3@bigfoot.com)
Subject: Re: getconf v2
References: <3B28F8FD DOT 8890 DOT 1095C9 AT localhost>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Mark E." <snowball3 AT bigfoot DOT com>
> Date: Thu, 14 Jun 2001 17:48:45 -0400
> 
>       case 'v':
>       {
>         const char *spec = optarg;
>         const int num_specs = sizeof(conf_specs) / sizeof(conf_specs[0]);
>         int i;
>         
>         for (i = 0; i < num_specs; ++i)
>         {
>           if (strcmp (spec, conf_specs[i]) == 0)
>             break;
>         }
>         if (i == num_specs)
>         {
>           fprintf(stderr, "undefined specification\n", spec);
>         }

Shouldn't the output be just "undefined\n"?  That's what the Posix
draft I have seems to indicate.  Or is there a new draft?

Also, for this to work as Posix requires, I think we need an
additional element in var_list[] which says something like this:

  { "_POSIX_V6_ILP32_OFF32", 0, constant_var }

because Posix says "getconf _POSIX_V6_ILP32_OFF32" should not print
"undefined\n" or "-1\n" if "-v POSIX_V6_ILP32_OFF32" is supported.
(The `0' in that line is arbitrary; any other suggestions?)

> static void
> usage(void)
> {
>   fprintf(stderr, "Usage: getopt [-h] [sysvar] [pathvar path]\n");
>   exit(1);
> }

This should mention -v.

Also, both usage() and help() should talk about getconf, not getopt ;-)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019