Frama-C Bug Tracking System - Frama-C
View Issue Details
0000552Frama-CKernelpublic2010-08-02 10:472010-12-17 19:35
Frama-C Boron-20100401 
Frama-C Carbon-20101201-beta1 
0000552: Checking number of arguments passed to C functions
There currently isn't much checking of function arguments in the front-end. The following program is accepted, although it passes the wrong number of arguments for both calls to retint: int retint(int x ) { int __retres ; __retres = 42 + x; return (__retres); } int main(int c ) { int x ; int tmp ; x = retint(); tmp = retint(c,c); return (tmp); } Arguments for not implementing this feature: there are perfectly good compilers to check for this, and not having rigid rules in place may even help with older code containing variadic functions. I am not sure when the current convention for declaring variadic functions became standardized, and it may not have been from the beginning.
No tags attached.
Issue History
2010-08-02 10:47pascalNew Issue
2010-08-23 10:18virgileStatusnew => assigned
2010-08-23 10:18virgileAssigned To => virgile
2010-08-23 10:25virgileNote Added: 0001079
2010-08-27 11:39svnCheckin
2010-08-27 11:39svnStatusassigned => resolved
2010-08-27 11:39svnResolutionopen => fixed
2010-12-10 15:45signolesFixed in Version => Frama-C Carbon-20101201-beta1
2010-12-17 19:35signolesStatusresolved => closed

2010-08-23 10:25   
Regarding variadic functions, according to wikipedia, C89 already had this feature. Old-style definition of variadic functions (as authorized by POSIX) are quite similar.