Skip to content
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

style: treat warnings as errors #26

Merged
merged 8 commits into from
Sep 29, 2024
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
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
2 changes: 1 addition & 1 deletion modules/sorts/merge_sort.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/sorts/tests_gnome_sort.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ program tests_gnome_sort

use gnome_sort_module
implicit none
integer :: i
integer, dimension(:), allocatable :: array

! Test 1: Repeated elements
Expand Down
1 change: 0 additions & 1 deletion tests/sorts/tests_heap_sort.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ program tests_heap_sort

use heap_sort_module
implicit none
integer :: i
integer, dimension(:), allocatable :: array

! Test 1: Repeated elements
Expand Down
1 change: 0 additions & 1 deletion tests/sorts/tests_merge_sort.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ program tests_merge_sort

use merge_sort_module
implicit none
integer :: i
integer, dimension(:), allocatable :: array

! Test 1: Repeated elements
Expand Down
1 change: 0 additions & 1 deletion tests/sorts/tests_quick_sort.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ program tests_quick_sort

use quick_sort_module
implicit none
integer :: i
integer, dimension(:), allocatable :: array

! Test 1: Repeated elements
Expand Down
1 change: 0 additions & 1 deletion tests/sorts/tests_radix_sort.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down