You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description:
Though normally I don't write a function in this way, but the program I use for Mutation Testing study used this way:
static void func( sym, x )
char sym[];
int x;
{}
In this case, after Milu parse the code, the array argument 'sym' will be interpreted as a forward declaration but not an actual argument.
How to recreate the bug:
Write the following code to a file, say "bug.c":
include<stdlib.h>
static void func( sym, x )
char sym[];
int x;
{
if(x==0);
}
void main(int argc, char** argv){
func(0, 0);
}
2. Run Milu to generate mutants on "bug.c", with the default set of operators, but add option "--debug=src":
$ path\to\milu --debug=src bug.c
3. The output will be the original code being parsed and printed without any modification:
include<stdlib.h>
static void func ( char sym [ ] ; int x )
{
if ( x == 0 ) ;
}
;
void main ( int argc , char * * argv )
{
func ( 0 , 0 ) ;
}
4. Not easy to spot, but in the function declaration of 'func', there is a ';' instead of ',' between the two arguments 'sym' and 'x', so that the first argument is interpreted as a forward declaration. This will cause the compiler to complain that the arguments don't match in any of the invocations of this function.
Temporary Solution for users:
No idea. Avoid this kind of way to declare a function maybe?
The text was updated successfully, but these errors were encountered:
Bug description:
Though normally I don't write a function in this way, but the program I use for Mutation Testing study used this way:
static void func( sym, x )
char sym[];
int x;
{}
In this case, after Milu parse the code, the array argument 'sym' will be interpreted as a forward declaration but not an actual argument.
How to recreate the bug:
include<stdlib.h>
static void func( sym, x )
char sym[];
int x;
{
if(x==0);
}
void main(int argc, char** argv){
func(0, 0);
}
2. Run Milu to generate mutants on "bug.c", with the default set of operators, but add option "--debug=src":
$ path\to\milu --debug=src bug.c
3. The output will be the original code being parsed and printed without any modification:
include<stdlib.h>
static void func ( char sym [ ] ; int x )
{
if ( x == 0 ) ;
}
;
void main ( int argc , char * * argv )
{
func ( 0 , 0 ) ;
}
4. Not easy to spot, but in the function declaration of 'func', there is a ';' instead of ',' between the two arguments 'sym' and 'x', so that the first argument is interpreted as a forward declaration. This will cause the compiler to complain that the arguments don't match in any of the invocations of this function.
Temporary Solution for users:
No idea. Avoid this kind of way to declare a function maybe?
The text was updated successfully, but these errors were encountered: