<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-compat-util.h, branch v2.4.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.4.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.4.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-06-16T21:33:41Z</updated>
<entry>
<title>Merge branch 'ep/do-not-feed-a-pointer-to-array-size' into maint</title>
<updated>2015-06-16T21:33:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-16T21:33:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=335f1a7eb2a08218301deae92244591a0ee9710c'/>
<id>urn:sha1:335f1a7eb2a08218301deae92244591a0ee9710c</id>
<content type='text'>
Catch a programmer mistake to feed a pointer not an array to
ARRAY_SIZE() macro, by using a couple of GCC extensions.

* ep/do-not-feed-a-pointer-to-array-size:
  git-compat-util.h: implement a different ARRAY_SIZE macro for for safely deriving the size of array
</content>
</entry>
<entry>
<title>git-compat-util.h: implement a different ARRAY_SIZE macro for for safely deriving the size of array</title>
<updated>2015-05-05T22:26:48Z</updated>
<author>
<name>Elia Pinto</name>
<email>gitter.spiros@gmail.com</email>
</author>
<published>2015-04-30T12:44:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=89c855ed3cbe64bea93ea081d0e96077e9ee8517'/>
<id>urn:sha1:89c855ed3cbe64bea93ea081d0e96077e9ee8517</id>
<content type='text'>
To get number of elements in an array git use the ARRAY_SIZE macro
defined as:

       #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))

The problem with it is a possibility of mistakenly passing to it a
pointer instead an array. The ARRAY_SIZE macro as conventionally
defined does not provide good type-safety and the open-coded
approach is more fragile, more verbose and provides no improvement in
type-safety.

Use instead a different but compatible ARRAY_SIZE() macro,
which will also break compile if you try to
use it on a pointer. This implemention revert to the original code
if the compiler doesn't know the typeof and __builtin_types_compatible_p
GCC extensions.

This can ensure our code is robust to changes, without
needing a gratuitous macro or constant. A similar
ARRAY_SIZE implementation also exists in the linux kernel.

Credits to Rusty Russell and his ccan library.

Signed-off-by: Elia Pinto &lt;gitter.spiros@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'km/bsd-sysctl'</title>
<updated>2015-03-20T20:11:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-20T20:11:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=551fc7aec1a7efe868a59fbeea14582b41923f4d'/>
<id>urn:sha1:551fc7aec1a7efe868a59fbeea14582b41923f4d</id>
<content type='text'>
We now detect number of CPUs on older BSD-derived systems.

* km/bsd-sysctl:
  thread-utils.c: detect CPU count on older BSD-like systems
  configure: support HAVE_BSD_SYSCTL option
</content>
</entry>
<entry>
<title>Merge branch 'km/bsd-shells'</title>
<updated>2015-03-20T20:11:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-20T20:11:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ec0465ade87996214959a393239eec520daf92ea'/>
<id>urn:sha1:ec0465ade87996214959a393239eec520daf92ea</id>
<content type='text'>
Portability fixes and workarounds for shell scripts have been added
to help BSD-derived systems.

* km/bsd-shells:
  t5528: do not fail with FreeBSD shell
  help.c: use SHELL_PATH instead of hard-coded "/bin/sh"
  git-compat-util.h: move SHELL_PATH default into header
  git-instaweb: use @SHELL_PATH@ instead of /bin/sh
  git-instaweb: allow running in a working tree subdirectory
</content>
</entry>
<entry>
<title>configure: support HAVE_BSD_SYSCTL option</title>
<updated>2015-03-10T22:13:25Z</updated>
<author>
<name>Kyle J. McKay</name>
<email>mackyle@gmail.com</email>
</author>
<published>2015-03-08T07:14:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9529080de253b89474402f323e10470656764b3a'/>
<id>urn:sha1:9529080de253b89474402f323e10470656764b3a</id>
<content type='text'>
On BSD-compatible systems some information such as the number
of available CPUs may only be available via the sysctl function.

Add support for a HAVE_BSD_SYSCTL option complete with autoconf
support and include the sys/syctl.h header when the option is
enabled to make the sysctl function available.

Signed-off-by: Kyle J. McKay &lt;mackyle@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-compat-util.h: move SHELL_PATH default into header</title>
<updated>2015-03-10T22:11:24Z</updated>
<author>
<name>Kyle J. McKay</name>
<email>mackyle@gmail.com</email>
</author>
<published>2015-03-08T05:07:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1b56cdf901f6e6a73d0edadf56afb1c878c7622a'/>
<id>urn:sha1:1b56cdf901f6e6a73d0edadf56afb1c878c7622a</id>
<content type='text'>
If SHELL_PATH is not defined we use "/bin/sh".  However,
run-command.c is not the only file that needs to use
the default value so move it into a common header.

Signed-off-by: Kyle J. McKay &lt;mackyle@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bw/kwset-use-unsigned'</title>
<updated>2015-03-06T23:02:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-06T23:02:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=52d5bf77875275bbfc1bf1d7b690f355d5c869e4'/>
<id>urn:sha1:52d5bf77875275bbfc1bf1d7b690f355d5c869e4</id>
<content type='text'>
The borrowed code in kwset API did not follow our usual convention
to use "unsigned char" to store values that range from 0-255.

* bw/kwset-use-unsigned:
  kwset: use unsigned char to store values with high-bit set
</content>
</entry>
<entry>
<title>Merge branch 'rj/no-xopen-source-for-cygwin' into maint</title>
<updated>2015-03-06T22:57:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-06T22:57:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f69f5f19cfae949b2bbd6c6ffbb990b6a00d04b0'/>
<id>urn:sha1:f69f5f19cfae949b2bbd6c6ffbb990b6a00d04b0</id>
<content type='text'>
Code cleanups.

* rj/no-xopen-source-for-cygwin:
  git-compat-util.h: remove redundant code
</content>
</entry>
<entry>
<title>Merge branch 'es/squelch-openssl-warnings-on-macosx' into maint</title>
<updated>2015-03-05T21:13:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-05T21:13:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e591339ce7632f3c9000f0fde8ee4813f061a11e'/>
<id>urn:sha1:e591339ce7632f3c9000f0fde8ee4813f061a11e</id>
<content type='text'>
An earlier workaround to squelch unhelpful deprecation warnings
from the complier on Mac OSX unnecessarily set minimum required
version of the OS, which the user might want to raise (or lower)
for other reasons.

* es/squelch-openssl-warnings-on-macosx:
  git-compat-util: do not step on MAC_OS_X_VERSION_MIN_REQUIRED
</content>
</entry>
<entry>
<title>Merge branch 'rj/no-xopen-source-for-cygwin'</title>
<updated>2015-03-05T20:45:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-05T20:45:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca704731b1fdf77b8f6d296bcde206c67ed9d73a'/>
<id>urn:sha1:ca704731b1fdf77b8f6d296bcde206c67ed9d73a</id>
<content type='text'>
Code cleanups.

* rj/no-xopen-source-for-cygwin:
  git-compat-util.h: remove redundant code
</content>
</entry>
</feed>
