default parameter (single = NaN) not allowed
Original Reporter info from Mantis: demerson3
-
Reporter name: David Emerson
Original Reporter info from Mantis: demerson3
- Reporter name: David Emerson
Description:
After upgrading 2.6.4 -> 3.0.0 I'm getting an...
Error: function header doesn't match the previous declaration
for a (non-method) function that does exactly match its previous declaration:
function make_scale_matrix (zx:single; zy:single=NaN):t_2d_affine;
Steps to reproduce:
in a unit's interface, declare a function with a floating point default parameter = NaN
copy/paste the function interface to implementation.
Additional information:
Jonas says,
It's probably due to a peciularity of the "NaN" value itself: if you ask a floating point unit to compare NaN with NaN, the returned result must always be "not equal" even though the bit patterns match exactly. To fix this, the compiler will have to compare the bit patterns of floating point default parameters rather than their values as floating point numbers.
Mantis conversion info:
- Mantis ID: 30299
- OS: Debian Linux
- OS Build: 7
- Build: release, 2015/12/05
- Platform: amd64
- Version: 3.0.0
- Fixed in version: 3.1.1
- Fixed in revision: 34597 (#94d7a727)