Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Disabling particular warnings?

brchrisman
Beginner
1,049 Views
My function definitions generate warnings with the Intel compiler because in many cases I do not set the return value (rather I am evaluating the functions purely for side effect purposes).
I looked at the spec, and indeed it doesn't look like an error to do this, but it does seem like bad form, so I can see why it's generating a warning.
That said, is there a way to disable this particular warning while leaving other warnings intact?

thanks,
Brian

[bc@anubis sample]$ ifort -v
Version 11.1
[bc@anubis sample]$ cat function.f90
integer FUNCTION foobar()
integer :: i, x, y
end FUNCTION
[bc@anubis sample]$ ifort function.f90
function.f90(1): warning #6178: The return value of this FUNCTION has not been defined. [FOOBAR]
integer FUNCTION foobar()
-----------------^
/opt/intel/Compiler/11.1/059/lib/intel64/for_main.o: In function `main':
/export/users/nbtester/efi2linux_nightly/branch-11_1/20091013_000000/libdev/frtl/src/libfor/for_main.c:(.text+0x38): undefined reference to `MAIN__'
[bc@anubis sample]$







0 Kudos
2 Replies
Steven_L_Intel1
Employee
1,049 Views
-diag-disable 6178

But why not just set the return value to 0 (or whatever) in the function? You might legitimately have this warning somewhere else.
0 Kudos
brchrisman
Beginner
1,049 Views
-diag-disable 6178

But why not just set the return value to 0 (or whatever) in the function? You might legitimately have this warning somewhere else.

Excellent thanks. Yeah, there are many and they're on my list.
0 Kudos
Reply