Skip to content

Commit b487127

Browse files
committed
Don't use strict fortran standard on buggy GCC versions
1 parent 85e0e02 commit b487127

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ matrix:
1010
sudo: required
1111
dist: xenial
1212
- os: linux
13-
env: SWIGLANG=fortran GCC=6 CPP14=1
13+
env: SWIGLANG=fortran GCC=8 CPP14=1 FCSTD=f2003
1414
sudo: required
1515
dist: xenial
1616
- os: linux

Doc/Manual/src/Fortran.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,15 @@ void not_wrapped(UnknownType*);
18881888
void should_be_wrapped(UnknownType*);
18891889
```
18901890

1891+
## Cross-language polymorphism using directors
1892+
1893+
Fortran has much less introspection than Java, Python, and other less static
1894+
languages. Therefore director methods can't automatically detect whether the
1895+
target language (Fortran) overrides a particular method.
1896+
1897+
Note that a bug in GCC prevents versions before 8 from using the
1898+
`--std=f2003` flag (see [GNU bug 84924](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84924)).
1899+
18911900
## Known Issues
18921901

18931902
A number of known limitations to the SWIG Fortran module are tracked [on

Tools/testflags.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ def get_cxxflags(language, std, compiler):
6565
return cxxflags[language]
6666

6767
def get_fcflags(language, std, compiler):
68-
if not std:
69-
std = "f2003"
70-
fcflags = ["-std=" + std, "-Wall", "-Wextra", "-Wimplicit-procedure",
68+
fcflags = ["-Wall", "-Wextra", "-Wimplicit-procedure",
7169
"-Wimplicit-interface", "-Wno-compare-reals",
7270
"-ffree-line-length-none"]
71+
if std:
72+
fcflags.append("-std=" + std)
7373
# The boost version on the systems seems to be compiled as multithreaded
7474
# but does not link against the pthread library (and I guess the C++
7575
# compiler does?)

0 commit comments

Comments
 (0)