🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4474

Re: Can longjmp modify errno?

#4474
From: Dan Pop
Date: Thu, 14 Dec 1995 18:16
37 lines
1360 bytes
>> However, errno is an lvalue, and the object designated by this lvalue
>> is definitely accessible.
>
>But "the object" may be a different object at a different time.
>
>> So, ISO 7.6.2.1 applies.
>
>So, it doesn't.

Even if it is a different object at a different time, this should be
transparent to a conforming program.  Consider this example:

#imclude <errno.h>
#include <stdlib.h>

void blah(int i)
{ 
    errno = i;
}

int main(void)
{
    int i = 3;
    blah(i);
    if (i == errno) return EXIT_SUCCESS;
    return EXIT_FAILURE;
}

Is this code allowed to return an unsuccessful termination status to
the host environment?

Dan
--
Dan Pop
CERN, CN Division
Email: danpop@mail.cern.ch 
Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
Technical Details
Message-ID: <danpop.818964974@rscernix>
Path: arc1-ca.pugleaf.net!CERN.ch!rscernix!danpop
References: <DJEADH.HwC@nntpa.cb.att.com> <30cd018a.13538688@nntp.ix.netcom.com> <1995Dec12.185335.8791@sq.com> <danpop.818847488@rscernix> <1995Dec13.233015.28627@sq.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!CERN.ch!rscernix!danpop
From: danpop@mail.cern.ch (Dan Pop)
Subject: Re: Can longjmp modify errno?
X-Nntp-Posting-Host: ues5.cern.ch
Message-ID: <danpop.818964974@rscernix>
Sender: news@news.cern.ch (USENET News System)
Organization: CERN European Lab for Particle Physics
X-Newsreader: NN version 6.5.0 #7 (NOV)
References: <DJEADH.HwC@nntpa.cb.att.com> <30cd018a.13538688@nntp.ix.netcom.com> <1995Dec12.185335.8791@sq.com> <danpop.818847488@rscernix> <1995Dec13.233015.28627@sq.com>
Date: Thu, 14 Dec 1995 18:16:14 GMT