Re: [PATCH 06/16] shortlog: add missing declaration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Felipe Contreras <felipe.contreras@xxxxxxxxx> writes:

> On Thu, Oct 31, 2013 at 1:05 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> Felipe Contreras <felipe.contreras@xxxxxxxxx> writes:
>>
>>> Otherwise we would have to include commit.h.
>>
>> Was there a reason why commit.h is not included here, just like
>> revision.h would include diff.h, so that users of shortlog.h do not
>> have to worry about including commit.h themselves?
>
> Because you can't do:
>
> struct diff_options;
> struct diff_options diffopt;
>
> The storage size is not known, but you can do:
>
> struct diff_options;
> struct diff_options *diffopt;

But so can you do

	struct diff_options *diffopt;

without the declaration, no?  That is:

	$ cat >x.c <<\EOF
        struct foo {
        	struct bar *ptr;
	};

        int foo_is_null(struct foo *foo)
        {
        	return foo == 0;
	}
	EOF
        $ gcc -Wall -c x.c


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]