Skip to content

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

@yurivict

Description

@yurivict
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions