Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!hplabs!hpda!hp-sde!hpfcdc!rml From: rml@hpfcdc.HP.COM (Bob Lenk) Newsgroups: comp.std.c Subject: Re: casting int constants to pointers (was: switch (expression)) Message-ID: <12040001@hpfcdc.HP.COM> Date: 18 Jul 88 22:13:49 GMT References: <5153@haddock.ISC.COM> Organization: HP Ft. Collins, Co. Lines: 20 > >[sbrk(), as well as shmop(), returns (char *)-1 on error] > > Neither sbrk() nor shmop() is part of the ANSI C library. I hope POSIX will > fix this. The 1003.1 standard includes neither sbrk() nor shmop. Sbrk() is unlikely to be covered by any standard, since nothing beyond malloc() can be defined portably or is needed for portable code (even the SVID omits sbrk() for this reason). The 1003.4 (real-time extensions to 1003.1) standard will include functionality similar to shmop, but probably not the same interface. The function similar to shmat() is currently defined to return NULL on error; in any case a non-portable cast to a -1 will never be required. One function that did require changing before inclusion in a consensus standard is signal() in ANSI C. It is defined to return SIG_ERR, and the SVID has followed this direction. Bob Lenk {ihnp4, hplabs}!hpfcla!rml rml%hpfcla@hplabs.hp.com