git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4 1/7] Add delta-islands.{c,h}

From
Christian Couder <christian.couder@gmail.com>
Date
Aug 16, 2018, 06:02 UTC
Message-ID
<CAP8UFD1A8Z_Eh+N8204zSUG5Pnji+5=uwOiDr+LrbFGFJ-qPtg@mail.gmail.com>
In-Reply-To
<20180813181149.GA10013@sigill.intra.peff.net>
On Mon, Aug 13, 2018 at 8:11 PM, Jeff King <peff@peff.net> wrote:
Show 33 quoted lines
> On Mon, Aug 13, 2018 at 01:17:18PM +0100, Ramsay Jones wrote:
>
>> >>> +struct island_bitmap {
>> >>> +     uint32_t refcount;
>> >>> +     uint32_t bits[];
>> >>
>> >> Use FLEX_ARRAY here? We are slowly moving toward requiring
>> >> certain C99 features, but I can't remember a flex array
>> >> weather-balloon patch.
>> >
>> > This was already discussed by Junio and Peff there:
>> >
>> > https://public-inbox.org/git/20180727130229.GB18599@sigill.intra.peff.net/
>>
>> That is a fine discussion, without a firm conclusion, but I don't
>> think you can simply do nothing here:
>>
>>   $ cat -n junk.c
>>        1      #include <stdint.h>
>>        2
>>        3      struct island_bitmap {
>>        4              uint32_t refcount;
>>        5              uint32_t bits[];
>>        6      };
>>        7
>>   $ gcc --std=c89 --pedantic -c junk.c
>>   junk.c:5:11: warning: ISO C90 does not support flexible array members [-Wpedantic]
>>     uint32_t bits[];
>>              ^~~~
>>   $ gcc --std=c99 --pedantic -c junk.c
>
> Right, whether we use the FLEX_ALLOC macros or not, this needs to be
> declared with FLEX_ARRAY, not an empty "[]".
Ok, it will use FLEX_ARRAY in the reroll I will send soon.
Thanks Ramsay and Peff!
Previous: Jeff KingNext: Jeff King
Message 7 of 15 in “Add delta islands support”
  1. 0/7 Add delta islands supportChristian Couder, Aug 12, 2018
  2. 1/7 Add delta-islands.{c,h}Christian Couder, Aug 12, 2018
  3. Ramsay JonesAug 13, 2018
  4. Christian CouderAug 13, 2018
  5. Ramsay JonesAug 13, 2018
  6. Jeff KingAug 13, 2018
  7. Christian CouderAug 16, 2018
  8. Jeff KingAug 13, 2018
  9. Christian CouderAug 16, 2018
  10. 5/7 t: add t5319-delta-islands.shChristian Couder, Aug 12, 2018
  11. 2/7 pack-objects: refactor code into compute_layer_order()Christian Couder, Aug 12, 2018
  12. 4/7 repack: add delta-islands supportChristian Couder, Aug 12, 2018
  13. 3/7 pack-objects: add delta-islands supportChristian Couder, Aug 12, 2018
  14. 6/7 pack-objects: move tree_depth into 'struct packing_data'Christian Couder, Aug 12, 2018
  15. 7/7 pack-objects: move 'layer' into 'struct packing_data'Christian Couder, Aug 12, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.