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

test: check that sysconf returns a positive value #44666

Merged

Commits on Sep 16, 2022

  1. test: check that sysconf returns a positive value

    Static analysis insists that sysconf(_SC_PAGE_SIZE) might return a
    negative integer (even though it never will). This was supposed to be
    handled by the existing check EXPECT_GE(page, static_cast<int>(N)).
    I assume that static analysis does not consider this sufficient because
    static_cast<int>(N) could be negative or zero if N exceeds INT_MAX (even
    though it never will).
    
    To resolve this (theoretical) problem, explicitly check that the return
    value is positive and then cast it to a size_t.
    tniessen committed Sep 16, 2022
    Copy the full SHA
    f367232 View commit details
    Browse the repository at this point in the history