diff mbox

Fix -Wundef warning for HAVE_OBSTACK

Message ID 20140709070106.GA18813@spoyarek.pnq.redhat.com
State Committed
Headers show

Commit Message

Siddhesh Poyarekar July 9, 2014, 7:01 a.m. UTC
Remove the HAVE_OBSTACK macro check and include obstack check in
include path order since we don't have a copy of obstack.h in the
current directory.

Siddhesh

	* locale/programs/simple-hash.c [!HAVE_OBSTACK]: Remove code.

---
 locale/programs/simple-hash.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Andreas Schwab July 9, 2014, 7:23 a.m. UTC | #1
Siddhesh Poyarekar <siddhesh@redhat.com> writes:

> diff --git a/locale/programs/simple-hash.c b/locale/programs/simple-hash.c
> index ef371a0..8d087da 100644
> --- a/locale/programs/simple-hash.c
> +++ b/locale/programs/simple-hash.c
> @@ -27,11 +27,7 @@
>  #include <stdint.h>
>  #include <sys/types.h>
>  
> -#if HAVE_OBSTACK
>  # include <obstack.h>

Please remove the indentation.  Ok with that change.

Andreas.
Will Newton July 9, 2014, 8:04 a.m. UTC | #2
On 9 July 2014 08:01, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
> Remove the HAVE_OBSTACK macro check and include obstack check in
> include path order since we don't have a copy of obstack.h in the
> current directory.
>
> Siddhesh
>
>         * locale/programs/simple-hash.c [!HAVE_OBSTACK]: Remove code.
>
> ---
>  locale/programs/simple-hash.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/locale/programs/simple-hash.c b/locale/programs/simple-hash.c
> index ef371a0..8d087da 100644
> --- a/locale/programs/simple-hash.c
> +++ b/locale/programs/simple-hash.c
> @@ -27,11 +27,7 @@
>  #include <stdint.h>
>  #include <sys/types.h>
>
> -#if HAVE_OBSTACK
>  # include <obstack.h>
> -#else
> -# include "obstack.h"
> -#endif
>
>  #ifdef HAVE_VALUES_H
>  # include <values.h>

I wonder if we could go further than this - it looks like we should be
able to remove HAVE_CONFIG_H and HAVE_VALUES_H too.

Also the define of bcopy seems redundant.

And the definition of BITSPERBYTE. Maybe we can remove the include of
values.h too?

Your change looks ok in itself though (with fixed indentation).
Andreas Schwab July 9, 2014, 8:16 a.m. UTC | #3
Will Newton <will.newton@linaro.org> writes:

> I wonder if we could go further than this - it looks like we should be
> able to remove HAVE_CONFIG_H and HAVE_VALUES_H too.
>
> Also the define of bcopy seems redundant.
>
> And the definition of BITSPERBYTE. Maybe we can remove the include of
> values.h too?

I think the original intent was that the programs can also be built
standalone.

Andreas.
diff mbox

Patch

diff --git a/locale/programs/simple-hash.c b/locale/programs/simple-hash.c
index ef371a0..8d087da 100644
--- a/locale/programs/simple-hash.c
+++ b/locale/programs/simple-hash.c
@@ -27,11 +27,7 @@ 
 #include <stdint.h>
 #include <sys/types.h>
 
-#if HAVE_OBSTACK
 # include <obstack.h>
-#else
-# include "obstack.h"
-#endif
 
 #ifdef HAVE_VALUES_H
 # include <values.h>