bug-bash
[Top][All Lists]
Advanced

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

Re: bug: return doesn't accept negative numbers


From: Linda Walsh
Subject: Re: bug: return doesn't accept negative numbers
Date: Mon, 08 Aug 2011 14:04:40 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666



Bob Proulx wrote:
Linda Walsh wrote:
Bob Proulx wrote:
Exit codes should be in the range 0-255.
---
        I suppose you don't realize that 'should' is a subjective opinion that
sometimes has little to do with objective reality.

Sigh.  Okay.  Keep in mind that turn about is fair play.  You are
giving it to me. Please be gracious on the receiving end of it.
---
        I *do* love it!   I strive vociferously, to not be hypocritical,
so what I put out, feel free to give back -- where I get in trouble, is
that is how I operate with other people (not from the start, but given time,
I start reciprocating their behavior and language toward me...)

        Mirroring, or adopting another's form of address/speech, etc, is
usually considered a good thing to develop rapport, (Ha!)... -- expcept
when the other person is being a jerk!...then it causes problems...

        Unfortunately unless I catch myself, 'mirroring' is almost
unconscious for me.  But it works to my disadvantage as often or more
so in society these days (with everyone being so 'friendly' by default [not!]).

        So try to buffer and average input and start from a 'positive'
friendly point -- things go up or down from there.


You
do realize that you should comply with documented interfaces.  Why?
Because that is the way the interface specification is documented.  If
you want things to work easily then most generally the easiest way is
to follow the documented practice.  Unless you have an exceptional
reason for doing something different from the documented interface
then actively doing anything else is actively trying to be broken.
----
        Ok, lets look at what you say below...


POSIX was intended to document
the existing behavior so that if you followed the specification then
you would have some hope of being able to run successfully on multiple
systems.  And it was intended to curb the differences from becoming
greater than they were already.  It tries to reign in the divergent
behaviors so that there won't be more differences than already exist.

This is what POSIX says about it:

  void exit(int status);

  The value of status may be 0, EXIT_SUCCESS, EXIT_FAILURE, or any
  other value, though only the least significant 8 bits (that is,
  status & 0377) shall be available to a waiting parent process.

====
        Exactly!.

        'int status' means it takes a 'signed' value.  It will and it
with 0377, given, but the *input* allows positive and negative numbers.
Then they will be masked to 8 bits.

        That's all I'm asking for.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]