{"action":"opened","issue":{"url":"https://api.github.com/repos/phhusson/sepolicy-inject/issues/2","labels_url":"https://api.github.com/repos/phhusson/sepolicy-inject/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/phhusson/sepolicy-inject/issues/2/comments","events_url":"https://api.github.com/repos/phhusson/sepolicy-inject/issues/2/events","html_url":"https://github.com/phhusson/sepolicy-inject/issues/2","id":115959445,"number":2,"title":"compile errors","user":{"login":"superr","id":3191197,"avatar_url":"https://avatars.githubusercontent.com/u/3191197?v=3","gravatar_id":"","url":"https://api.github.com/users/superr","html_url":"https://github.com/superr","followers_url":"https://api.github.com/users/superr/followers","following_url":"https://api.github.com/users/superr/following{/other_user}","gists_url":"https://api.github.com/users/superr/gists{/gist_id}","starred_url":"https://api.github.com/users/superr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superr/subscriptions","organizations_url":"https://api.github.com/users/superr/orgs","repos_url":"https://api.github.com/users/superr/repos","events_url":"https://api.github.com/users/superr/events{/privacy}","received_events_url":"https://api.github.com/users/superr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-09T20:31:22Z","updated_at":"2015-11-09T20:31:22Z","closed_at":null,"body":"Hello, I am interested in this project and the new features you have added. Unfortunately I am not able to compile the source. I am able to compile the original joshua_brindle source without issue. The errors I get are as follows:\r\n```\r\nsuperr@studio:~/android/sepolicy-inject$ make\r\ncc -g -Wall -Werror -Wshadow -O2 -pipe -fno-strict-aliasing    sepolicy-inject.c  /usr/lib/x86_64-linux-gnu/libsepol.a  -o sepolicy-inject\r\nsepolicy-inject.c: In function ‘create_domain’:\r\nsepolicy-inject.c:106:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode\r\n  for(unsigned i=0; i<policy->p_roles.nprim; ++i) {\r\n  ^\r\nsepolicy-inject.c:106:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code\r\nsepolicy-inject.c: In function ‘add_type’:\r\nsepolicy-inject.c:290:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode\r\n  for(int i=0; i<policy->p_classes.nprim; ++i) {\r\n  ^\r\nsepolicy-inject.c:292:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode\r\n   for(constraint_node_t *n = cl->constraints; n ; n=n->next) {\r\n   ^\r\nsepolicy-inject.c:293:4: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode\r\n    for(constraint_expr_t *e = n->expr; e; e=e->next) {\r\n    ^\r\n<builtin>: recipe for target 'sepolicy-inject' failed\r\nmake: *** [sepolicy-inject] Error 1\r\nsuperr@studio:~/android/sepolicy-inject$\r\n```\r\nI tried using the -std=c99 option but then I get the following:\r\n```\r\nsuperr@studio:~/android/sepolicy-inject$ make\r\ncc -g -Wall -Werror -Wshadow -std=c99 -O2 -pipe -fno-strict-aliasing    sepolicy-inject.c  /usr/lib/x86_64-linux-gnu/libsepol.a  -o sepolicy-inject\r\nsepolicy-inject.c: In function ‘create_domain’:\r\nsepolicy-inject.c:91:2: error: implicit declaration of function ‘strdup’ [-Werror=implicit-function-declaration]\r\n  int r = symtab_insert(policy, SYM_TYPES, strdup(d), typdatum, SCOPE_DECL, 1, &value);\r\n  ^\r\nsepolicy-inject.c:91:43: error: passing argument 3 of ‘symtab_insert’ makes pointer from integer without a cast [-Werror]\r\n  int r = symtab_insert(policy, SYM_TYPES, strdup(d), typdatum, SCOPE_DECL, 1, &value);\r\n                                           ^\r\nIn file included from sepolicy-inject.c:18:0:\r\n/usr/include/sepol/policydb/policydb.h:638:12: note: expected ‘hashtab_key_t’ but argument is of type ‘int’\r\n extern int symtab_insert(policydb_t * x, uint32_t sym,\r\n            ^\r\nsepolicy-inject.c: In function ‘add_file_transition’:\r\nsepolicy-inject.c:268:23: error: assignment makes pointer from integer without a cast [-Werror]\r\n  new_transition->name = strdup(filename);\r\n                       ^\r\ncc1: all warnings being treated as errors\r\n<builtin>: recipe for target 'sepolicy-inject' failed\r\nmake: *** [sepolicy-inject] Error 1\r\nsuperr@studio:~/android/sepolicy-inject$ \r\n```\r\nI hope you can help and thanks for the tool :)"}}