Warnings to use Timelib.h instead of Time.h

mborgerson

Well-known member
These warnings started popping up in my generic data logger code after the install of Teenysduino 1.52. I finally tracked down the source of these warnings to the fact that SDFat 2.0b includes the fcntl.h header when SDFat is compiled. For the Teensy or other ARM CPUs, the USE_FCNTL_H variable in SDConfig.h is set to one so that some extended file opening #defines are included. The problem lies in the fact that, inside the ARM libraries, fcntl.h includes a call to Time.h. That generates the warning.

Apparently, the GCC libraries in the latests Teensyduino install still include and use Time.h. Will this still be the case with future versions of the ARM libraries?

I found that my logger code did not require the additional file opening options, so I just set USE_FCNTL_H to zero in SDConfig.h. My code seems to run fine without the extra #defines.
 
I could be wrong, but I don't think Teensyduino installs SDFat library. It does install SD library.

At least on my machine I only see the SD library installed in the Teensyduino area.
I normally install SDFat (or these more likely SDFat_bata from githib: https://github.com/greiman/SdFat-beta

If this is the case on your machine as well, you might first make sure you are up to date with his latest stuff and if you still see the warning messages you might create an issue on the appropriate github project.
 
I am using SDFat 2.0b. I installed the latest version today---which still wants to include Time.h somewhere in the Fcntl.h chain. Fcntl.h is used by default in SDIOConfig.h in SDFat 2.0b on ARM chips.

At this point I am unsure where the issue lies. Does the warning to use Timelib.h show up for all users of GCC Arm, or only for those of us with Teensyduino 1.52? If it shows up for all users of GCC-Arm, the issue would seem to be that the system libraries are still looking for Time.h. If the issue shows up only with Teensyduino 1.52, perhaps it is something in TeensyDuino that got overlooked because it is installing an older set of GCC libraries.
 
This was noted in other thread.
A warning was introduced in the TimeLib Time.h include file.
On windows this interferes with ALL time.h includes (note case of 't').

IMO, the TimeLib library was designed badly in the first place.

Workaround: Delete in TimeLib library the dummy library Time.h (which only includes TimeLib.h) and if you wanted the Arduino functionality of TimeLib include TimeLib.h
It is not to be expected that gcc libraries use Arduino functionality but only standard time.h definitions
 
Back
Top