MoL: Avoid empty array
Issue #2783
open
Automatic C arrays cannot be empty. Use a size-1 array instead if necessary.
See https://bitbucket.org/cactuscode/cactusnumerical/pull-requests/21
Found by enabling run-time compiler checks in debug mode.
Comments (4)
-
-
- changed status to open
-
-
assigned issue to
-
assigned issue to
-
@Erik Schnetter any updates? See the comment about an analogous case for
CCTK_COMPLEX
in the pull request. - Log in to comment
I’d add a comment describing this to the code, otherwise a future reader may wonder why the size of 1 is needed or put the whole block into a
if(nsrsc > 0) {...}
block which makes the reason explicit in code but is a larger and possibly hard to do (if the extra scope causes issues) change.