Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tk.xs: Grab() method should not return anything #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chrstphrchvz
Copy link
Contributor

Address ParseXS warning:

Warning: Found a 'CODE' section which seems to be using 'RETVAL' but no 'OUTPUT' section. in Tk.xs, line 1030

Not sure if this is 100% correct or whether it fixes any actual bugs.

@eserte
Copy link
Owner

eserte commented Mar 14, 2021

The current situation is for sure wrong. Currently the method seems to return whatever is on top of the perl stack, which is probably not intended. However, the Grab() method (unlike the lowercase counterpart grab()) is not documented, nor can I find any usages of Grab() in the Tk code or even on CPAN. The original Tcl function returns TCL_OK or TCL_ERROR, which suggests that the method should rather return nothing, just throw an exception on errors. So maybe it would be better to change it to

  int result = Tk_Grab(info->interp,info->tkwin,global);
  if (result != TCL_OK)
   {
    croak("%s",Tcl_GetStringResult(info->interp));
   }

and change the return value of Tk_Grab to void.

Address ParseXS warning:

Warning: Found a 'CODE' section which seems to be using 'RETVAL'
but no 'OUTPUT' section. in Tk.xs, line 1030
@chrstphrchvz chrstphrchvz changed the title Tk.xs: add missing OUTPUT: RETVAL for Tk_Grab Tk.xs: Grab() method should not return anything Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants