delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/09/07:53:19

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: expression evaluation guarantees
Date: Fri, 08 Aug 1997 11:42:57 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 36
Message-ID: <33EB0641.4D5A@cs.com>
References: <33EADE57 DOT F93 AT pentek DOT com>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp208.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Charles Krug wrote:
> 
> To those of you who bit my head off (OUCH) consider the following, which
> came up last week:
> 
> if ((get_user_response()) && (format_hard_drive()))
>         printf("Hard drive formatted");
> 
> Are you willing to bet your hard drive that your compiler is ANSI
> complient?

Let me put it this way:

- If your compiler does not claim to be ANSI compliant, then nothing
like this is safe.
- If your compiler does claim to be ANSI compliant, and this doesn't
work as intended, then you can sue the company that makes it for
zillions of dollars.
- Anybody who runs a program capable of formatting the hard drive
without ensuring that all necessary data is backed up is an idiot.
- No sane person would ever write a format program like that.

Since the order of logical operations is an absolute requirement of the
C language, there is no point to be made by asking what would happen if
it wasn't.  It's like that stupid "what if we could attain the speed of
light" thread that was going around not long ago.

P.S.:  The first person to actually start that thread again because I
mentioned it will be slapped with a wet trout.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I |     mailto:fighteer AT cs DOT com      |
| Proud owner of what might one   |   http://www.cs.com/fighteer    |
| day be a spectacular MUD...     | Plan: To make Bill Gates suffer |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019