I am working on a project for embedded control for a device I am looking at selling. The device would include control based on time, and due to the nature of the product I anticipate it will just sit in the background doing it’s thing for years without customer interaction.
I have been using Time.now() to get the UnixTIme and put this into an unsigned integer for use by my program. The issue I am having is that I am now looking at the compiler warnings and it is saying that I am doing improper comparisons later in my code when I compare the unsigned Integer with Time.now(). From this, it looks like that Time.now() is returning an unsigned int.
Looking at the code, it appears that the type is defined as time_t, but unfortunately I have not yet been able to find the definition of time_t.
For me, using a signed integer means that the product will stop working in 2038, or in about 24 years. I know that might sound a long way away, but I would prefer not to build in issues like that into a product that I am hoping will still be working after that time. The issue for me is that my product would be wired into a permanently wired appliance in the house and I am guessing that at least 25% of devices will still be in service after that time.
I know this is not a high priority to fix, but it should probably be added to the list.