- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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]$
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]$
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-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.
But why not just set the return value to 0 (or whatever) in the function? You might legitimately have this warning somewhere else.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
-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.
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.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page