[Freeipa-devel] [PATCH 0228] Drop unnecessary #define _BSD_SOURCE

Lukas Slebodnik lslebodn at redhat.com
Mon Feb 24 17:56:37 UTC 2014


On (24/02/14 16:48), Petr Spacek wrote:
>Hello,
>
>Drop unnecessary #define _BSD_SOURCE.
>
>-- 
>Petr^2 Spacek

>From 1b5105e3ab92f2a898313da5f7e20e6f3e9d1d2a Mon Sep 17 00:00:00 2001
>From: Petr Spacek <pspacek at redhat.com>
>Date: Mon, 24 Feb 2014 16:48:09 +0100
>Subject: [PATCH] Drop unnecessary #define _BSD_SOURCE.
>
>Signed-off-by: Petr Spacek <pspacek at redhat.com>
>---
> src/krb5_helper.c | 2 --
> 1 file changed, 2 deletions(-)
>
>diff --git a/src/krb5_helper.c b/src/krb5_helper.c
>index d1787209483f2ae49b480492290ff5d4bafc677c..71f4fff9fec551abbd81e25c59de80d2ded0dfc6 100644
>--- a/src/krb5_helper.c
>+++ b/src/krb5_helper.c
>@@ -15,8 +15,6 @@
>  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
>  */
> 
>-#define _BSD_SOURCE
>-
> #include <isc/util.h>
> #include <string.h>
> #include <stdlib.h>
>-- 
>1.8.5.3
>

Simo is an author (according to git blame)
He defined this macro due to function setenv

from man setenv:
NAME
       setenv - change or add an environment variable

SYNOPSIS
       #include <stdlib.h>

       int setenv(const char *name, const char *value, int overwrite);

       int unsetenv(const char *name);

   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

       setenv(), unsetenv():
           _BSD_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600
----------------------------------------------------------------------------

Macros _BSD_SOURCE _POSIX_C_SOURCE were defined when I included
header file <stdlib.h>. I tested only on fedora 20. It can be used
on the other distributions.

I would rather let this macro as is.

If you really want to remove unused macro, you should look
to the another file :-)

ldap_helper.c:3829:0: warning: macro "LDAP_ENTRYCHANGE_ALL" is not used [-Wunused-macros]
 #define LDAP_ENTRYCHANGE_ALL (LDAP_SYNC_CAPI_ADD | LDAP_SYNC_CAPI_DELETE | LDAP_SYNC_CAPI_MODIFY)

LS




More information about the Freeipa-devel mailing list