Re: [PATCH] parse-options: fix the description of defval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sun, Mar 29, 2015 at 5:28 PM, Ivan Ukhov <ivan.ukhov@xxxxxxxxx> wrote:
> I have checked the definitions of the three macros you mentioned, and it seems that none of them uses defval to store pointers. OPTION_CMDMODE stores chars and integers. OPTION_STRING does not use defval at all (pointers go in a different field of the option struct), and the same applies to OPTION_FILENAME. I am probably missing something; can you please clarify what you mean? Thank you.

For OPTION_STRING, if the PARSE_OPT_OPTARG flag is set (as the
documentation already states), the option can be provided on the
command line without any corresponding argument. If provided as so,
the string pointer of defval is used.

See get_value() in parse-options.c

I haven't used the other option types before yet (just did a grep
'defval' in parse-options.c) so I don't know what they do with defval.
That's why it would be nice if they were documented :-)

Regards,
Paul
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]