Skip to content

Case Sensitivity Conflicts between time.h & Time.h #16

@adamgarbo

Description

@adamgarbo

Hi there,

I discovered today, when migrating my code over to version 2.0 of the IridiumSBD library, that if you have Paul Stoffregen's Time library installed, you may encounter problems when attempting to compile your code while using case sensitive filesystems like macOS.

This appears to be due to the fact the Paul has a Time.h file included in his library that conflicts with the POSIX time.h library included by IridiumSBD.cpp. It seems users of the RTCZero library have also experienced this problem. Since Paul will be keeping this file to preserve compatibility with older versions of Arduino, the solution appears to be to simply delete the Time.h file from your /libraries/Time/ folder.

I'm wondering if it may be worthwhile to implement some form of check that the IridiumSBD library could perform to ensure it is compiling with the correct time.h?

For reference, the error messages I received when attempting to compile with Paul's Time.h file present in my library are:

/Users/adam/Documents/Arduino/libraries/IridiumSBD-2.0/src/IridiumSBD.cpp: In member function 'int IridiumSBD::getSystemTime(tm&)':
/Users/adam/Documents/Arduino/libraries/IridiumSBD-2.0/src/IridiumSBD.cpp:203:14: error: aggregate 'tm epoch_start' has incomplete type and cannot be defined
    struct tm epoch_start;
              ^
/Users/adam/Documents/Arduino/libraries/IridiumSBD-2.0/src/IridiumSBD.cpp:223:43: error: 'mktime' was not declared in this scope
    time_t epoch_time = mktime(&epoch_start);
                                           ^
/Users/adam/Documents/Arduino/libraries/IridiumSBD-2.0/src/IridiumSBD.cpp:225:30: error: 'localtime' was not declared in this scope
    memcpy(&tm, localtime(&now), sizeof tm);
                              ^
/Users/adam/Documents/Arduino/libraries/IridiumSBD-2.0/src/IridiumSBD.cpp:225:40: error: invalid application of 'sizeof' to incomplete type 'tm'
    memcpy(&tm, localtime(&now), sizeof tm);
                                        ^

Cheers,
Adam

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions