Y
Yevgen Muntyan
Hey,
Consider the following code:
void func (void)
{
}
void func2 (void)
{
return func ();
}
gcc -pedantic says the following:
muntyan@munt10:/tmp$ gcc -pedantic -c file.c
file.c: In function ‘func2’:
file.c:7: warning: ‘return’ with a value, in function returning void
If I recall correctly, compiler in some Microsoft Visual Studio version
told me the same thing. So, is this a compiler bug (feature), or is this
"return func ();" invalid in standard C?
Thanks,
Yevgen
Consider the following code:
void func (void)
{
}
void func2 (void)
{
return func ();
}
gcc -pedantic says the following:
muntyan@munt10:/tmp$ gcc -pedantic -c file.c
file.c: In function ‘func2’:
file.c:7: warning: ‘return’ with a value, in function returning void
If I recall correctly, compiler in some Microsoft Visual Studio version
told me the same thing. So, is this a compiler bug (feature), or is this
"return func ();" invalid in standard C?
Thanks,
Yevgen