git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix _XOPEN_SOURCE problem on DragonFly
@ 2010-03-04  2:05 YONETANI Tomokazu
  2010-04-01  7:37 ` YONETANI Tomokazu
  0 siblings, 1 reply; 5+ messages in thread
From: YONETANI Tomokazu @ 2010-03-04  2:05 UTC (permalink / raw)
  To: git

Hi.
DragonFly has the same problem that FreeBSD used to have.  Since the
return value of implicitly declared functions defaults to int, it can
cause disasters on architectures where sizeof(int) < sizeof(void *).
The patch below should address this issue.

Best regards,
YONETANI Tomokazu.

diff --git a/git-compat-util.h b/git-compat-util.h
index a3c4537..e292926 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -55,7 +55,8 @@
 # else
 # define _XOPEN_SOURCE 500
 # endif
-#elif !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)
+#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
+      !defined(_M_UNIX) && !defined(sgi) && !defined(__DragonFly__)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix _XOPEN_SOURCE problem on DragonFly
  2010-03-04  2:05 [PATCH] Fix _XOPEN_SOURCE problem on DragonFly YONETANI Tomokazu
@ 2010-04-01  7:37 ` YONETANI Tomokazu
  2010-04-01 14:37   ` Tay Ray Chuan
  0 siblings, 1 reply; 5+ messages in thread
From: YONETANI Tomokazu @ 2010-04-01  7:37 UTC (permalink / raw)
  To: gitster; +Cc: git

Hello.
Is there anything else I need to do to get this in?

On Thu, Mar 04, 2010 at 11:05:22AM +0900, YONETANI Tomokazu wrote:
> Hi.
> DragonFly has the same problem that FreeBSD used to have.  Since the
> return value of implicitly declared functions defaults to int, it can
> cause disasters on architectures where sizeof(int) < sizeof(void *).
> The patch below should address this issue.
> 
> Best regards,
> YONETANI Tomokazu.
> 
> diff --git a/git-compat-util.h b/git-compat-util.h
> index a3c4537..e292926 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -55,7 +55,8 @@
>  # else
>  # define _XOPEN_SOURCE 500
>  # endif
> -#elif !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)
> +#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
> +      !defined(_M_UNIX) && !defined(sgi) && !defined(__DragonFly__)
>  #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
>  #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
>  #endif

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix _XOPEN_SOURCE problem on DragonFly
  2010-04-01  7:37 ` YONETANI Tomokazu
@ 2010-04-01 14:37   ` Tay Ray Chuan
  2010-04-02  8:02     ` YONETANI Tomokazu
  0 siblings, 1 reply; 5+ messages in thread
From: Tay Ray Chuan @ 2010-04-01 14:37 UTC (permalink / raw)
  To: YONETANI Tomokazu; +Cc: gitster, git

Hi,

On Thu, Apr 1, 2010 at 3:37 PM, YONETANI Tomokazu <qhwt+git@les.ath.cx> wrote:
> Hello.
> Is there anything else I need to do to get this in?

you should read Documentation/SubmittingPatches:

  http://github.com/git/git/blob/HEAD/Documentation/SubmittingPatches

Briefly,

1. Generate your patch with git-format-patch.

2. s-o-b.

-- 
Cheers,
Ray Chuan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Fix _XOPEN_SOURCE problem on DragonFly
@ 2010-04-02  7:52 YONETANI Tomokazu
  0 siblings, 0 replies; 5+ messages in thread
From: YONETANI Tomokazu @ 2010-04-02  7:52 UTC (permalink / raw)
  To: git

As on FreeBSD, defining _XOPEN_SOURCE to 600 on DragonFly BSD 2.4-RELEASE
or later hides symbols from programs, which leads to implicit declaration
of functions, making the return value to be assumed an int.  On architectures
where sizeof(int) < sizeof(void *), this can cause unexpected behaviors or
crashes.
This change won't affect other OSes unless they define __DragonFly__ macro,
or older versions of DragonFly BSD as the current git code doesn't rely on
the features only available with _XOPEN_SOURCE set to 600 on DragonFly.

Signed-off-by: YONETANI Tomokazu <y0netan1@dragonflybsd.org>
---
 git-compat-util.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index a3c4537..e292926 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -55,7 +55,8 @@
 # else
 # define _XOPEN_SOURCE 500
 # endif
-#elif !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)
+#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
+      !defined(_M_UNIX) && !defined(sgi) && !defined(__DragonFly__)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
-- 
1.6.6.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Fix _XOPEN_SOURCE problem on DragonFly
  2010-04-01 14:37   ` Tay Ray Chuan
@ 2010-04-02  8:02     ` YONETANI Tomokazu
  0 siblings, 0 replies; 5+ messages in thread
From: YONETANI Tomokazu @ 2010-04-02  8:02 UTC (permalink / raw)
  To: Tay Ray Chuan; +Cc: gitster, git

On Thu, Apr 01, 2010 at 10:37:48PM +0800, Tay Ray Chuan wrote:
> On Thu, Apr 1, 2010 at 3:37 PM, YONETANI Tomokazu <qhwt+git@les.ath.cx> wrote:
> > Hello.
> > Is there anything else I need to do to get this in?
> 
> you should read Documentation/SubmittingPatches:
> 
>   http://github.com/git/git/blob/HEAD/Documentation/SubmittingPatches
> 
> Briefly,
> 
> 1. Generate your patch with git-format-patch.
> 
> 2. s-o-b.

I *thought* having read something like that before :)  Thanks for the hint.
I just re-submitted the patch to meet the requirement.  Hopefully the new
one won't annoy anyone.

Best regards,
YONETANI Tomokazu.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-02  8:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-04  2:05 [PATCH] Fix _XOPEN_SOURCE problem on DragonFly YONETANI Tomokazu
2010-04-01  7:37 ` YONETANI Tomokazu
2010-04-01 14:37   ` Tay Ray Chuan
2010-04-02  8:02     ` YONETANI Tomokazu
  -- strict thread matches above, loose matches on Subject: below --
2010-04-02  7:52 YONETANI Tomokazu

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).