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

error: cast from pointer to smaller type 'int' loses information #624

Open
yurivict opened this issue Jan 12, 2023 · 0 comments
Open

error: cast from pointer to smaller type 'int' loses information #624

yurivict opened this issue Jan 12, 2023 · 0 comments

Comments

@yurivict
Copy link

yurivict commented Jan 12, 2023

src/annoymodule.cc:182:12: error: cast from pointer to smaller type 'int' loses information
    return (int) NULL;
           ^~~~~~~~~~

NULL can't be converted to integer because it is a pointer.

In fact, this function call and comparison are meaningless:

  if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|s", (char**)kwlist, &f, &metric))
    return (int) NULL;
  return 0;

You can replace this code with return 0;.

clang-14
FreeBSD 13.1

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