Skip to content

Fix incorrect language standard#4

Open
0x9fff00 wants to merge 1 commit into
tihmstar:masterfrom
0x9fff00:patch-1
Open

Fix incorrect language standard#4
0x9fff00 wants to merge 1 commit into
tihmstar:masterfrom
0x9fff00:patch-1

Conversation

@0x9fff00
Copy link
Copy Markdown

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