-
Notifications
You must be signed in to change notification settings - Fork 99
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
Use const pointers in signature of dgstrs? #142
Comments
I try to tackle this issue in a systematic manner. Cppcheck warns these cases with |
Thanks for looking into this! Yes, the main argument for qualifying pointer arguments as |
I started with two dozed places in #151. There are more then 450 pointers left, that should be passed as const pointers. I don't think the effort and such a massive change is worth the benefit. Max and @xiaoyeli , what do you think? Should we close this issue and #151 as won't fix? Or is an improvement worth the investment/changes? |
This code started more than 20 years ago, when 'const' in C is not a big thing. I won't have time to go back fix them all. But I am happy to follow this practice for future new code development. |
Sherry, let me rephrase my question: Do you think it is worth to invest (mainly my) time into changing almost 500 places and risking breaking things for users (e.g.,by them having forward declaration that are changed, it remains API changes). Or would you prefer not to merge this approach to close this issue? I am fine either way.
Great to hear that, thank you! |
I merged your PR#151. I think we don't need to do this extensively now, just to fix things on the way. |
@xiaoyeli This can be closed. |
The current signature of
dgstrs
isNote that the arguments
perm_c
andperm_r
, which specify column and row permutations, are used in a read-only fashion. It would thus be possible to declare them asint const*
instead ofint*
. Such an API change would clarify the semantics to the users, and allow them to pass the same array two times (e.g.{0,1,2,...}
to indicate that there are no row and column permutations). Such an API change should not break existing code as(cited from here).
The analogous observations holds for the variants of
dgstrs
concerned with other data types. I have not checked other SuperLU functions regarding whether pointers in the function signatures can be made const pointers.The text was updated successfully, but these errors were encountered: