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

Fix build warnings in NEPs #18078

Merged
merged 3 commits into from
Dec 28, 2020
Merged

Conversation

rgommers
Copy link
Member

No description provided.

intp stride[niter];
{intp indexstride;} #if (flags&FLAGS_HASINDEX);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the intent here was, I assume what I replaced it with but this looked pretty weird.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you got it right, but it is a bit odd to use the same name for two different structures.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't work out what your comment is referring to @charris. What name and which structures?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking in the code, there doesn't seem to be anything like this, so I expect it has marginal relevance to how the implementation ended up. The closest thing I could find is

/* Internal-only AXISDATA MEMBER ACCESS. */
struct NpyIter_AD {
    npy_intp shape, index;
    npy_intp ad_flexdata;
};

Where ad_flexdata seems to be either a stride, or a pointer stored as an integer. It's probably going to cause trouble eventually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eric-wieser It looked like struct axis_data could contain different entries depending on a flag, I think NpyIter_AD has the same dual use of ad_flexdata.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking. I think no need to look into it more. Just to document why I changed it:

  • it caused a Sphinx warning
  • it caused code highlighting for the whole code block to go missing

@charris charris merged commit a31071b into numpy:master Dec 28, 2020
@charris
Copy link
Member

charris commented Dec 28, 2020

Thanks Ralf.

@rgommers rgommers deleted the fix-neps-buildissues branch December 28, 2020 14:59
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.

None yet

3 participants