On 2/18/18, Bruno Haible <br...@clisp.org> wrote:
> Hi Eric,
>
>> Previously I used to use the gl_WARN_ADD autoconf macro from gnulib to
>> test whether the compiler supports specific Objective C warning flags.
>> After recent gnulib changes to make gl_UNKNOWN_WARNINGS_ARE_ERRORS
>> language-specific, this broke. Attached is a patch to fix that.
>
> Thanks. Patch applied.
>
>> I'm pretty sure I already have a copyright assignment on file for gnulib,
>> but if not, this patch should be trivial enough to apply anyways.
>
> Indeed, the patch being nearly entirely a copy-and-paste of a block of code
> a couple of lines ahead, it does not require a copyright assignment.
>
> Do you also want to provide a 'build-aux/gobjc-warning.spec' file and
> a 'm4/manywarnings-objc.m4' file? Or don't you use the 'manywarnings'
> module?
>

I use the manywarnings module for C, but there aren't really that many
objc-specific warnings (in gcc at least), at least not enough to have
made me want a manywarnings-objc... but I guess I could propose one
anyways. Besides the 2 files you suggested attaching, I also attached
a test configure.ac, but one issue with it is that it seems to call
gl_UNKNOWN_WARNINGS_ARE_ERRORS before every single gl_WARN_ADD call,
resulting in lots of unnecessary duplicated lines of:
checking whether Objective C compiler handles -Werror
-Wunknown-warning-option... (cached) no
in the output. It doesn't do that with just the plain C version. Any idea why?

Eric

> Bruno
>
>
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 18249b8f2..eaa145c96 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -327,3 +327,10 @@ m4_defun([gl_MANYWARN_ALL_GCC(C++)],
 [
   gl_MANYWARN_ALL_GCC_CXX_IMPL([$1])
 ])
+
+# Specialization for _AC_LANG = Objective C.
+# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b.
+m4_defun([gl_MANYWARN_ALL_GCC(Objective C)],
+[
+  gl_MANYWARN_ALL_GCC_OBJC_IMPL([$1])
+])

Attachment: gobjc-warning.spec
Description: Binary data

Attachment: manywarnings-objc.m4
Description: Binary data

Attachment: configure.ac
Description: Binary data

Reply via email to