From: dmak@dworkin.ccs.northeastern.edu (Dave Mak)
Subject: AmigaDOS vs. ANSI SAS implementation [Was Re: SAS C6.1 datecmp bug]
Reply-To: dmak@dworkin.ccs.northeastern.edu
Organization: College of Computer Science, Northeastern University
	<1992Dec21.030843.16107@bohra.cpg.oz.au> <BzMJJB.84z@unx.sas.com>
	<BznyFH.J3s@unx.sas.com>
Date: Fri, 25 Dec 1992 05:05:36 GMT

In article <BznyFH.J3s@unx.sas.com> walker@twix.unx.sas.com (Doug Walker) writes:

>In article <BzMJJB.84z@unx.sas.com>, jamie@cdevil.unx.sas.com (James Cooper) writes:
>|> Doug was correct.  Out of all those people, things can still slip past... for
>|> instance, one of the things fixed in 6.1 over 6.0 was not being able to compile
>|> with the F4 key in SE.  This was finally traced down to having the system
>|> WildStar bit turned on.  You might claim this is a common thing to do, but none
>|> of the Beta testers uses that bit, so it wasn't found until after release.

>...or if they do, they don't use SE, or if they do, they don't compile
>using F4, or if they do, they shrugged their shoulders when it happened
>and used right-Amiga-B instead.

>|> As for why it was broken when you got it... well, I don't know any programmers
>|> who use the ANSI functions unless they are porting code, and we've only had 3
>|> people complain about the datecmp() function so far... and all of the complaints
>|> were *after* 6.1 came out.  The function was there in 6.0, and hasn't been
>|> touched since, but we never knew there was a problem, so we couldn't fix it.

>Huh?  Many, many people use the ANSI functions.  datecmp() is not an
>ANSI function, however, it's an AmigaDOS function.  This is probably
>why it got by unnoticed.

Some people seem to be getting difftime and datecmp (two different functions)
confused, but this leads me to another question:

Forgive me if this shows off my ignorance in compiler design, but I'm curious
as to which routines are better performance wise.  AmigaDOS or their ANSI
equivalents?  Case in point: ANSI time routines vs. AmigaDOS stuff.  Is it a
simple programmer preference (portability bet. diff. systems vs. portability
bet. diff. Amiga compilers?) or are their performance differences?

Does clock() {ANSI} return a value based on the hardware clock less accurately
than the timer() {AmigaDOS} ignoring their return type differences?

>The bug was a simple = vs == typo in datecmp().  I have fixed it and
>the fix will be in 6.2.  I suggest coding a datecmp() yourself,
>it's pretty obvious how it has to work.  In fact, here it is:

>(Actually, assuming the fields in the DateStamp structure can
>never be negative, you could use a simple memcmp() on it...
>hmmm....)

Is this a hint on how you might optimize functions that do this?

>Right now, 6.2 is being held pending discovery of a weird memory-
>trashing bug on '040 machines that was introduced after 6.1 was
>shipped.  I apologize for the delay;  I'd love to be able to ship
>it right now, but until we locate this problem, we can't ship
>anything.

Just wanted to add my $.02 worth re: SAS/C v6.x.  After receiving version 6.0
in the mail as an upgrade, I was really impressed by the professional quality
of the package.  Admittedly, a lot of the major changes (ie: better Workbench
interface) was in 5.10b, but the new context sensitive help, EMITS tech.
support and performance improvements brings the premier Ami. C devel. package
just C++ shy from Borland C Pro. -- The top C devel. system for
MS-DOS/Windows.


>-- 
>  *****
>=*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
> *|. o.| ||                                          1200/2400/9600 Dual
>  | o  |//     For all you do, this bug's for you!
>  ====== 
>usenet: walker@unx.sas.com                            bix: djwalker 
>Any opinions expressed are mine, not those of SAS Institute, Inc.

--
============================================================================
REPLY TO: dmak@draper.com	OR	dmak@dworkin.ccs.northeastern.edu
============================================================================