Forum > Operating Systems

Inconsistency between Windows and Linux compiling?

<< < (4/5) > >>

Laksen:

--- Quote from: Zoran on July 03, 2011, 12:23:19 pm ---Does not work. Setting the ExceptionMask to empty set in program start creates many new exceptions and the application crashes.

--- End quote ---
Masking something means you don't want it to throw exceptions. So when you provide an empty exception mask it'll throw exceptions for every bad operation :)

If you set the mask to [exInvalidOp,exZeroDivide] then it won't throw exceptions when those things occur

Zoran:

--- Quote from: Laksen on July 03, 2011, 12:36:33 pm ---
--- Quote from: Zoran on July 03, 2011, 12:23:19 pm ---Does not work. Setting the ExceptionMask to empty set in program start creates many new exceptions and the application crashes.

--- End quote ---
Masking something means you don't want it to throw exceptions. So when you provide an empty exception mask it'll throw exceptions for every bad operation :)

If you set the mask to [exInvalidOp,exZeroDivide] then it won't throw exceptions when those things occur

--- End quote ---

Okay, it certanly is a logical explanation. :)
However, I still find that this is not easy to control, I believe that this floating point behavior should be consistent on all platforms and widgetsets, I mean that it must be known what the default is and programmer should not set this exception mask depending on widgeset/OS, unless (s)he explicitely wants non-default behavior, don't you agree? So, I am going to make a bug report about this.

Thank you, Laksen.

Zoran:
I created bug report: http://bugs.freepascal.org/view.php?id=19674

Zoran:
This simple test:

--- Code: ---uses
  ... math,...

var
  FPUException: TFPUException;
  FPUExceptionMask: TFPUExceptionMask; 
begin
  FPUExceptionMask := GetExceptionMask;
  writeln('Masked:');
  for FPUException := Low(TFPUException) to High(TFPUException) do begin
    if FPUException in FPUExceptionMask then begin
      write(' ', FPUException);
    end;
  end;
  writeln;
  writeln('Not masked:');
  for FPUException := Low(TFPUException) to High(TFPUException) do begin
    if not (FPUException in FPUExceptionMask) then begin
      write(' ', FPUException);
    end;
  end;
end; 

--- End code ---
gives this output when we don't use Gtk2:

Masked:
 exDenormalized exUnderflow exPrecision
Not masked:
 exInvalidOp exZeroDivide exOverflow

With Gtk2, only exOverflow is not masked.

Vincent Snijders:
Nice write up in the wiki.  :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version