suppress gfortran warning message - fortran

Does anyone know if there is an option to suppress the following warning message
from gfortran:
Warning: Extension: Conversion from HOLLERITH to INTEGER(4) at (1)
(Without changing the code, that is).
I have already tried the options: -Wno-conversion-extra -Wno-conversion
I'm using gfortran 4.9.1 by the way.

Probably you can try this way:
-std=legacy
This may suppress the warning information as you mentioned since Hollerith constant is the legacy feature before FORTRAN77. However, downside of using this option is that all the possible legacy collision may not be shown. I have tested this option on gfortran 6.2.0.

Related

Fortran pause function not working in Force 2.0 [duplicate]

I googled it but i could not find the answer. How can I suppress this warning AND ONLY THIS:
Warning: Deleted feature: PAUSE statement at (1)
i know I can supress all the warning but I wanna suppress only this one. Or if not possible. suppress warning for delete features.
thanks
A.
Compile with -std=legacy or -w (lowercase). Note that -w will suppress all warnings.

Silence the warning: `Non-conforming tab character` in gfortran

I usually run my code with ifort, but during implementation, I prefer compiling and testing with gfortran as I find it to be a lot stricter than its intel counterpart.
While turning on compiling options such as -Wall, I get the following warning:
Warning: Nonconforming tab character at (1)
Is there a way to silence this one particular warning while using the same compiling options? Note that I do NOT want to replace tabs with space characters. If there is no way to resolve this issue, then the answer "No it's not possible" would suffice.
Warning: the below answer I originally wrote only applies to gfortran 4.x. The behaviour has been reversed in version 5.x, see the answer by DrOli.
What have you tried so far? Does -Wtabs help? From man gfortran:
-Wtabs
By default, tabs are accepted as whitespace, but tabs are not members of the Fortran Character Set. For continuation lines, a tab followed by a digit between 1 and 9 is supported. -Wno-tabs
will cause a warning to be issued if a tab is encountered. Note, -Wno-tabs is active for -pedantic, -std=f95, -std=f2003, -std=f2008 and -Wall.
And -Wall sets -Wno-tabs.
If it doesn't help, it could still be that -Wall overwrites this option. Then you can try manually setting -Wall without the tabs part:
-Wall
Enables commonly used warning options pertaining to usage that we recommend avoiding and that we believe are easy to avoid. This currently includes -Waliasing, -Wampersand, -Wconversion,
-Wsurprising, -Wc-binding-type, -Wintrinsics-std, -Wno-tabs, -Wintrinsic-shadow, -Wline-truncation, -Wtarget-lifetime, -Wreal-q-constant and -Wunused.
UPDATE: With GCC/gFortran 5xx (I noticed with 5.3.0), the -Wtabs usage has been "reversed", and as they say, "made more sensible".
See here (https://gcc.gnu.org/gcc-5/changes.html)
Now -Wtabs DOES give the nonconforming warning, whereas -Wno-tabs TURNS OFF the warning (i.e. the opposite of the previous usage).
The easiest way of getting rid of the warning in gfortran versions 4.x is to overwrite the -Wno-tabs flag that the -Wall flag sets. So first include -Wall and then -Wtabs
-Wall -Wtabs

How to disable narrowing conversion warnings?

I use -Wall and updating to new gcc I have got a lot of warning: narrowing conversion. I want to disable them, but leave all other warnings untouched (ideally).
I can find nothing about narrowing in http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
How to disable narrowing conversion warnings?
Is it possible at all?
P.S.
I need to Disable warnings, not fix them in the source code.
Blind -Wno-conversion doesn't help.
As gx_ said, adding -Wno-narrowing to your command line should ignore those errors. Encountered this myself when upgrading to C++0x.
As a small FYI, as detailed on https://clang.llvm.org/docs/DiagnosticsReference.html#wnarrowing this is an alias for -Wno-c++11-narrowing (there are multiple narrowing warning flags)

max number of allowable warnings while compiling

Is it possible to 'tell' compiler that if total number of warnings (while compiling a C++ program) are more than say 10 then stop compiling further, and emit an error?
Or is it possible to hack a compiler like clang to provide this functionality.
GCC has two options together would achieve this, from gnu online docs:
-Werror
Make all warnings into errors.
-fmax-errors=n
Limits the maximum number of error messages to n, at which point GCC bails out rather than attempting to continue processing the source
code.
This would make a build with any warnings fail though, the options just define when to stop parsing.
I haven't seen this kind of feature in gcc or clang. You can certainly try to patch it into either of them, both are open source. There is also -Werror (accepted by both compilers) which simply treats warnings as errors.
How about using -Werror to make warnings into errors and -fmax-errors=n to set the limit.
(Also, perhaps making your code completely warning free would be a good thing).

two fortran questions

Is there any way for gfortran to compile a f90 program but with a non-f90 extension, or even no file extension at all?
How to suppress pause statement warning used in a f90 program when compiled with gforTRan?
Many thanks.
gfortran -c sourfile.xyz does not work. I know the manpage explains these options, but I did not find one working.
I mean in my f90 program, I have a pause statement. If I compile it, I got a warning saying the use of pause is obsolete. I want to suppress this warning during compilation.
Suppress all warnings with -w option?