Skip to content

fixed a mistake in get_dL(...) definition in spherical.c#1

Open
AnthonyKirilov wants to merge 1 commit intochomps:masterfrom
AnthonyKirilov:patch-1
Open

fixed a mistake in get_dL(...) definition in spherical.c#1
AnthonyKirilov wants to merge 1 commit intochomps:masterfrom
AnthonyKirilov:patch-1

Conversation

@AnthonyKirilov
Copy link

get_dL function is declared and called with 3 arguments (see Hydro/euler_sph.c or Hydro/euler_sph3d.c) but it is defined with 4 in spherical.c. I removed the extra 'double dx' argument in the definition which is not used in the function anyway. This usually compiles without warning (because C...) and does not seem to cause runtime errors because 'dx' is not used in the function and 'dim' is the first and only integer in the parameter list and there is only one integer in the argument list. Nonetheless, this is still technically considered undefined behaviour that should be avoided - perhaps it could cause compile time or run time errors if one is using a different compiler, arch, etc.

get_dL function is declared and called with 3 arguments (see Hydro/euler_sph.c or Hydro/euler_sph3d.c) but it is defined with 4 in spherical.c. I removed the extra 'double dx' argument in the definition which is not used in the function anyway. This usually compiles without warning (because C...) and does not seem to cause runtime errors because 'dx' is not used in the function and 'dim' is the first and only integer in the parameter list and there is only one integer in the argument list. Nonetheless, this is still technically considered undefined behaviour that should be avoided - perhaps it could cause compile time or run time errors if one is using a different compiler, arch, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant