<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/compat/obstack.h, branch v2.23.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.23.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.23.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-06-20T21:03:05Z</updated>
<entry>
<title>obstack: fix compiler warning</title>
<updated>2019-06-20T21:03:05Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2019-06-19T21:05:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=96a0679441224e1a1d6f8afd6e25671ce577b92f'/>
<id>urn:sha1:96a0679441224e1a1d6f8afd6e25671ce577b92f</id>
<content type='text'>
MS Visual C suggests that the construct

	condition ? (int) i : (ptrdiff_t) d

is incorrect. Let's fix this by casting to ptrdiff_t also for the
positive arm of the conditional.

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/obstack: fix -Wcast-function-type warnings</title>
<updated>2019-01-17T19:13:38Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2019-01-17T01:29:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=764473d25772aeb6e1f02743bc13a6da8eb18cc3'/>
<id>urn:sha1:764473d25772aeb6e1f02743bc13a6da8eb18cc3</id>
<content type='text'>
GCC 8 introduced the new -Wcast-function-type warning, which is
implied by -Wextra (which, in turn is enabled in our DEVELOPER flags).
When building Git with GCC 8 and this warning enabled on a non-glibc
platform [1], one is greeted with a screenful of compiler
warnings/errors:

  compat/obstack.c: In function '_obstack_begin':
  compat/obstack.c:162:17: error: cast between incompatible function types from 'void * (*)(long int)' to 'struct _obstack_chunk * (*)(void *, long int)' [-Werror=cast-function-type]
     h-&gt;chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
                   ^
  compat/obstack.c:163:16: error: cast between incompatible function types from 'void (*)(void *)' to 'void (*)(void *, struct _obstack_chunk *)' [-Werror=cast-function-type]
     h-&gt;freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
                  ^
  compat/obstack.c:116:8: error: cast between incompatible function types from 'struct _obstack_chunk * (*)(void *, long int)' to 'struct _obstack_chunk * (*)(long int)' [-Werror=cast-function-type]
      : (*(struct _obstack_chunk *(*) (long)) (h)-&gt;chunkfun) ((size)))
          ^
  compat/obstack.c:168:22: note: in expansion of macro 'CALL_CHUNKFUN'
     chunk = h-&gt;chunk = CALL_CHUNKFUN (h, h -&gt; chunk_size);
                        ^~~~~~~~~~~~~
  &lt;snip&gt;

'struct obstack' stores pointers to two functions to allocate and free
"chunks", and depending on how obstack is used, these functions take
either one parameter (like standard malloc() and free() do; this is
how we use it in 'kwset.c') or two parameters.  Presumably to reduce
memory footprint, a single field is used to store the function pointer
for both signatures, and then it's casted to the appropriate signature
when the function pointer is accessed.  These casts between function
pointers with different number of parameters are what trigger those
compiler errors.

Modify 'struct obstack' to use unions to store function pointers with
different signatures, and then use the union member with the
appropriate signature when accessing these function pointers.  This
eliminates the need for those casts, and thus avoids this compiler
error.

[1] Compiling 'compat/obstack.c' on a platform with glibc is sort of
    a noop, see the comment before '#  define ELIDE_CODE', so this is
    not an issue on common Linux distros.

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Replace Free Software Foundation address in license notices</title>
<updated>2017-11-09T04:21:21Z</updated>
<author>
<name>Todd Zullinger</name>
<email>tmz@pobox.com</email>
</author>
<published>2017-11-07T05:39:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=484257925fada31045aefec7484fd663f7c40c2f'/>
<id>urn:sha1:484257925fada31045aefec7484fd663f7c40c2f</id>
<content type='text'>
The mailing address for the FSF has changed over the years.  Rather than
updating the address across all files, refer readers to gnu.org, as the
GNU GPL documentation now suggests for license notices.  The mailing
address is retained in the full license files (COPYING and LGPL-2.1).

The old address is still present in t/diff-lib/COPYING.  This is
intentional, as the file is used in tests and the contents are not
expected to change.

Signed-off-by: Todd Zullinger &lt;tmz@pobox.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>obstack: fix spelling of similar</title>
<updated>2013-04-12T19:23:20Z</updated>
<author>
<name>Stefano Lattarini</name>
<email>stefano.lattarini@gmail.com</email>
</author>
<published>2013-04-11T22:36:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7323513d287d00fe2b40d659fb49042fb027e749'/>
<id>urn:sha1:7323513d287d00fe2b40d659fb49042fb027e749</id>
<content type='text'>
Noticed using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini &lt;stefano.lattarini@gmail.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Acked-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>obstack: Fix portability issues</title>
<updated>2011-08-29T05:03:26Z</updated>
<author>
<name>Fredrik Kuivinen</name>
<email>frekui@gmail.com</email>
</author>
<published>2011-08-28T20:08:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d190a0875ff0f33d60a4d7265f2098b35d162f68'/>
<id>urn:sha1:d190a0875ff0f33d60a4d7265f2098b35d162f68</id>
<content type='text'>
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1, SunOS 5.10, and possibly
others do not have exit.h and exitfail.h. Remove the use of these in
obstack.c.

The __block variable was renamed to block to avoid a gcc error:

compat/obstack.h:190: error: __block attribute can be specified on variables only

Initial-patch-by: David Aguilar &lt;davvid@gmail.com&gt;
Reported-by: Brian Gernhardt &lt;brian@gernhardtsoftware.com&gt;
Signed-off-by: Fredrik Kuivinen &lt;frekui@gmail.com&gt;
Acked-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Add obstack.[ch] from EGLIBC 2.10</title>
<updated>2011-08-21T05:30:46Z</updated>
<author>
<name>Fredrik Kuivinen</name>
<email>frekui@gmail.com</email>
</author>
<published>2011-08-20T22:40:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e831171d67469f3942c56433e3cd3c98fca15e72'/>
<id>urn:sha1:e831171d67469f3942c56433e3cd3c98fca15e72</id>
<content type='text'>
Signed-off-by: Fredrik Kuivinen &lt;frekui@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
