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

warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ #19

Open
milahu opened this issue Jul 29, 2023 · 0 comments

Comments

@milahu
Copy link

milahu commented Jul 29, 2023

i want to use this repo for pycryptopp in tahoe-lafs/pycryptopp#47

im replacing pycryptopp's src-ed25519 with

rm -rf src-ed25519
cp -r $src_python_ed25519 src-python-ed25519
chmod -R +w src-python-ed25519
# fix: FileNotFoundError: [Errno 2] No such file or directory: 'src-ed25519/supercop-ref'
# a: https://github.com/warner/python-ed25519/tree/master/src
# b: https://github.com/tahoe-lafs/pycryptopp/tree/master/src-ed25519
mkdir src-ed25519
ln -sr src-python-ed25519/src/ed25519-supercop-ref src-ed25519/supercop-ref
ln -sr src-python-ed25519/src/ed25519-glue src-ed25519/glue

so my src-ed25519/supercop-ref is python-ed25519/src/ed25519-supercop-ref

problem: building pycryptopp gives these warnings:

src-ed25519/supercop-ref/ed25519.c:125:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare8;;]
  125 |     for(i=0;i<smlen-64;i++)
      |              ^

src-ed25519/supercop-ref/ed25519.c:131:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare8;;]
  131 |     for(i=0;i<smlen-64;i++)
      |              ^

src-ed25519/supercop-ref/sha512-hash.c:40:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wsign-compare-Wsign-compare8;;]
   40 |   for (i = 0;i < inlen;++i) padded[i] = in[i];
      |                ^

the variables smlen and inlen have type unsigned long long, so this should be trivial to fix with

sed -i 's/^  int i, ret;$/  unsigned long long i, ret;/' src-ed25519/supercop-ref/ed25519.c
sed -i 's/^  int i;$/  unsigned long long i;/' src-ed25519/supercop-ref/sha512-hash.c

... or at least unsigned int i

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

No branches or pull requests

1 participant