Cannot name a variable "time" on Linux

Reporter: tgdc  |  Status: open  |  Last Modified: November 22, 2018, 01:03:28 AM

In file included from SHELLmain.cpp:106:0:
/home/user/.enigma/Preprocessor_Environment_Editable/IDE_EDIT_objectfunctionality.h:2590:15: error: invalid conversion from ‘time_t ()(time_t) throw () {aka long int ()(long int) throw ()}’ to ‘int’ [-fpermissive]
if((timer > time))
rm -f /home/user/.enigma/.eobjs/Linux/Linux/GNU_GCC_G++/Run/Universal_System/loading.o /home/user/.enigma/.eobjs/Linux/Linux/GNU_GCC_G++/Run/Universal_System/Extensions/MotionPlanning/motion_planning.o
make[1]: Leaving directory '/home/user/enigma-dev/ENIGMAsystem/SHELL'
Makefile:19: recipe for target 'Game' failed
make: *** [Game] Error 2
This is a piece of GML from your project that was converted to C++.

if((timer > time))

You could try changing the names of the "time" variable because ENIGMA may be confusing it with the C++ time type, as indicated by the error message. It would also be helpful to see a larger piece of the script/GML code if you could provide it.


Ok, I can't reproduce this on Windows but I asked Josh who kindly pointed it out to me that time happens to be a function on Linux but not Windows. So it's complaining that it can't cast time to an int because it's a function pointer. We'll look at getting this fixed, for now you can work around it by renaming your time variable.

In the interim, you can work around this by declaring time as a local, explicitly, (local int time;) or by using a different name.
Please sign in to post comments, or you can view this issue on GitHub.