[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/18] Makefile.am: Ensure indent builds with clang
From: |
Tim Hentenaar |
Subject: |
[PATCH 16/18] Makefile.am: Ensure indent builds with clang |
Date: |
Sat, 4 Jul 2015 13:43:30 +0200 |
Signed-off-by: Tim Hentenaar <address@hidden>
---
src/Makefile.am | 18 ++++++++++++------
src/gperf-cc.c | 4 ++--
src/gperf.c | 4 ++--
3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index f764662..ed60768 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,10 +18,12 @@ LIBS = @LIBINTL@ @LIBS@
MAINTAINERCLEANFILES= Makefile.in libgettext.h
-AM_CFLAGS=-ansi -pedantic -Wall -Werror -Wredundant-decls -Wshadow
-AM_CFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
-AM_CFLAGS+=-Wmissing-declarations -Wcomment -Wbad-function-cast
-AM_CFLAGS+=-Wcast-align -I.
+# Only pass -ansi and -pedantic via CC otherwise clang compains
+CCLD := $(CC)
+CC := $(CC) -ansi -pedantic
+AM_CFLAGS = -Wall -Werror -Wredundant-decls -Wshadow -Wstrict-prototypes
+AM_CFLAGS += -Wmissing-prototypes -Wnested-externs -Wmissing-declarations
+AM_CFLAGS += -Wcomment -Wbad-function-cast -Wcast-align
## Use -g when in maintainer mode
if MAINTAINER_MODE
@@ -31,13 +33,17 @@ endif
gperf.c: indent.gperf
@gperf -D -c -l -p -t -T -g -j1 -o -K rwd\
-L ANSI-C -N is_reserved indent.gperf > gperf.c
- @sed -ie 's/index/idx/g' gperf.c
+ @sed -i -e 's/index/idx/g'\
+ -e 's/ifdef __GNUC__/if defined(__GNUC__) \&\&
\!defined(__clang__)/'\
+ gperf.c
gperf-cc.c: indent-cc.gperf
@gperf -D -c -l -p -t -T -g -j1 -o -K rwd\
-L ANSI-C -N is_reserved_cc -H hash_cc\
indent-cc.gperf > gperf-cc.c
- @sed -ie 's/index/idx/g' gperf-cc.c
+ @sed -i -e 's/index/idx/g'\
+ -e 's/ifdef __GNUC__/if defined(__GNUC__) \&\&
\!defined(__clang__)/'\
+ gperf-cc.c
if MAINTAINER_MODE
diff --git a/src/gperf-cc.c b/src/gperf-cc.c
index 60a4d2b..61e2e76 100644
--- a/src/gperf-cc.c
+++ b/src/gperf-cc.c
@@ -37,7 +37,7 @@
#define MAX_HASH_VALUE 57
/* maximum key range = 55, duplicates = 0 */
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__clang__)
__inline
#else
#ifdef __cplusplus
@@ -91,7 +91,7 @@ hash_cc (register const char *str, register unsigned int len)
return hval;
}
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__clang__)
__inline
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__))
diff --git a/src/gperf.c b/src/gperf.c
index 130b0e6..89a1a49 100644
--- a/src/gperf.c
+++ b/src/gperf.c
@@ -37,7 +37,7 @@
#define MAX_HASH_VALUE 41
/* maximum key range = 39, duplicates = 0 */
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__clang__)
__inline
#else
#ifdef __cplusplus
@@ -90,7 +90,7 @@ hash (register const char *str, register unsigned int len)
return hval;
}
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__clang__)
__inline
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__))
--
2.3.6
- [PATCH 07/18] gperf*.c: Fix compiler warnings, (continued)
- [PATCH 07/18] gperf*.c: Fix compiler warnings, Tim Hentenaar, 2015/07/04
- [PATCH 08/18] texinfo2man: Fix potential buffer overruns and NULL pointer dereferences, Tim Hentenaar, 2015/07/04
- [PATCH 09/18] output.c: Remove dead code, Tim Hentenaar, 2015/07/04
- [PATCH 10/18] output.c: Fix potential NULL pointer dereferences, Tim Hentenaar, 2015/07/04
- [PATCH 11/18] output.c: Remove unused variable 'boolean_operator', Tim Hentenaar, 2015/07/04
- [PATCH 12/18] globs: Fix WARNING and ERROR macros to use char * instead of int *, Tim Hentenaar, 2015/07/04
- [PATCH 13/18] sys.h: Remove unused INLINE macro, Tim Hentenaar, 2015/07/04
- [PATCH 14/18] lexi.c: Remove dead code, Tim Hentenaar, 2015/07/04
- [PATCH 15/18] output: Don't shadow current_column(), Tim Hentenaar, 2015/07/04
- [PATCH 17/18] code_io.c: Fix file size test, Tim Hentenaar, 2015/07/04
- [PATCH 16/18] Makefile.am: Ensure indent builds with clang,
Tim Hentenaar <=
- [PATCH 18/18] parse.h: Add prototype for debug_init(), Tim Hentenaar, 2015/07/04