Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!mcnc!decvax!decwrl!thundr.dec.com!minow From: minow@thundr.dec.com (Martin Minow THUNDR::MINOW ML3-5/U26 223-9922) Newsgroups: comp.lang.c Subject: re: pow() and exit() Message-ID: <8801091723.AA28950@decwrl.dec.com> Date: 9 Jan 88 20:01:00 GMT Organization: Digital Equipment Corporation Lines: 56 Commenting on the ongoing Standard discussion, Doug Gwyn asks for "good syntax for a built-in exponentiation operator." I don't see where one is needed. If contains #define pow(x,y) _pow(x,y) the syntax analyser/translator can recognize the _pow() and perform any in-line operations it deems appropriate. In his discussion on VMS's need to return different values to the operating system than on Unix, may I point out that the problem predates VMS -- C compilers were available on several PDP-11 operating systems, including RSX-11M and RT11, before the development of Vax C. There were (at least) three sources for such compilers, including the public-domain Decus C, first published in 1978. I have been writing portable C applications for at least 10 years. To solve the exit() argument problem, I include the following in my programs: #ifdef vms #include #include #define IO_SUCCESS (SS$_NORMAL | STS$M_INHIB_MSG) #define IO_ERROR SS$_ABORT #endif /* * Note: IO_SUCCESS and IO_ERROR are defined in the Decus C stdio.h file */ #ifndef IO_SUCCESS #define IO_SUCCESS 0 #endif #ifndef IO_ERROR #define IO_ERROR 1 #endif When I revise the Decus C toolkit to adapt it to the Ansi Standard, fixing exit() values will be the least of my worries. From Doug's posting: >>This is apt, since VMS caused the problem in the first place. >Actually, I agree with this, but since we found a solution that the >VMS folk could live with, why not stick with it. I would claim that the problem was caused, not by a specific operating system, but by people who put constant values into their programs. Kernighan and Plauger (A Manual of Programming Style) warned against this *many* years ago. That the developers of Unix didn't heed their collegues' warnings doesn't make them less relevant. Martin Minow minow%thundr.dec@decwrl.dec.com decvax!decwrl!dec-rhea!dec-thundr!minow The above does not reflect the position of Digital Equipment Corp.