ingydotnet / inline-c-pm

10 stars 19 forks source link

Way to request function not be wrapped #53

Open epa opened 8 years ago

epa commented 8 years ago

Sometimes when writing C code inline you want to make a 'private' function which will be called only from C code and not from Perl. You can stop Inline::C from seeing it by changing to K&R declaration style or other manoeuvres that stop the parser recognizing it. But it would be cleaner to have an explicit way:

/* no Inline */ void foo(int x) { ... }

sisyphus commented 8 years ago

Having never used K&R style declarations until today, I didn't realize they had that effect - it's handy to know: /* unbound */ void foo(x) int x; { ... }

That seems good enough for short argument lists - a bit tedious for lengthy argument lists, I guess.

epa commented 8 years ago

Unfortunately using the K&R syntax also disables most type checking for the function arguments. So it's not great as a workaround.