diff --git a/CMakeLists.txt b/CMakeLists.txt index ef62b3a..55a9b27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,16 @@ cmake_minimum_required(VERSION 3.16) project(FortranProject LANGUAGES Fortran) -add_compile_options(-Wall -Wextra -Wpedantic) +add_compile_options( + -Wall + -Wextra + -Wpedantic + -Waliasing + -Wconversion-extra + -Wimplicit-interface + -Wimplicit-procedure + -Wsurprising + -Werror) function(add_fortran_sources DIR SOURCES) file(GLOB_RECURSE NEW_SOURCES "${DIR}/*.f90") diff --git a/modules/sorts/merge_sort.f90 b/modules/sorts/merge_sort.f90 index 28a1861..95971ec 100644 --- a/modules/sorts/merge_sort.f90 +++ b/modules/sorts/merge_sort.f90 @@ -23,7 +23,7 @@ recursive subroutine merge_sort(array, n) implicit none integer, dimension(:), intent(inout) :: array ! Input/output array to be sorted integer, intent(in) :: n ! Size of the array - integer :: middle, i + integer :: middle integer, dimension(:), allocatable :: left_half, right_half, sorted_array ! Base case: return if the array has 1 or fewer elements diff --git a/tests/sorts/tests_gnome_sort.f90 b/tests/sorts/tests_gnome_sort.f90 index ef8d6f5..04ad524 100644 --- a/tests/sorts/tests_gnome_sort.f90 +++ b/tests/sorts/tests_gnome_sort.f90 @@ -6,7 +6,6 @@ program tests_gnome_sort use gnome_sort_module implicit none - integer :: i integer, dimension(:), allocatable :: array ! Test 1: Repeated elements diff --git a/tests/sorts/tests_heap_sort.f90 b/tests/sorts/tests_heap_sort.f90 index 8b47fb3..0b28b2a 100644 --- a/tests/sorts/tests_heap_sort.f90 +++ b/tests/sorts/tests_heap_sort.f90 @@ -6,7 +6,6 @@ program tests_heap_sort use heap_sort_module implicit none - integer :: i integer, dimension(:), allocatable :: array ! Test 1: Repeated elements diff --git a/tests/sorts/tests_merge_sort.f90 b/tests/sorts/tests_merge_sort.f90 index 0f44f3d..a55ef6c 100644 --- a/tests/sorts/tests_merge_sort.f90 +++ b/tests/sorts/tests_merge_sort.f90 @@ -6,7 +6,6 @@ program tests_merge_sort use merge_sort_module implicit none - integer :: i integer, dimension(:), allocatable :: array ! Test 1: Repeated elements diff --git a/tests/sorts/tests_quick_sort.f90 b/tests/sorts/tests_quick_sort.f90 index 0bbfd9d..547970a 100644 --- a/tests/sorts/tests_quick_sort.f90 +++ b/tests/sorts/tests_quick_sort.f90 @@ -6,7 +6,6 @@ program tests_quick_sort use quick_sort_module implicit none - integer :: i integer, dimension(:), allocatable :: array ! Test 1: Repeated elements diff --git a/tests/sorts/tests_radix_sort.f90 b/tests/sorts/tests_radix_sort.f90 index 9ccc2e0..22c04a2 100644 --- a/tests/sorts/tests_radix_sort.f90 +++ b/tests/sorts/tests_radix_sort.f90 @@ -6,7 +6,6 @@ program tests_radix_sort use radix_sort_module implicit none - integer :: i integer, dimension(:), allocatable :: array integer, parameter :: base10 = 10, base2 = 2, base16 = 16