From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f8a1,e7e13c943c611b62 X-Google-Attributes: gid10f8a1,public X-Google-Thread: 1164f8,be3d6a6131c61fa7 X-Google-Attributes: gid1164f8,public X-Google-Thread: 102b75,be3d6a6131c61fa7 X-Google-Attributes: gid102b75,public From: Eric Hildum Subject: Re: Did Intel pay UGS to kill Alpha port? Or Compaq simply doesn't care? Date: 1999/04/19 Message-ID: <371A83EA.80255C62@Japan.NCR.com>#1/1 X-Deja-AN: 468121052 Content-Transfer-Encoding: 7bit References: <36E9F2A0.9A401A09@pacific.net.sg> <7cj96m$h07$1@plonk.apk.net> <7eih45$ln2$1@news.doit.wisc.edu> X-Accept-Language: en,ja Content-Type: text/plain; charset=iso-2022-jp Organization: NCR Japan MIME-Version: 1.0 Newsgroups: comp.arch,comp.sys.dec,vmsnet.alpha On VMS the error number returned in a 32 bit value was actually a bit structure. three bits were allocated for the type of "error" with a very specific definition. Another group of bits was allocated to indicate the facility originating the error (standard library code, IO system, etc.) and the remainder the actual error number itself. I always found the discipline of correctly classifying the return values helpful in designing the code; they were: Success - the operation had a correct result. Informational - the operation had a correct result, and the message indicates additional information. Warning - the operation had a correct result, but a correctable error occured during the operation Error - an error occured during the operation. The operation completed, but the results may not be correct. Fatal Error - an error occured during the operation, and continued execution is not possible. The message values and associated text were built by an internal tool (SDL) and linked in as an additional object module - the same tool was used to build all the different header files (C, Pascal, etc.) used to support the different compiler environments. For some reason this does not seem to be a popular way of classifying errors; the UNIX and Windoes style of everything is fatal and the OS will simply give up with minimal or no useful information in case of an exception seems to be most popular. This is the reason, I think, that most UNIX and Windows code (and code developed by people initial trained on UNIX or Windows) is so delicate and bug prone. Zalman Stern wrote: > Maynard Handley (handleym@ricochet.net) wrote: > : As I pointed out elsewhere, that's irrelevant when you are making calls > : into the OS and problems are returned via error numbers. Unless, I guess, > : you put a wrapper around every such call throwing an error, which is > : basically identical to my scheme. > > Yes, though many C++ zealots do this. (Or use standard library facilities > which signal errors via exceptions.) Point being that they can get the > benefit of a debug trace on any error in at least one widely used > programming style. > > All I'm arguing for is trying to make the tools provide the support instead > of doing it in an ad hoc fashion all over the place. And I've offered some > evidence that this is indeed possible. Even if you want to stick with the > basic return an error code mechanism. Of course unless this happens in some > semi-standard way, it won't be very useful. Perhaps the next round of C > standardization can put in a non-C++ like exception mechanism. > > (Another thing that would be incredibly useful is if the debugger always > knew the textual mapping of error code values. This is not so bad on the > Mac or UNIX as OS error codes are small integers and declared in one file. > But Windows error codes are not small integers and I find the tools for > converting them to something readable inadequate. Though I do recall some > new tool being added to VC++ 6. Windows error codes are a vaguely like on > VMS, but I recall always having a text catalog for the error messages when > I worked on VMS and I think the debugger had a feature to do the lookup. > > We can also talk about library support for taking a stack trace and writing > it to an output stream. Somehow no matter how hard I try, my bugs crawl > onto someone else's machine and its not always possible to have them drive > a debugger for me...) > > -Z- -- --------------------------- Eric Hildum Eric.Hildum@Japan.NCR.COM