With these compiler options, how do I prevent this error and maintain the logic in the program?
-g -Wall -Werror -fmax-errors=1 -fcheck=all
SUBROUTINE TESTING (cars)
CHARACTER cars*(*)
print *,"CARS=", cars(1),cars(2),cars(3)
end
Program TEST
Character test1 * 10
Character test2 * 30
COMMON /ABC/test1(10)
COMMON /DEF/test2(30)
test1(1)= 'A'
test1(2)= 'B'
test1(3)= 'C'
CALL TESTING (test1)
test2(1)= 'X'
test2(2)= 'Y'
test2(3)= 'Z'
CALL TESTING (test2)
End Program TEST
Error Message:
13 | CALL TESTING (test1)
| 1
Error: Rank mismatch in argument ‘cars’ at (1) (scalar and rank-1) [-Werror=argument-mismatch]
f951: all warnings being treated as errors