Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: TimLib.h vs. Time.h

  1. #1

    TimLib.h vs. Time.h

    After a recent update to PlatformIO, I started getting this compiler warning:
    In file included from /Users/keith/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/sys/stat.h:9:0,
    from /Users/keith/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/sys/_default_fcntl.h:188,
    from /Users/keith/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/sys/fcntl.h:4,
    from /Users/keith/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/fcntl.h:1,
    from .pio/libdeps/teensy40/SdFat/src/FatLib/FatApiConstants.h:30,
    from .pio/libdeps/teensy40/SdFat/src/FatLib/FatFile.h:36,
    from .pio/libdeps/teensy40/SdFat/src/FatLib/ArduinoFiles.h:33,
    from .pio/libdeps/teensy40/SdFat/src/FatLib/FatLib.h:27,
    from .pio/libdeps/teensy40/SdFat/src/SdFat.h:33,
    from include/SdFileMgr.h:2,
    from src/ScriptMgr.cpp:4:
    /Users/keith/.platformio/packages/framework-arduinoteensy/libraries/Time/time.h:1:2: warning: #warning "Please include TimeLib.h, not Time.h. Future versions will remove Time.h" [-Wcpp]
    #warning "Please include TimeLib.h, not Time.h. Future versions will remove Time.h"
    I'm not using either of these libraries, but it looks like Time.h is being referenced by SDFat; am I reading that correctly? Does that mean SdFat will stop working if it isn't updated? I think I saw in another post that the future if SdFat support is questionable (maybe I misinterpreted that). I don't really need the performance of SDFat or all the capabilities, so should I just switch to Sd.h? Thanks!

  2. #2
    Senior Member
    Join Date
    Jul 2014
    This is an Arduino problem not a SdFat problem.

    For some reason the Arduino people accepted the TimeLib library with inside a Time.h file, that now only calls TimeLib.h (and gives the warning you reported). There is a toolchain level include file 'time.h' which on linux os has a distinct filename but not on Windows systems.
    Here you see that 'time.h' is called from toolchain, but Arduino is finding 'Time.h' and includes the wrong file.

    Best is to remove the file 'Time.h' inside the TimeLib library.
    Only side-effect is that some 'wrong-written' Arduino libraries may need to be modified to include 'TimeLib.h' and not 'Time.h'. But this can be handled from case to case.

    In how far Bill is really stopping support of SdFat and this is not taken on by someone else, needs to be seen.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts