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:
When a function is declared not static but contains a static declaration of a variable, the function will be interpreted as static in mutants. This may cause compilation problems if the function is also declared somewhere else (header files for example).
How to recreate the bug:
Write the following code to a file, say "bug.c":
include<stdlib.h>
void func();
void func()
{
static char c;
if(1==0);
}
void main(int argc, char** argv){
func();
}
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>
void func();
static void func ( )
{
static char c ;
if ( 1 == 0 ) ;
}
;
void main ( int argc , char * * argv )
{
func ( ) ;
}
4. The function 'func' is changed to static at its implementation, but the first occurrence (declaration) remains the same. If you compile the above code, the compiler will complain about inconsistent declaration.
Temporary Solution for users:
I'll be damned.
The text was updated successfully, but these errors were encountered:
Bug description:
When a function is declared not static but contains a static declaration of a variable, the function will be interpreted as static in mutants. This may cause compilation problems if the function is also declared somewhere else (header files for example).
How to recreate the bug:
include<stdlib.h>
void func();
void func()
{
static char c;
if(1==0);
}
void main(int argc, char** argv){
func();
}
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>
void func();
static void func ( )
{
static char c ;
if ( 1 == 0 ) ;
}
;
void main ( int argc , char * * argv )
{
func ( ) ;
}
4. The function 'func' is changed to static at its implementation, but the first occurrence (declaration) remains the same. If you compile the above code, the compiler will complain about inconsistent declaration.
Temporary Solution for users:
I'll be damned.
The text was updated successfully, but these errors were encountered: