Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddsi_time_t.seconds should be uint32_t #2180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

binbowang1987
Copy link

ref DDSI-RTPS 9.3.2.1 IDL Definitions

struct Time_t {
  unsigned long seconds; // time in seconds
  unsigned long fraction; // time in sec/2^32
};

@binbowang1987 binbowang1987 force-pushed the master branch 3 times, most recently from 79e587e to 81d33f7 Compare February 20, 2025 12:31
ref DDSI-RTPS 9.3.2.1 IDL Definitions
struct Time_t {
  unsigned long seconds; // time in seconds
  unsigned long fraction; // time in sec/2^32
};

Signed-off-by: binbowang <[email protected]>
@binbowang1987
Copy link
Author

binbowang1987 commented Feb 20, 2025

@eboasson
when encounter this timestamp, it will be overflowed and cause cxx version to throw exception.

void dds::core::Time::sec(int64_t s)
{
    if(s < 0 && s != -1) {
        ISOCPP_THROW_EXCEPTION(ISOCPP_ERROR, "dds::core::Time::sec out of bounds");
    } else {
        /** @internal @bug OSPL-2308 RTF Time-ish coercion issue
        @see http://jira.prismtech.com:8080/browse/OSPL-2308 */
        sec_ =  s;
    }
}

CleanShot 2025-02-20 at 20 50 59@2x
CleanShot 2025-02-20 at 20 51 55@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant