Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -92,11 +92,10 @@ AX_CHECK_COMPILER_FLAGS(-std=c99, [OBJCFLAGS="$OBJCFLAGS -std=c99"]) ]) ]) -AX_CHECK_COMPILER_FLAGS(-pedantic, [OBJCFLAGS="$OBJCFLAGS -pedantic"]) AX_CHECK_COMPILER_FLAGS(-pipe, [OBJCFLAGS="$OBJCFLAGS -pipe"]) AX_CHECK_COMPILER_FLAGS(-fno-common, [OBJCFLAGS="$OBJCFLAGS -fno-common"]) AX_CHECK_COMPILER_FLAGS(-fno-constant-cfstrings, [ OBJCFLAGS="$OBJCFLAGS -fno-constant-cfstrings" AC_SUBST(NO_CONST_CFSTRINGS, "-fno-constant-cfstrings") @@ -649,13 +648,13 @@ if (__sync_add_and_fetch(&i, 1)) j = __sync_sub_and_fetch(&i, 1); while (!__sync_bool_compare_and_swap(&i, 0, 1)); ], [ AC_MSG_RESULT(yes) - atomic_ops="gcc builtins" + atomic_ops="GCC builtins" AC_DEFINE(OF_HAVE_GCC_ATOMIC_OPS, 1, - [Whether gcc atomic operations are available]) + [Whether GCC atomic operations are available]) ], [ AC_MSG_RESULT(no) ]) AC_MSG_CHECKING(whether we have an atomic ops assembly implementation) @@ -928,11 +927,11 @@ esac AS_IF([test x"$GOBJC" = x"yes"], [ OBJCFLAGS="$OBJCFLAGS -Wwrite-strings -Wpointer-arith -Werror" - AC_MSG_CHECKING(whether we have gcc bug objc/27438) + AC_MSG_CHECKING(whether we have GCC bug objc/27438) AC_TRY_COMPILE([ @interface OFConstantString { struct objc_class *isa; const char *string; @@ -950,11 +949,11 @@ AC_MSG_RESULT([yes, adding -Wno-unused-variable]) OBJCFLAGS="$OBJCFLAGS -Wno-unused-variable" AC_SUBST(NO_WARN_UNUSED, "-Wno-unused-variable") ]) - AC_MSG_CHECKING(whether we need -Wno-strict-aliasing due to gcc bugs) + AC_MSG_CHECKING(whether we need -Wno-strict-aliasing due to GCC bugs) AC_TRY_COMPILE([ @interface Foo { struct objc_class *isa; } @@ -1017,10 +1016,36 @@ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) OBJCFLAGS="$old_OBJCFLAGS" ]) + + old_OBJCFLAGS="$OBJCFLAGS" + OBJCFLAGS="$OBJCFLAGS -pedantic" + AC_MSG_CHECKING(whether -pedantic is buggy) + AC_TRY_COMPILE([ + #import + + #ifdef __has_attribute + # if __has_attribute(objc_root_class) + __attribute__((__objc_root_class__)) + # endif + #endif + @interface Foo + { + void *foo; + } + @end + + @interface Bar: Foo + @end + ], [], [ + AC_MSG_RESULT(no) + ], [ + AC_MSG_RESULT(yes) + OBJCFLAGS="$old_OBJCFLAGS" + ]) ]) AS_IF([test x"$cross_compiling" = x"yes"], [ AC_SUBST(BIN_PREFIX, "${host_alias}-")