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

Re: [PATCH 2/3] ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] so fix that.

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Feb 1, 2019, 09:00 UTC
Message-ID
<CAPig+cTEZVt13XBQ9z7aQp0PAZQbN5xRm+PC16iSNNr=G473YQ@mail.gmail.com>
In-Reply-To
<01020168a83380fb-ecad8400-915d-497c-841f-096541747cd6-000000@eu-west-1.amazonses.com>
On Fri, Feb 1, 2019 at 3:36 AM Shahzad Lone <shahzadlone@gmail.com> wrote:
Show 9 quoted lines
> diff --git a/pack-revindex.c b/pack-revindex.c
> @@ -186,9 +186,9 @@ int find_revindex_position(struct packed_git *p, off_t ofs)
>  struct revindex_entry *find_pack_revindex(struct packed_git *p, off_t ofs)
>  {
> -
> +       int pos;
>         load_pack_revindex(p);
> -       const int pos = find_revindex_position(p, ofs);
> +       pos = find_revindex_position(p, ofs);

Thanks, however, this code was fine until your patch 1/3 changed it to have a declaration after statement. Rather than creating a new patch to fix an earlier mistake in the same patch series, on this project, the proper way to resolve such a problem is use "git rebase -i" to adjust patch 1/3 to not introduce the problem in the first place and drop this patch, and then (re-)submit the patch series.

Also, your Signed-off-by: is missing (see Documentation/SubmittingPatches).
Previous: Shahzad LoneNext: Shahzad Lone
Message 5 of 9 in “[Enhancement] Improve internals / refactoring.”
  1. 1/3 [Enhancement] Improve internals / refactoring.Shahzad Lone, Feb 1, 2019
  2. 3/3 It's C not C++ so variable length array should not be used [-Werror=vla] :,).Shahzad Lone, Feb 1, 2019
  3. Eric SunshineFeb 1, 2019
  4. 2/3 ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] so fix that.Shahzad Lone, Feb 1, 2019
  5. Eric SunshineFeb 1, 2019
  6. ] [Enhancement] Improve internals / refactoring.Shahzad Lone, Feb 1, 2019
  7. Brandon RichardsonFeb 2, 2019
  8. ] [Enhancement] Improve internals / refactoring.Shahzad Lone, Feb 2, 2019
  9. Junio C HamanoFeb 4, 2019

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.