mirror of
https://github.com/ldmud/ldmud
synced 2026-08-12 14:26:05 -04:00
Floats historically are always interpreted as true (only the integer zero will be considered false), so even if 0.0 compares equal to (int)0 it is not seen as false. This may be counter-intuitive. Therefore warn about float values used as a condition when pragma warn_deprecated is in effect. (Resolves #780)
13 lines
162 B
C
13 lines
162 B
C
#pragma warn_deprecated
|
|
|
|
int fun(float var)
|
|
{
|
|
if (var)
|
|
return 1;
|
|
return -1;
|
|
}
|
|
|
|
int run_test()
|
|
{
|
|
return __MASTER_OBJECT__.warning_occured();
|
|
}
|