A type not comparable with itself?

Running this script:

time_t t;
int tb = (t == t);

produces this message:

*ERROR Line 2: Types not compatible in comparison.

I find this surprising. How can a variable of some type not be compatible for comparison with another variable of the same type, particularly when the underlying type is an int-like type? :thinking:

The obvious workaround is to cast both occurrences of t in line 2 to, say, int32.

A library function int CompareTimeT( time_t, time_t) would completely avoid cast.

Another workaround is to write one’s own function to do such a comparison:

int CompareTimeT( time_t tX, time_t tY)
{
    return ( (int) tX - (int) tY );
}

A minor suggested enhancement: Add a library function such as int CompareTimeT( time_t, time_t);

This would allow the user to completely avoid the use of cast for such comparison, thereby tidying up his code.

I’m running 010 Editor v16.0.4 (ARM 64-bit) on macOS 26.5.2 (25F84).