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

refactor: auto-generate are_adjacent(), avoid deprecated igraph_are_connected() C function #1254

Merged
merged 4 commits into from Feb 20, 2024

Conversation

szhorvat
Copy link
Member

@szhorvat szhorvat commented Feb 17, 2024

Fixes #1253

Copy link
Contributor

aviator-app bot commented Feb 17, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

@szhorvat szhorvat marked this pull request as ready for review February 17, 2024 21:08
@szhorvat szhorvat requested a review from krlmlr February 17, 2024 21:08
@krlmlr
Copy link
Contributor

krlmlr commented Feb 18, 2024

Thanks. Seeing -Waddress warnings in https://github.com/igraph/rigraph/actions/runs/7944281043/job/21689682420?pr=1254#step:9:84:

  vendor/cigraph/src/community/leading_eigenvector.c:606:28: warning: the address of 'ret' will always evaluate as 'true' [-Waddress]
  vendor/cigraph/src/graph/visitors.c:261:21: warning: the address of 'ret' will always evaluate as 'true' [-Waddress]
  vendor/cigraph/src/graph/visitors.c:551:67: warning: the address of 'ret' will always evaluate as 'true' [-Waddress]
  vendor/cigraph/src/isomorphism/vf2.c:667:71: warning: the address of 'ret' will always evaluate as 'true' [-Waddress]
  vendor/cigraph/src/isomorphism/vf2.c:1504:71: warning: the address of 'ret' will always evaluate as 'true' [-Waddress]
  vendor/cigraph/src/misc/motifs.c:396:25: warning: the address of 'ret' will always evaluate as 'true' [-Waddress]

Could be a change in the build envionment, or related to this PR. New run for the main branch: https://github.com/igraph/rigraph/actions/runs/7946903820

@szhorvat
Copy link
Member Author

Forgot to re-add a manual patch after auto-generation.

@szhorvat
Copy link
Member Author

Fixed.

@krlmlr
Copy link
Contributor

krlmlr commented Feb 18, 2024

@szhorvat
Copy link
Member Author

CC @ntamas since he added this macro originally.

I vote for changing the macro in the C core in the same way as above, as this warning has been a constant annoyance when testing with various compilers, and so far there has been no need for performing this NULL-check. But it should be decided by Tamás.

@krlmlr
Copy link
Contributor

krlmlr commented Feb 18, 2024

I suspect it could be replaced with a static assert?

@ntamas
Copy link
Member

ntamas commented Feb 19, 2024

That macro was the usual defensive programming habit from my side. If we can replace the check with a static assert, that's great. If we can't, let's add a runtime assert instead if possible.

@krlmlr
Copy link
Contributor

krlmlr commented Feb 20, 2024

@ntamas: Please open an issue in igraph/C if needed.

@szhorvat: Thanks!

@aviator-app aviator-app bot merged commit dd60ff6 into main Feb 20, 2024
3 checks passed
@aviator-app aviator-app bot deleted the update-are-adjacent branch February 20, 2024 15:24
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.

igraph_are_adjacent()
3 participants