Re: compilation on different machines led to different executables



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
.



Relevant Pages

  • Re: COBOL Compiler for Windows
    ... setting Windows Compatibility mode to NT? ... The package is aimed at any platform that runs CICS, ... So the V2.2 compiler I have performs two functions, ... executables for the online Cobol/CICS pgms that my software generates. ...
    (comp.lang.cobol)
  • Re: Question on multiple compiler environment
    ... number of a compiler in executables generated by it? ... If Windows has anything like make you could have a make target for the ... the compiler version command in an include file, ... have similar keyword expansion features. ...
    (comp.lang.fortran)
  • Re: Difference between Portable Executable (PE) file and a Assembl
    ... >I assume that JIT compiler and Ilasm.exe convert the IL code into machine ... >> format used to define 32bit Windows Executables. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Difference between Portable Executable (PE) file and a Assembl
    ... >>I assume that JIT compiler and Ilasm.exe convert the IL code into machine ... >>> format used to define 32bit Windows Executables. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Is a General File Maintenance Routine possible?
    ... > A generalized program cannot rely on the compiler to setup its file IO ... > relative key is relative-key ... > the copybook and my executable. ... the executables for the system. ...
    (comp.lang.cobol)