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

/* compiler workaround */ - what was the issue?

From
Philip Oakley <philipoakley@iee.org>
Date
May 5, 2016, 20:48 UTC
Message-ID
<17E04501C9474282B87758C7998A1F5B@PhilipOakley>
In-Reply-To
<AA5B2B1715BAF7438221293187A417A7BDE9D11D@desmdswms002.des.grplnk.net>
Duy,

In https://github.com/git-for-windows/git/commit/b3c96fb158f05152336f167076f5d81d23c3a5e5 (split-index: strip pathname of on-disk replaced entries, 13 Jun 2014) Nguyễn Thái Ngọc Duy <pclouds@gmail.com> you have

read-cache.c#L1790 (in that commit, now ~L1873)
    int saved_namelen = saved_namelen; /* compiler workaround */

Which then becomes an MSVC compile warning C4700: uninitialized local variable.

I'm wondering what was the compiler workaround being referred to? i.e. why does it need that tweak? There's no mention of the reason in the commit message.

There are a few other occurences of this same initialisation issue, so I was wondering if it's still neded? Or should I just get MSVC to ignore it, which may hide other issues..

-- Philip

Next: Junio C Hamano
Message 1 of 15 in “/* compiler workaround */ - what was the issue?”
  1. Philip OakleyMay 5, 2016
  2. Junio C HamanoMay 5, 2016
  3. Duy NguyenMay 6, 2016
  4. Philip OakleyMay 6, 2016
  5. Ramsay JonesMay 6, 2016
  6. Philip OakleyMay 6, 2016
  7. Junio C HamanoMay 6, 2016
  8. Marc BranchaudMay 6, 2016
  9. Junio C HamanoMay 6, 2016
  10. Stefan BellerMay 6, 2016
  11. Philip OakleyMay 9, 2016
  12. Randall S. BeckerMay 9, 2016
  13. Marc BranchaudMay 6, 2016
  14. Ramsay JonesMay 6, 2016
  15. Ramsay JonesMay 6, 2016

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.