Skip to content
  • divverent's avatar
    Another flag bites the dust. This time: -ffinite-math-only. · 83bdd427
    divverent authored and Rudolf Polzer's avatar Rudolf Polzer committed
    Since GCC 5, with this flag set, NaN compares equal to zero in some cases but
    not others. Causes e.g. "attempted division by zero" error spam from this QC
    code:
    
    float x = nan("");
    if (x == 0) {
      return 0;
    }
    return 1.0 / x;
    
    Yes, those NaNs should not be happening in the first place, but suddenly
    passing some but not all equality checks to zero seems rather dangerous.
    
    Reference: issue #2412 (not a fix for it; the QC code has a problem too but
    this change helps track it down properly).
    
    git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12522 d7cf8633-e32d-0410-b094-e92efae38249
    ::stable-branch::merge=f96918f0
    83bdd427