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

Fix incorrect language standard #4

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

Conversation

0x9fff00
Copy link

This project uses fseeko, ftello and strdup, which are POSIX extensions. Compiling with -std=c11, which doesn't support these functions, causes the following warnings:

common.c: In function 'read_file':
common.c:172:2: warning: implicit declaration of function 'fseeko'; did you mean 'fseek'? [-Wimplicit-function-declaration]
  172 |  fseeko(file, 0, SEEK_END);
      |  ^~~~~~
      |  fseek
common.c:173:11: warning: implicit declaration of function 'ftello'; did you mean 'ftell'? [-Wimplicit-function-declaration]
  173 |  length = ftello(file);
      |           ^~~~~~
      |           ftell
normal.c: In function 'normal_idevice_new':
normal.c:160:18: warning: implicit declaration of function 'strdup'; did you mean 'strcmp'? [-Wimplicit-function-declaration]
  160 |   client->udid = strdup(devices[j]);
      |                  ^~~~~~
      |                  strcmp
normal.c:160:16: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  160 |   client->udid = strdup(devices[j]);
      |                ^
recovery.c: In function 'recovery_client_new':
recovery.c:88:19: warning: implicit declaration of function 'strdup'; did you mean 'strcmp'? [-Wimplicit-function-declaration]
   88 |    client->srnm = strdup(device_info->srnm);
      |                   ^~~~~~
      |                   strcmp
recovery.c:88:17: warning: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   88 |    client->srnm = strdup(device_info->srnm);
      |                 ^

It also causes a segmentation fault when running igetnonce while a device is connected. To fix this, change -std=c11 to -std=gnu11.

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.

1 participant