Skip to content

MAINT: random: Fix a few compiler warnings. #13786

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

Merged
merged 1 commit into from
Jun 17, 2019

Conversation

WarrenWeckesser
Copy link
Member

Fixes:

gcc: numpy/random/src/xoshiro256/xoshiro256.c
numpy/random/src/xoshiro256/xoshiro256.c:39:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
        for (i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~

gcc: numpy/random/src/xoshiro512/xoshiro512.c
numpy/random/src/xoshiro512/xoshiro512.c:43:17: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
  for (i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
              ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
numpy/random/src/xoshiro512/xoshiro512.c:46:23: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
        for (w = 0; w < sizeof s_placeholder / sizeof *s_placeholder; w++)
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

gcc: numpy/random/src/distributions/distributions.c
numpy/random/src/distributions/distributions.c:185:14: warning: comparison of integers of different signs: 'int64_t' (aka 'long long') and 'const uint64_t' (aka 'const unsigned long long') [-Wsign-compare]
    if (rabs < ki_double[idx])
        ~~~~ ^ ~~~~~~~~~~~~~~
numpy/random/src/distributions/distributions.c:230:14: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const uint32_t' (aka 'const unsigned int') [-Wsign-compare]
    if (rabs < ki_float[idx])
        ~~~~ ^ ~~~~~~~~~~~~~

Fixes:

    gcc: numpy/random/src/xoshiro256/xoshiro256.c
    numpy/random/src/xoshiro256/xoshiro256.c:39:16: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
            for (i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
                        ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~

    gcc: numpy/random/src/xoshiro512/xoshiro512.c
    numpy/random/src/xoshiro512/xoshiro512.c:43:17: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
      for (i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
                  ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    numpy/random/src/xoshiro512/xoshiro512.c:46:23: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
            for (w = 0; w < sizeof s_placeholder / sizeof *s_placeholder; w++)
                        ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    gcc: numpy/random/src/distributions/distributions.c
    numpy/random/src/distributions/distributions.c:185:14: warning: comparison of integers of different signs: 'int64_t' (aka 'long long') and 'const uint64_t' (aka 'const unsigned long long') [-Wsign-compare]
        if (rabs < ki_double[idx])
            ~~~~ ^ ~~~~~~~~~~~~~~
    numpy/random/src/distributions/distributions.c:230:14: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'const uint32_t' (aka 'const unsigned int') [-Wsign-compare]
        if (rabs < ki_float[idx])
            ~~~~ ^ ~~~~~~~~~~~~~
@WarrenWeckesser
Copy link
Member Author

According to @charris, "The LGTM C/C++ check has been acting up lately and is under investigation."

@charris charris added this to the 1.17.0 release milestone Jun 15, 2019
@charris
Copy link
Member

charris commented Jun 16, 2019

Note that there is a PR to remove xoshiro* bit generators, so the will require fixes here if it goes in.

@mattip mattip merged commit 17e7ba7 into numpy:master Jun 17, 2019
@WarrenWeckesser WarrenWeckesser deleted the random-warnings branch June 17, 2019 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants