Skip to content

Commit bc2302b

Browse files
committed
docs: fix copy
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 727a93b commit bc2302b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/gfortran.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ double precision function add( x, y )
114114
end function add
115115
```
116116

117-
While `add` may be used in conjunction with other Fortran files, we cannot use `add` directly from C because Fortran expects arguments to be passed by reference rather than by value. Furthermore, while not applicable here, Fortran functions can only return scalar values, not arrays. Thus, the general best practice is to wrap `add` as a subroutine (equivalent of a C function returning `(void)`), where we can pass a pointer for storing the output return value.
117+
While `add` may be used in conjunction with other Fortran files, we cannot use `add` directly from C because Fortran expects arguments to be passed by reference rather than by value. In general, for functions accepting and returning scalars, best practice is to wrap `add` as a subroutine (equivalent of a C function returning `(void)`), where we can pass a pointer for storing the output return value.
118118

119119
```fortran
120120
!>
@@ -172,7 +172,7 @@ where we prevent name mangling using `extern "C"`. Now that our Fortran code is
172172
double c_add( const double x, const double y ) {
173173
double sum;
174174
addsub( &x, &y, &sum );
175-
return sum;
175+
return sum;
176176
}
177177
```
178178

0 commit comments

Comments
 (0)