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
Comments in the function signature "confuse" Inline::C although there are no C-related compilation errors. In the below example, myfunc3() succeeds while the other two fail to be called with the error: "Undefined subroutine &main::myfunc called"
use Inline C => 'DATA';
# these 2 fail:
print myfunc1(42), "\n";
print myfunc2(42), "\n";
# this succeeds:
print myfunc3(42), "\n";
__END__
__C__
use Inline C => 'DATA';
# these 2 fail:
# but if you comment them out, it succeeds, there
# are no C-related compilation problems
#print myfunc1(42), "\n";
#print myfunc2(42), "\n";
# this succeeds:
print myfunc3(42), "\n";
__END__
__C__
#include <stdio.h>
int myfunc3(
/*int a*/
int b
);
/* comments in the function signature cause
Undefined subroutine &main::myfunc called
*/
int myfunc1(
/* int a */
int b
){ fprintf(stdout, "hello %d\n", b); return 0; }
int myfunc2(
// int a
int b
){ fprintf(stdout, "hello %d\n", b); return 0; }
/* this is OK, even if its declaration contains comments */
int myfunc3(
/* ahahahah */
int b
);
int myfunc3(
int b
){ fprintf(stdout, "hello %d\n", b); return 0; }
The text was updated successfully, but these errors were encountered:
Comments in the function signature "confuse" Inline::C although there are no C-related compilation errors. In the below example, myfunc3() succeeds while the other two fail to be called with the error: "
Undefined subroutine &main::myfunc called
"The text was updated successfully, but these errors were encountered: