Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Cannot parse multiline gfortran warnings #1752

Open
jhrmnn opened this issue Apr 22, 2016 · 3 comments
Open

Cannot parse multiline gfortran warnings #1752

jhrmnn opened this issue Apr 22, 2016 · 3 comments

Comments

@jhrmnn
Copy link

jhrmnn commented Apr 22, 2016

It seems that gfortran (5.3.0) can ocassionally throw multiline warnings, such as:

read_control.f90:8488.5:

   89 continue
     1
read_control.f90:8472.71:

            read(inputline,*,end=89,err=99) desc_str, n_core_states_soc
                                                                       2
Warning: Legacy Extension: Label at (1) is not in the same block as the GOTO statement at (2)

Currently, this is parsed by syntastic as a an error and a warning. Any idea how to support this? Just ignoring the first line would be perfectly fine, I guess.

@lcd047
Copy link
Collaborator

lcd047 commented Apr 22, 2016

I don't think it's possible to handle this correctly with Vim's errorformat. It might be possible to address the problem with a preprocess function, but I'm afraid I don't know enough about gfortran error messages to do that (I haven't run gfortran in some ~25 years).

@jhrmnn
Copy link
Author

jhrmnn commented May 9, 2016

How about hardcoding the warning string and if it matches, ignoring the previous error?

@lcd047
Copy link
Collaborator

lcd047 commented May 10, 2016

This is not a good solution, it pretty much amounts to changing things without understanding them first. Is this the only case that needs to be fixed? Does it break anything? Did you check with gfortran's sources?

If the spurious error bothers you, you can use the function SyntasticCheckHook() to mark the relevant item invalid. The function is called with the list of errors as an argument, and it isn't supposed to return anything. You can't delete any error from it, but you can set the valid field of the relevant items to 0. Or you could just use syntastic_quiet_messages to hide the offending messages.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants