This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: getopt() argument permuting considered risky
Måns Rullgård <mru@kth.se> wrote:
> prj@po.cwru.edu (Paul Jarc) writes:
>> That's a good thing: the program expects a certain behavior; the
>> behavior is unavailable on that platform; the problem is detected at
>> compile time.
>
> No, it's the user who expects that behavior.
It's the caller that expects a particular behavior, but the caller is
not always a user. If a program is documented as using the getopt
interface, then a script invoking that command may expect POSIX
behavior. When the program and script are moved to a new platform,
it's nice if the problem can be detected at compile time.
I'm not arguing for changing glibc now - that would just trade one
incompatibility for another - but in general, it's certainly good to
avoid introducing such problems in the first place by introducing new
behavior under new names.
"Change the name if you change the specification."
-- Brian W. Kernighan & Rob Pike, The Practice of Programming
paul