Follow-up Comment #24, bug #67612 (group groff):

[comment #23 comment #23:]
> Currently, usage() takes ones parameter, $had_error, which is passed
> unchanged to exit().  The comment #22 patch appears to change usage() to
> treat its parameter as a boolean instead of an exit value:

> -    exit($had_error);
> +    exit($had_error ? 2 : 0);


...ah.  With a name like `had_error`, I assume that this scalar was of Boolean
sense.

Perl, like C before it and C++ alongside it, has shown a stubborn reluctance
to embrace an explicit Boolean type.

https://perlmaven.com/boolean-values-in-perl

> while simultaneously changing one of the usage() call sites to pass what
> looks like a specific exit value:

> -    &usage(1);
> +    &usage(2);


> Either of the above two changes by itself would change the exit value from 1
> to 2, so one of the changes appears to be unnecessary.

Right.

> If this isn't an error, it begs for an explanatory comment.

I'll give it one.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67612>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to