git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Cc: Junio C Hamano <gitster@pobox.com>,
	GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH 6/6] compat/nedmalloc: Fix compiler warnings on linux
Date: Sun, 28 Apr 2013 22:06:16 -0700	[thread overview]
Message-ID: <20130429050616.GB8031@elie.Belkin> (raw)
In-Reply-To: <517C1CF9.2080903@ramsay1.demon.co.uk>

Hi,

Ramsay Jones wrote:

> --- a/compat/nedmalloc/malloc.c.h
> +++ b/compat/nedmalloc/malloc.c.h
> @@ -484,6 +484,10 @@ MAX_RELEASE_CHECK_RATE   default: 4095 unless not HAVE_MMAP
>  #define DLMALLOC_VERSION 20804
>  #endif /* DLMALLOC_VERSION */
> 
> +#if defined(linux)
> +#define _GNU_SOURCE 1
> +#endif

If we want to do this, I'd suggest defining _GNU_SOURCE
unconditionally.  Other platforms using glibc would benefit from it,
too, and other platforms not using glibc shouldn't care.

Alternatively it could make sense to see if the latest version from
Niall Douglas[1] works, which includes the following:

	#ifndef HAVE_MREMAP
	#ifdef linux
	#define HAVE_MREMAP 1
	#ifndef _GNU_SOURCE
	#define _GNU_SOURCE /* Turns on mremap() definition */
	#endif
	#else   /* linux */
	#define HAVE_MREMAP 0
	#endif  /* linux */
	#endif  /* HAVE_MREMAP */

It looks equally wrong there, but since it comes from upstream we
could just punt to him if anyone runs into problems. ;-)

My two cents,
Jonathan

[1] http://www.nedprod.com/programs/portable/nedmalloc/

  parent reply	other threads:[~2013-04-29  5:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-27 18:46 [PATCH 6/6] compat/nedmalloc: Fix compiler warnings on linux Ramsay Jones
2013-04-28 19:25 ` Junio C Hamano
2013-04-29 23:01   ` Ramsay Jones
2013-04-29  5:06 ` Jonathan Nieder [this message]
2013-04-29 23:09   ` Ramsay Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130429050616.GB8031@elie.Belkin \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ramsay@ramsay1.demon.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).