有没有传递给Fortran函数的参数个数有限制吗? [英] Is there a limit to the number of arguments passed to a fortran function?

查看:695
本文介绍了有没有传递给Fortran函数的参数个数有限制吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我碰到一些Fortran 90的code其中68参数传递给函数。
在网上搜索我只找到一些有关传球256字节一段CUDA Fortran语言相关的东西(的http://www.pgroup.com/userforum/viewtopic.php?t=2235&sid=f241ca3fd406ef89d0ba08a361acd962).

I came across some Fortran 90 code where 68 arguments are passed to a function. Upon searching the web I only found something about a limit of passing 256 bytes for some CUDA Fortran related stuff (http://www.pgroup.com/userforum/viewtopic.php?t=2235&sid=f241ca3fd406ef89d0ba08a361acd962).

所以我想:有没有可能被传递给函数英特尔/视频/ GNU Fortran编译器参数的数量限制

So I wonder: is there a limit to the number of arguments that may be passed to a function for Intel/Visual/GNU fortran compilers?

推荐答案

我碰到的Fortran 90的标准的讨论传来:

I came across this discussion of the Fortran 90 standards:

http://www.nag.co.uk/sc22wg5/Guidelines_for_Bindings- b.html

有关的部分是在下面斜体字:

The relevant section is in italics below:

3.4语句

在一个Fortran语句的长度限制在过程调用的长度强加一个上限。虽然这是不太可能成为一个严​​重的征收,是在自由格式的单个的Fortran陈述须待5241个字符,包括可能的标签(F90节3.3.1,3.3.1.4)的上限;在固定格式格式的上限为1320字加一个可能的标签(F90第3.3.2节)。这些限制都受到了字符为默认样,即在实践中单字节字符的;双字节字符,例如用于表意语言中,限制是处理器相关,但有可能是的尺寸。同样的顺序的

有Fortran标准中没有限制对参数的最大数目的程序

我有我在我的研究,分析二进制文件正在开发一种安全工具。我知道C语言具有(在C90标准,在127 C99标准31)对参数的数目限制,所以我想我可以维向量来保存有关传入参数128项。我遇到了一个FORTRAN来源的二进制文件有290参数传递,这使我这个讨论。二进制是从SPEC CPU2006基准测试套件,基准481.wrf,在那里我看到一个名为程序(二进制)solve_interface_,它设置堆栈上290的参数,然后调用solve_em_,这实际上处理这些参数。可以毫无疑问,在网上找到了FORTRAN源$ C ​​$ C为这些程序。二进制是由GNU编译器工具制作了一个x86 / Linux的/ ELF系统。

I have a security tool that I am developing in my research that analyzes binaries. I knew that the C language has limits on number of arguments (31 in the C90 standard, 127 in the C99 standard), so I thought that I could dimension a vector to hold 128 items pertaining to incoming arguments. I encountered a FORTRAN-derived binary that had 290 arguments passed, which led me to this discussion. The binary is from the SPEC CPU2006 benchmark suite, benchmark 481.wrf, where I see a procedure that is named (in the binary) "solve_interface_" which sets up 290 arguments on the stack and then calls "solve_em_" which actually processes these arguments. You can no doubt find the FORTRAN source code for these procedures online. The binary was produced by the GNU compiler tools for an x86/Linux/ELF system.

这篇关于有没有传递给Fortran函数的参数个数有限制吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆