<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/compat/nedmalloc, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-04-06T17:06:20Z</updated>
<entry>
<title>unify and bump _WIN32_WINNT definition to Windows 8.1</title>
<updated>2026-04-06T17:06:20Z</updated>
<author>
<name>Matthias Aßhauer</name>
<email>mha1993@live.de</email>
</author>
<published>2026-04-06T05:45:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=66dd13f3f72e8cad1327b6b134dec079936c4b07'/>
<id>urn:sha1:66dd13f3f72e8cad1327b6b134dec079936c4b07</id>
<content type='text'>
Git for Windows doesn't support anything prior to Windows 8.1 since 2.47.0
and Git followed along with commits like ce6ccba (mingw: drop Windows
7-specific work-around, 2025-08-04).

There is no need to pretend to the compiler that we still support Windows
Vista, just to lock us out of easy access to newer APIs. There is also no
need to have conflicting and unused definitions claiming we support some
versions of Windows XP or even Windows NT 4.0.

Bump all definitions of _WIN32_WINNT to a realistic value of Windows 8.1.
This will also simplify code for a followup commit that will improve cpu
core detection on multi-socket systems.

Signed-off-by: Matthias Aßhauer &lt;mha1993@live.de&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>compat: disable -Wunused-parameter in 3rd-party code</title>
<updated>2024-08-28T16:51:18Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2024-08-28T03:58:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4550c16434017b2bcec50967845c044fbcbf0ff6'/>
<id>urn:sha1:4550c16434017b2bcec50967845c044fbcbf0ff6</id>
<content type='text'>
We carry some vendored 3rd-party code in compat/ that does not build
cleanly with -Wunused-parameters. We could mark these with UNUSED, but
there are two reasons not to:

  1. This is code imported from elsewhere, so we'd prefer to avoid
     modifying it in an invasive way that could create conflicts if we
     tried to pull in a new version.

  2. These files don't include git-compat-util.h at all, so we'd need to
     factor out (or repeat) our UNUSED macro.

In theory we could modify the build process to invoke the compiler with
the extra warning disabled for these files, but there are tricky corner
cases there (e.g., for NO_REGEX we cannot assume that the compiler
understands -Wno-unused-parameter as an option, so we'd have to use our
detect-compiler script).

Instead, let's rely on the gcc diagnostic #pragma. This is horribly
unportable, of course, but it should do what we want.  Compilers which
don't understand this particular pragma should ignore it (per the
standard), and compilers which do care about "-Wunused-parameter" will
hopefully respect it, even if they are not gcc (e.g., clang does).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>nedmalloc: avoid new compile error</title>
<updated>2022-05-24T22:58:31Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-05-24T00:23:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=98cdb61cab6cff3df9fc6b48b99df61965a1588c'/>
<id>urn:sha1:98cdb61cab6cff3df9fc6b48b99df61965a1588c</id>
<content type='text'>
GCC v12.x complains thusly:

compat/nedmalloc/nedmalloc.c: In function 'DestroyCaches':
compat/nedmalloc/nedmalloc.c:326:12: error: the comparison will always
                              evaluate as 'true' for the address of 'caches'
                              will never be NULL [-Werror=address]
  326 |         if(p-&gt;caches)
      |            ^
compat/nedmalloc/nedmalloc.c:196:22: note: 'caches' declared here
  196 |         threadcache *caches[THREADCACHEMAXCACHES];
      |                      ^~~~~~

... and it is correct, of course.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>win32: allow building with pedantic mode enabled</title>
<updated>2021-09-03T18:40:30Z</updated>
<author>
<name>Carlo Marcelo Arenas Belón</name>
<email>carenas@gmail.com</email>
</author>
<published>2021-09-03T17:02:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=27e0c3c6cfead8fccd16105be497dba7ccd0ec6b'/>
<id>urn:sha1:27e0c3c6cfead8fccd16105be497dba7ccd0ec6b</id>
<content type='text'>
In preparation to building with pedantic mode enabled, change a couple
of places where the current mingw gcc compiler provided with the SDK
reports issues.

A full fix for the incompatible use of (void *) to store function
pointers has been punted, with the minimal change to instead use a
generic function pointer (FARPROC), and therefore the (hopefully)
temporary need to disable incompatible pointer warnings.

Signed-off-by: Carlo Marcelo Arenas Belón &lt;carenas@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix spelling errors in no-longer-updated-from-upstream modules</title>
<updated>2019-11-10T07:00:55Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2019-11-05T17:07:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=03670c8b2375062a5bcc50ce8891a4406fbc88e2'/>
<id>urn:sha1:03670c8b2375062a5bcc50ce8891a4406fbc88e2</id>
<content type='text'>
We have several modules originally taken from some upstream source,
and which as far as I can tell we no longer update from the upstream
anymore.  As such, I have not submitted these spelling fixes to any
external projects but just include them directly here.

Reported-by: Jens Schleusener &lt;Jens.Schleusener@fossies.org&gt;
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>nedmalloc: avoid compiler warning about unused value</title>
<updated>2019-08-07T18:54:55Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2019-08-07T13:09:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=70597e838601ee6be5c43ece255c9df47f8fe9a2'/>
<id>urn:sha1:70597e838601ee6be5c43ece255c9df47f8fe9a2</id>
<content type='text'>
Cast the evaluated value of the macro INITIAL_LOCK to void to instruct
the compiler that we're not interested in said value nor the following
warning:

In file included from compat/nedmalloc/nedmalloc.c:63:
compat/nedmalloc/malloc.c.h: In function ‘init_user_mstate’:
compat/nedmalloc/malloc.c.h:1706:62: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
 1706 | #define INITIAL_LOCK(sl)      (memset(sl, 0, sizeof(MLOCK_T)), 0)
      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
compat/nedmalloc/malloc.c.h:5020:3: note: in expansion of macro ‘INITIAL_LOCK’
 5020 |   INITIAL_LOCK(&amp;m-&gt;mutex);
      |   ^~~~~~~~~~~~

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>nedmalloc: do assignments only after the declaration section</title>
<updated>2019-08-07T18:54:45Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2019-08-07T13:08:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c9b9c09dae175f75bed4363cc6278c3f0cb3b9dd'/>
<id>urn:sha1:c9b9c09dae175f75bed4363cc6278c3f0cb3b9dd</id>
<content type='text'>
Avoid the following compiler warning:

In file included from compat/nedmalloc/nedmalloc.c:63:
compat/nedmalloc/malloc.c.h: In function ‘pthread_release_lock’:
compat/nedmalloc/malloc.c.h:1759:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 1759 |     volatile unsigned int* lp = &amp;sl-&gt;l;
      |     ^~~~~~~~

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>compat: move strdup(3) replacement to its own file</title>
<updated>2016-09-07T17:41:45Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2016-09-03T15:59:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca2baa3f7532dfe1816b623f39489ed10f3c9a49'/>
<id>urn:sha1:ca2baa3f7532dfe1816b623f39489ed10f3c9a49</id>
<content type='text'>
Move our implementation of strdup(3) out of compat/nedmalloc/ and
allow it to be used independently from USE_NED_ALLOCATOR.  The
original nedmalloc doesn't come with strdup() and doesn't need it.
Only _users_ of nedmalloc need it, which was added when we imported
it to our compat/ hierarchy.

This reduces the difference of our copy of nedmalloc from the
original, making it easier to update, and allows for easier testing
and reusing of our version of strdup().

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>nedmalloc: work around overzealous GCC 6 warning</title>
<updated>2016-08-05T22:37:47Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2016-08-04T21:56:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c6c9e1885c9025f2e4074105e4fbe9b008e5d1a3'/>
<id>urn:sha1:c6c9e1885c9025f2e4074105e4fbe9b008e5d1a3</id>
<content type='text'>
With GCC 6, the strdup() function is declared with the "nonnull"
attribute, stating that it is not allowed to pass a NULL value as
parameter.

In nedmalloc()'s reimplementation of strdup(), Postel's Law is heeded
and NULL parameters are handled gracefully. GCC 6 complains about that
now because it thinks that NULL cannot be passed to strdup() anyway.

Because the callers in this project of strdup() must be prepared to
call any implementation of strdup() supplied by the platform, so it
is pointless to pretend that it is OK to call it with NULL.

Remove the conditional based on NULL-ness of the input; this
squelches the warning.  Check the return value of malloc() instead
to make sure we actually got the memory to write to.

See https://gcc.gnu.org/gcc-6/porting_to.html for details.

Diagnosed-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>nedmalloc: fix misleading indentation</title>
<updated>2016-08-04T17:42:05Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-08-04T16:07:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1e70105954fd85fcb198a4b5b95378ecc3e6beef'/>
<id>urn:sha1:1e70105954fd85fcb198a4b5b95378ecc3e6beef</id>
<content type='text'>
Some code in nedmalloc is indented in a funny way that could be
misinterpreted as if a line after a for loop was included in the loop
body, when it is not.

GCC 6 complains about this in DEVELOPER=YepSure mode.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
