user997836
user997836

Reputation: 51

backslash at end of string

Does anybody know how to use Doxygen to document Fortran code in which a character array is assigned a string that terminates in a backslash. I tried it with the following code with Doxygen version 1.6.1 :

program test
  character(80) :: test_char
  test_char = '\\test\test\'
  stop
end program test

and got the error: "Error in file test.f90 line: 9, state: 20"

Upvotes: 1

Views: 1255

Answers (2)

Peter Petrik
Peter Petrik

Reputation: 10185

This is likely a doxygen 1.6.1 bug (doxygen commands could start with backslash and \' is probably wrongly parsed).

The latest version of doxygen is 1.8.7, so first step is to update and try with that.

In case it does not help, you can use custom FILTER to remove backslash characters from strings in your code.

Upvotes: 1

user997836
user997836

Reputation: 51

Thanks everyone. I ended up using the following solution:

program test
  character(80) :: test_char
  character(2)  :: bckslsh = '\\'

  test_char = '\\test\test'//bckslsh(1:1)

  stop
end program test

Upvotes: 0

Related Questions