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

Compiler warns about initializing reference with temporary in astrocyte_lr_1994 #3137

Closed
heplesser opened this issue Mar 6, 2024 · 0 comments · Fixed by #3138
Closed

Compiler warns about initializing reference with temporary in astrocyte_lr_1994 #3137

heplesser opened this issue Mar 6, 2024 · 0 comments · Fixed by #3138
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: High Should be handled next T: Bug Wrong statements in the code or documentation
Projects
Milestone

Comments

@heplesser
Copy link
Contributor

The newest AppleClang (15.0.0.15000309) warns about assigning the result of a temporary expression evaluation result to a reference:

// shorthand for state variables
const double& ip3 = y[ S::IP3 ];
// Ca_tot_ corresponds to the c_0 (total [Ca++] in terms of cytosolic vol)
// in De Young & Keizer (1992) and Li & Rinzel (1994)
const double& calc = std::max( 0.0, std::min( y[ S::Ca_astro ], node.P_.Ca_tot_ ) ); // keep calcium within limits
const double& h_ip3r = y[ S::h_IP3R ];

conc should be a proper variable. The two references above and below are fine, since they point to vector elements.

@heplesser heplesser added T: Bug Wrong statements in the code or documentation S: High Should be handled next I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) labels Mar 6, 2024
@heplesser heplesser added this to the NEST 3.7 milestone Mar 6, 2024
@heplesser heplesser added this to To do in Models via automation Mar 6, 2024
Models automation moved this from To do to Done Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: High Should be handled next T: Bug Wrong statements in the code or documentation
Projects
Models
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant