PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Compile time errors/warnings

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
TobiasB



Joined: 09 Mar 2006
Posts: 5

PostPosted: Tue Apr 25, 2006 11:42 am    Post subject: Compile time errors/warnings Reply with quote

Hello,

exists there a warning in newer version of pgf95 (I have only access to 6.0-5)? If not, can they be added in future versions?

a) Wrong format string
------------------------
program test
implicit none
integer :: n
n = 1
write(*,'(''n'')') n
end program test
------------------------
pgf95 does compile without any error/warning (and produces only the run time error: "PGFIO-F-246/formatted write/unit=6/infinite format scan for edit descriptor.")
Expected: Something like the NAG compiler:
-----------------
Error: test1.f90, line 5: No data-edit descriptor for effective item
[f95 error termination]
-----------------
If it could catch something like
c = '(''n'')'
write(*,c) n
as well, it would be even nicer (NAG misses that as well).


b) Interface check
----------------------------
module test
implicit none
interface
subroutine hello(n)
integer :: n
end subroutine hello
end interface
end module test

subroutine hello(n)
integer, intent(in) :: n
integer :: i
do i = 1,n; print *, 'hello'; end do
end subroutine hello
----------------------------

In the interface "n" is implicitly "intent(inout)", in the function it is "intent(in)".
pgf95 gives no error, but NAG f95 does:
---------------------
Error: test3.f90: Inconsistent INTERFACE block for procedure HELLO from TEST
Argument N (no. 1) has a different INTENT
[f95 error termination]
---------------------


Tobias

PS: Using different compilers is really a bonus to find programming errors. pgf95 is especially good at finding array boundary problems:
n = 0
allocate(a(n))
b = a(1)
works with most compilers (creates one element and accesses this one), but with pgf95 is simply cashes (and -Mbounds tells why).
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6125
Location: The Portland Group Inc.

PostPosted: Thu Apr 27, 2006 5:26 pm    Post subject: Reply with quote

Hi Tobias,

Our latest release (6.1) does not detect these types of errors. I have submitted a request (TPR#3820) to our compiler engineers and hopefully we will be able to add support for these in the near future.

Thanks,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group