Skip to content

add missing implicit none, set compiler flags to force implicit none #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
cmake_minimum_required(VERSION 3.5.0)
cmake_minimum_required(VERSION 3.14.0)
project(stdlib Fortran)
enable_testing()

# this avoids stdlib and projects using stdlib from having to introspect stdlib's directory structure
# FIXME: this eventually needs to be handled more precisely, as this spills all .mod/.smod into one directory
# and thereby can clash if module/submodule names are the same in different parts of library
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR})

# compiler feature checks
# --- compiler options
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
add_compile_options(-fimplicit-none)
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
add_compile_options(-warn declarations)
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL PGI)
add_compile_options(-Mdclchk)
endif()

# --- compiler feature checks
include(CheckFortranSourceCompiles)
include(CheckFortranSourceRuns)
check_fortran_source_compiles("error stop i; end" f18errorstop SRC_EXT f90)
check_fortran_source_runs("use, intrinsic :: iso_fortran_env, only : real128; real(real128) :: x; x = x+1; end" f03real128)

add_subdirectory(src)
2 changes: 2 additions & 0 deletions src/f08estop.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
submodule (stdlib_experimental_error) estop

implicit none

contains

module procedure error_stop
Expand Down
2 changes: 2 additions & 0 deletions src/f18estop.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
submodule (stdlib_experimental_error) estop

implicit none

contains

module procedure error_stop
Expand Down
2 changes: 2 additions & 0 deletions src/tests/ascii/test_ascii.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ program test_ascii
is_control, is_punctuation, is_graphical, is_printable, is_ascii, &
to_lower, to_upper, LF, TAB, NUL, DEL

implicit none

print *, "Lowercase letters: ", lowercase
print *, "Uppercase letters: ", uppercase
print *, "Digits: ", digits
Expand Down