PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

Inconsistent number or size of arguments passed

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



Joined: 11 Mar 2009
Posts: 3

PostPosted: Sun Mar 15, 2009 10:15 pm    Post subject: Inconsistent number or size of arguments passed Reply with quote

I get this error when compiling on Windows when passing string arguments to a subroutine. The arguments have different length so the compiler generates this error.

I saw a previous post and used the -Munix parameter which fixed the problem. Surely, however, the compiler does not adhere to the standard since this is a very common use of string arguments?

And what happens when arguments are passed from routines which use this subroutine from other libraries. Will it work correctly ? Or do I have to compile every routine with the -Munix parameter.

What other side-effects of using this are there?
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Mar 16, 2009 1:08 pm    Post subject: Reply with quote

Hi Andrew,

Can you please post an example of the callee and caller, including any interfaces?

The Win32 default calling convention appends the size of the data types in the argument list to the symbol name. So if you have a data type mismatch, then this could cause the above error. "-Munix" tells the compiler to use the UNIX style calling convention which does not use the argument list data type size. See the "Win32 Calling Conventions" section at the end of Chapter 11 of th PGI User's Guide for more details.

However, the size of a character array shouldn't matter in this context since what's really being passed is a reference to the character array, not the whole array. Hence, the number appended to the end of the symbol name is the size of a pointer, not the size of an array. You can try using "-Munix", but I don't think that's the issue here. An example would be very helpful.

Thanks,
Mat
Back to top
View user's profile
AndrewWadsley43066



Joined: 11 Mar 2009
Posts: 3

PostPosted: Mon Mar 16, 2009 6:17 pm    Post subject: Reply with quote

Mat,

I have fixed the problem (mine) and it wasn't related to the size of the character variables - thanks for your response.

regards

Andrew
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