Re: function question



Volker Birk <bumens@xxxxxxxxxxx> writes:

Rainer Weikusat <rweikusat@xxxxxxxxxxx> wrote:
Volker Birk <bumens@xxxxxxxxxxx> writes:
Bill Cunningham <nospam@xxxxxxxxxxxxx> wrote:
errno = 0;
You shouldn't set errno yourself. The behaviour is undefined.
Both C99 and UNIX(*) demand that errno 'expands to a modifiable lvalue
of type int'.

Yes, the old ones. Please read The Open Group Base Specifications Issue
7, IEEE Std 1003.1-2008.

Issue 7 says exactly "The symbol errno shall expand to a modifiable
lvalue of type int." That's close enough to what Rainer wrote not to
bicker about it.

--
Måns Rullgård
mans@xxxxxxxxx
.



Relevant Pages

  • Re: Understanding gdb
    ... It's rare that a library function would land up ... Most of them usually set errno to some value and return ... > returns an 'int' and every possible integer value is a legal, ... And one more thing - can anyone guess why this particular function sqrt does not ...
    (comp.os.linux.development.apps)
  • Re: detab utility challenge.
    ... int exptab(size_t n, const char *path) ... fopen is not required to set errno. ... int main(int argc, char *argv) ...
    (comp.lang.c)
  • Re: function question
    ... You shouldn't set errno yourself. ... of type int'. ... Please read The Open Group Base Specifications Issue ...
    (comp.unix.programmer)
  • Re: function question
    ... You shouldn't set errno yourself. ... of type int'. ... Please read The Open Group Base Specifications Issue ...
    (comp.unix.programmer)