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

incompatible integer to pointer conversion error #466

Open
chenrui333 opened this issue Aug 5, 2024 · 3 comments
Open

incompatible integer to pointer conversion error #466

chenrui333 opened this issue Aug 5, 2024 · 3 comments

Comments

@chenrui333
Copy link

👋 while regression build 3.20211022.1 release, I found some incompatible integer to pointer conversion error as below

  clang -Wno-implicit-function-declaration -g    -std=c99 -I/opt/homebrew/Cellar/libxau/1.0.11/include -I/opt/homebrew/Cellar/libxdmcp/1.1.5/include -I/opt/homebrew/Cellar/libxcb/1.17.0/include -I/opt/homebrew/Cellar/libx11/1.8.10/include -I/opt/homebrew/Cellar/libxext/1.3.6/include -I/opt/homebrew/Cellar/libxinerama/1.1.5/include -I/opt/homebrew/Cellar/libxfixes/6.0.1/include -I/opt/homebrew/Cellar/libxkbcommon/1.7.0/include -I/opt/homebrew/Cellar/libxi/1.8.1/include -I/opt/homebrew/Cellar/libxtst/1.2.5/include -I/opt/homebrew/Cellar/xorgproto/2024.1/include   -c -o cmd_click.o cmd_click.c
  xdo.c:1394:24: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
    keyseq_copy = strptr = strdup(keyseq);
                         ^ ~~~~~~~~~~~~~~
  1 error generated.

relates to Homebrew/homebrew-core#180081

@jordansissel
Copy link
Owner

I’m on my phone so I can’t test right now, so I can just go with looking at the code and the error message.

based on the code:

xdotool/xdo.c

Line 1394 in eb489de

keyseq_copy = strptr = strdup(keyseq);

all items appear to be char* here (including the return type of strdup), and none should be int. I’m not sure I understand why it’s reporting an int-char* conversion in this scenario.

@jordansissel
Copy link
Owner

Oh I wonder if on macOS we are missing a header declaration for strdup? C function default type is int if undeclared.

@jordansissel
Copy link
Owner

macOS docs indicate strdup comes from string.h which xdo.c does include. I’m unable to dig into this further without being on my computer. If yall find anything, let me know :)

also, does this still fail on the master branch?

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

No branches or pull requests

2 participants