{"thread":{"id":"32671","subject":"tar-tree.c dereferencing pointer to incomplete type","startedAt":"2013-01-19T13:31:38Z","lastAt":"2013-01-19T21:28:51Z","messageCount":5,"participants":["白い熊","Duy Nguyen","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"207261","messageId":"CAPy7p-45-E-vWcjBTXSLpjoQLic54JdAoKqB3jz4RA6GzAkw8w@mail.gmail.com","threadId":"32671","inReplyTo":null,"subject":"tar-tree.c dereferencing pointer to incomplete type","fromName":"白い熊","fromEmail":"shiroikuma@shiroikuma.org","sentAt":"2013-01-19T13:31:38Z","receivedAt":"2013-01-19T13:31:38Z","isPatch":false,"sender":{"key":"shiroikuma@shiroikuma.org","avatar":null},"body":"Hello:\n\nI'm building v 1.8.1.1 on Android. The build chokes on the builtins\nphase on tar-tree.c with:\n\n    CC builtin/tar-tree.o\nbuiltin/tar-tree.c: In function 'cmd_get_tar_commit_id':\nbuiltin/tar-tree.c:93:12: error: dereferencing pointer to incomplete type\nmake: *** [builtin/tar-tree.o] Error 1\n\nThe line that's causing this in tar-tree.c is:\n\nif (header->typeflag[0] != 'g')\n\nfrom\n\nint cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix)\n{\n\tchar buffer[HEADERSIZE];\n\tstruct ustar_header *header = (struct ustar_header *)buffer;\n\tchar *content = buffer + RECORDSIZE;\n\tssize_t n;\n\n\tif (argc != 1)\n\t\tusage(builtin_get_tar_commit_id_usage);\n\n\tn = read_in_full(0, buffer, HEADERSIZE);\n\tif (n < HEADERSIZE)\n\t\tdie(\"git get-tar-commit-id: read error\");\n\tif (header->typeflag[0] != 'g')\n\t\treturn 1;\n\tif (memcmp(content, \"52 comment=\", 11))\n\t\treturn 1;\n\n\tn = write_in_full(1, content + 11, 41);\n\tif (n < 41)\n\t\tdie_errno(\"git get-tar-commit-id: write error\");\n\n\treturn 0;\n}\n\nBut why?\n\nWhat's messed up with my setup.\n\nI can compile no probs on other machines. I'm trying to get my head\nround this, but don't see the problem?\n-- \n白い熊\n"},{"id":"207262","messageId":"CACsJy8DfOYRmF6FqTLCAYgXGpECX-VhpXGK5CfcmVvKXQ+DpuA@mail.gmail.com","threadId":"32671","inReplyTo":"CAPy7p-45-E-vWcjBTXSLpjoQLic54JdAoKqB3jz4RA6GzAkw8w@mail.gmail.com","subject":"Re: tar-tree.c dereferencing pointer to incomplete type","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2013-01-19T13:37:04Z","receivedAt":"2013-01-19T13:37:04Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Jan 19, 2013 at 8:31 PM, 白い熊 <ShiroiKuma@shiroikuma.org> wrote:\n> Hello:\n>\n> I'm building v 1.8.1.1 on Android. The build chokes on the builtins\n> phase on tar-tree.c with:\n>\n>     CC builtin/tar-tree.o\n> builtin/tar-tree.c: In function 'cmd_get_tar_commit_id':\n> builtin/tar-tree.c:93:12: error: dereferencing pointer to incomplete type\n> make: *** [builtin/tar-tree.o] Error 1\n>\n> The line that's causing this in tar-tree.c is:\n>\n> if (header->typeflag[0] != 'g')\n\nThere is another tar.h somewhere in your system? Stopping the\ncompilation after proprocessing should show if it includes the correct\ntar.h.\n-- \nDuy\n"},{"id":"207265","messageId":"CAPy7p-7V6y4hfLrYYi_3zGkzGTw2BeF5wh3zPYzumrp+Pbqr+Q@mail.gmail.com","threadId":"32671","inReplyTo":"CACsJy8DfOYRmF6FqTLCAYgXGpECX-VhpXGK5CfcmVvKXQ+DpuA@mail.gmail.com","subject":"Re: tar-tree.c dereferencing pointer to incomplete type","fromName":"白い熊","fromEmail":"shiroikuma@shiroikuma.org","sentAt":"2013-01-19T14:26:59Z","receivedAt":"2013-01-19T14:26:59Z","isPatch":false,"sender":{"key":"shiroikuma@shiroikuma.org","avatar":null},"body":"On Sat, Jan 19, 2013 at 5:37 PM, Duy Nguyen <pclouds@gmail.com> wrote:\n> There is another tar.h somewhere in your system? Stopping the\n> compilation after proprocessing should show if it includes the correct\n> tar.h.\n\nThank you, this must've been it, as it was finding tar.h from glibc.\n\nMoved it and compiles fine. In fact I moved it back now, so it should\nbe finding it again and it still builds fine, no trace of the prior\nerror. I'm dumbfounded! But at least it compiles...\n-- \n白い熊\n"},{"id":"207266","messageId":"CAPy7p-5vZKzznSny97BZMWHxHPJupO3in7tvjyFOTxBYzw5D4Q@mail.gmail.com","threadId":"32671","inReplyTo":"CAPy7p-7V6y4hfLrYYi_3zGkzGTw2BeF5wh3zPYzumrp+Pbqr+Q@mail.gmail.com","subject":"Re: tar-tree.c dereferencing pointer to incomplete type","fromName":"白い熊","fromEmail":"shiroikuma@shiroikuma.org","sentAt":"2013-01-19T14:37:41Z","receivedAt":"2013-01-19T14:37:41Z","isPatch":false,"sender":{"key":"shiroikuma@shiroikuma.org","avatar":null},"body":"On Sat, Jan 19, 2013 at 6:26 PM, 白い熊 <ShiroiKuma@shiroikuma.org> wrote:\n> Thank you, this must've been it, as it was finding tar.h from glibc.\n>\n> Moved it and compiles fine. In fact I moved it back now, so it should\n> be finding it again and it still builds fine, no trace of the prior\n> error. I'm dumbfounded! But at least it compiles...\n\nOK, figured it out. It was indeed the wrong tar.h, the one that was\nmaking it bomb was the kernel headers tar.h from the Android source.\nThat explains it quite well.\n\nAll's good now. Thank you :@)\n-- \n白い熊\n"},{"id":"207273","messageId":"20130119212851.GA4009@elie.Belkin","threadId":"32671","inReplyTo":"CAPy7p-5vZKzznSny97BZMWHxHPJupO3in7tvjyFOTxBYzw5D4Q@mail.gmail.com","subject":"Re: tar-tree.c dereferencing pointer to incomplete type","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-01-19T21:28:51Z","receivedAt":"2013-01-19T21:28:51Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"白い熊 wrote:\n> On Sat, Jan 19, 2013 at 6:26 PM, 白い熊 <ShiroiKuma@shiroikuma.org> wrote:\n\n>> Moved it and compiles fine. In fact I moved it back now, so it should\n>> be finding it again and it still builds fine, no trace of the prior\n>> error. I'm dumbfounded! But at least it compiles...\n>\n> OK, figured it out. It was indeed the wrong tar.h, the one that was\n> making it bomb was the kernel headers tar.h from the Android source.\n> That explains it quite well.\n\nHm.  Is there anything to do to make our headers specified with -I\ntake precedence over unrelated system headers when processing\n'#include \"foo.h\"' directives?\n\nThanks,\nJonathan\n"}]}