Re: compilation on different machines led to different executables
- From: Tim Prince <timothyprince@xxxxxxxxxxxxx>
- Date: Mon, 30 May 2005 18:35:58 GMT
bau12374 wrote:
> I was provided with the source code and the executable of a numerical
> model, which I have to use for my studies.
>
> After compiling the code on my machine I tried to run the executable.
> Unfortunately, it stopped due to a "division by zero" forced by a
> mistake in the code for special input values equal zero. I do not
> encounter this problem with the original executable, although it is
> based on the very same code.
>
> Can anyone provide me with an explanation - given the code, compiler
> and compiler flags being the same -
> 1) why the original executable somehow handles the error (division by
> zero should always lead to an abort) and
> 2) why there are different executables when compiling it on different
> machines (both windows)?
> Solutions or Workarounds are welcome, but I'm mainly interested in a
> general explanation.
>
>
Without more detail, I doubt you will get a satisfactory answer. Certain
compilers could choose optimization for the style of CPU detected at
compile time, or even provide for multiple code execution paths for
differing CPUs, so you will have to look up the options of your compiler.
There isn't a generally accepted model for dealing with division by zero on
Windows, other than to use the default IEEE floating point model.
--
Tim Prince
.
- References:
- Prev by Date: Re: Book on low level program optimization
- Next by Date: Re: My philosophy
- Previous by thread: compilation on different machines led to different executables
- Next by thread: calling Microsoft PlaySound routine from CVF
- Index(es):
Relevant Pages
|
|