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

Re: [GSoC][RFC][PATCH 1/2] STRBUF_INIT_CONST: a new way to initialize strbuf

From
Robear Selwans <rwagih.rw@gmail.com>
Date
Feb 18, 2020, 14:19 UTC
Message-ID
<CALH1-XoWmojFZir1JTU490GNHE1CETs4jbjswH316cAWqjF+Bg@mail.gmail.com>
In-Reply-To
<20200218062124.GF1641086@coredump.intra.peff.net>
On Tue, Feb 18, 2020 at 8:21 AM Jeff King <peff@peff.net> wrote:
Show 7 quoted lines
> Your second patch catches cases where the strbuf functions want to write
> to the buffer. But we've always been pretty open about the fact that
> strbuf.buf is a writeable C-style string. So something like this:
> ...
> would generate no compile-time warnings, but would invoke undefined
> behavior (on my system it segfaults when run, but it could have even
> more confusing outcomes).

Oh right, I didn't think about that. Ignorant of me to expect everyone to just call the functions and not edit the buf directly.

Show 5 quoted lines
> If we want to pursue this direction, I think we'd do better to give each
> strbuf a matching array. Something like:
> ...
> So I think there are interesting directions here, but there's a lot of
> stuff to figure out.
I think that got me a bit fired up now.
Show 7 quoted lines
> I notice you put GSoC in your subject line. If you're looking at this as
> a microproject, IMHO this is _way_ more complicated and subtle than a
> microproject should be. The goal there is to give something so easy that
> you get to focus on getting your patches in and interacting with the
> community. The scope I'd expect is more along the lines of compiling
> with -Wwrite-strings and cleaning up some of the locations that
> complain.

I'm actually planning to keep on contributing to git, so I kind of didn't want to do something trivial. Despite the fact that I'm planning to apply to git for GSoC, I'm mostly putting the [GSoC] so that reviewers would go easy on me :D. That said, I might actually do the -Wwrite-strings clean-up after this one is finished.

Thanks for the help, I guess I'll start editing it ASAP, then.
- mo7sener
Previous: Jeff KingNext: Jeff King
Message 4 of 11 in “STRBUF_INIT_CONST Cover”
  1. Robear SelwansFeb 18, 2020
  2. [GSoC][RFC][PATCH 1/2] STRBUF_INIT_CONST: a new way to initialize strbufRobear Selwans, Feb 18, 2020
  3. Jeff KingFeb 18, 2020
  4. Robear SelwansFeb 18, 2020
  5. Jeff KingFeb 18, 2020
  6. Johannes SixtFeb 19, 2020
  7. René ScharfeFeb 20, 2020
  8. Robear SelwansFeb 21, 2020
  9. Derrick StoleeFeb 27, 2020
  10. René ScharfeFeb 27, 2020
  11. [GSoC][RFC][PATCH 2/2] STRBUF_INIT_CONST: Adapting strbuf_* functionsRobear Selwans, Feb 18, 2020

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.