- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks in advance,
Albert
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-diag-error number
where "number" is the number of the diagnostic you want forced as an error. It can also be a comma-separated list of diagnostic numbers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
-diag-error number
where "number" is the number of the diagnostic you want forced as an error. It can also be a comma-separated list of diagnostic numbers.
Thanks for the answer, but where can I find the numbers associated with the error messages ?
Best regards,
Albert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The number comes from the warning you're trying to elevate to an error.
In the example below, *only* warning #6717 is elevated to an error using the -diag-error option suggested.
$ ifort -V -c -std -warn all sample.f
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20091130 Package ID: l_cprof_p_11.1.064
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
Intel Fortran 11.1-2649
sample.f(1): warning #7373: Fixed form source is an obsolescent feature in Fortran 2003.
program sample
^
sample.f(7): warning #6717: This name has not been given an explicit type.
a = 1.d0
------^
sample.f(8): warning #6717: This name has not been given an explicit type.
c = 0.d0
------^
sample.f(9): warning #6717: This name has not been given an explicit type.
d = a/c
------^
Now use -diag-error number to elevate only warning #6717 to an error. Notice that warning #7373 is unaffected.
$ ifort -V -c -std -warn all -diag-error 6717 sample.f
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20091130 Package ID: l_cprof_p_11.1.064
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
Intel Fortran 11.1-2649
sample.f(1): warning #7373: Fixed form source is an obsolescent feature in Fortran 2003.
program sample
^
sample.f(7): error #6717: This name has not been given an explicit type.
a = 1.d0
------^
sample.f(8): error #6717: This name has not been given an explicit type.
c = 0.d0
------^
sample.f(9): error #6717: This name has not been given an explicit type.
d = a/c
------^
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The number comes from the warning you're trying to elevate to an error.
In the example below, *only* warning #6717 is elevated to an error using the -diag-error option suggested.
$ ifort -V -c -std -warn all sample.f
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20091130 Package ID: l_cprof_p_11.1.064
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
Intel Fortran 11.1-2649
sample.f(1): warning #7373: Fixed form source is an obsolescent feature in Fortran 2003.
program sample
^
sample.f(7): warning #6717: This name has not been given an explicit type.
a = 1.d0
------^
sample.f(8): warning #6717: This name has not been given an explicit type.
c = 0.d0
------^
sample.f(9): warning #6717: This name has not been given an explicit type.
d = a/c
------^
Now use -diag-error number to elevate only warning #6717 to an error. Notice that warning #7373 is unaffected.
$ ifort -V -c -std -warn all -diag-error 6717 sample.f
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20091130 Package ID: l_cprof_p_11.1.064
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
Intel Fortran 11.1-2649
sample.f(1): warning #7373: Fixed form source is an obsolescent feature in Fortran 2003.
program sample
^
sample.f(7): error #6717: This name has not been given an explicit type.
a = 1.d0
------^
sample.f(8): error #6717: This name has not been given an explicit type.
c = 0.d0
------^
sample.f(9): error #6717: This name has not been given an explicit type.
d = a/c
------^
Thank you for the answer, it was clear to me how to work with the numbers but I didn't know where to get them.
I'm still using version 10.1.012 compiler. I also tried the 11.1-2620 (build 10081012) version.
With version 10 I don't get the warning numbers and also the -diag-error 6717 does not promote this warning to an error/
When using the 11.1 compiler I get the warning number and it is promoted to an error.
Is this a new feature in the 11.1 compiler ?
Is there a lis of the 10.1 warning numbers (if the feature -dag-error works in this version).
Best Regards,
Albert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, it is not a new feature to 11.x but there were many problems fixed in 11.x. This is part of the "static verifier" feature added back in the 10.x release, however, there were significant issues with the feature in 10.x release.
I haven't had much success using the feature before 11.x nor am I aware of a list of 10.1 warning #s but you can search only Knowledge Base articles and find diagnostic #s for diagnostics currently being documented. For example, diagnostic #6717 can be found (here) using a text search for keywords from the message. A number of Fortran specific diagnostics can also be found by searching for "Diagnostic Fortran".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, it is not a new feature to 11.x but there were many problems fixed in 11.x. This is part of the "static verifier" feature added back in the 10.x release, however, there were significant issues with the feature in 10.x release.
I haven't had much success using the feature before 11.x nor am I aware of a list of 10.1 warning #s but you can search only Knowledge Base articles and find diagnostic #s for diagnostics currently being documented. For example, diagnostic #6717 can be found (here) using a text search for keywords from the message. A number of Fortran specific diagnostics can also be found by searching for "Diagnostic Fortran".
Thank you for the answer. So the best way is to use the 11.1 compiler.
(I'm aware of some issues with the static verifier in version 10, I submited some problem reports on it).
Thank you for your effort.
Best Regards,
Albert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kevin is correct that the concept of diagnostic numbers and the control over them was first introduced with the Static Verifier (now Source Checker) feature.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kevin is correct that the concept of diagnostic numbers and the control over them was first introduced with the Static Verifier (now Source Checker) feature.
Thanks a lot for the answers.
Best Regards,
Albert

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