time(0L) - history of a misconception

L. Hirschbiegel lothar at tmcsys.UUCP
Sat May 25 06:13:27 AEST 1991


>This just proves that on your particular OS at some particular release
>level and version with some particular version of gcc, it happens to
>work.  In general, portable code must assume time(0L) won't work.

To come to an end with this really annoying 'discussion' please accept
the following statement:
the whole thread of time(0L) vs. time((long *)0) was about
the **Intel i386 processor** running under **ISC/SCO-UNIX** (Martin 
Weitzel's posting as a reply and my own followup).
I didn't intend to crosspost this to com.lang.c but it happened somehow.
This admittedly gave it a different kind of taste... 
I did not even realize this was also in comp.lang.c (thanks, steve, for the
warning!).
Since I had included assembler output for the i386 and also a part of
the SysV/386 man page for 'time' I thought it would be clear what I was talking
about. It was also obvious from the subject line about SCO-UNIX.
It was most interesting to see, how some people declared my included
assembler listing as "irrelevant", thus pushing the topic to a level
of abstraction it was never ment to be. It was EXACTLY for i386 assembler
on a box running UNIX, nothing else.
If you can't find a reason to flame - just create one...
Now everybody is telling me this will not run on an 8086, i286 or some kind
of superprocessor with 124 bit pointers and 12 bit longs. Thanks for the help!
One guy (forgot the name, but he must have been recently out of school, 'cause
he still was arguing with me about his math teacher) even proved it doesn't
work on a PDP11. 
Quite irritating, since nobody claimed it would run on a PDP11.
Nice proof, anyway. My own proof was (only!) for the i386 under ISC-UNIX - 
my fault that I didn't state it loud n'clear enough in my original posting.

One can of course argue about what people think is "good programming
practice", but that's different from saying "you don't know what you are
talking about" or "you fool think your unix box is the center of the
world". At least in my opinion.

So, *please stop* sending me any more hate mail. I'm already enlighted as
a "junior programmer" (this was one of the more modest things I received
by mail; some nice guys hanging around here).

-- 
-----------------------------------------------
L. Hirschbiegel, AEG - A84, Frankfurt (Germany) 
email: unido!aega84!lh     tel: -49-69-66414316  
-----------------------------------------------



More information about the Comp.lang.c mailing list