I'm trying to run indent on the GNU M4 source code base before a
release (it looks like gnulib added the ability to run make indent
since the last time I made an m4 release).  But one change that indent
is insisting on is wrong:

-extern void m4_error (int, int, const char *, ...)
-  ATTRIBUTE_COLD ATTRIBUTE_FORMAT ((__printf__, 3, 4));
-extern void m4_error_at_line (int, int, const char *, int, const char *, ...)
-  ATTRIBUTE_COLD ATTRIBUTE_FORMAT ((__printf__, 5, 6));
-extern _Noreturn void m4_failure (int, const char *, ...)
+extern void
+m4_error (int, int, const char *, ...)
+     ATTRIBUTE_COLD ATTRIBUTE_FORMAT ((__printf__, 3, 4));
+     extern void m4_error_at_line (int, int, const char *, int, const char *,
+                                   ...)
+     ATTRIBUTE_COLD ATTRIBUTE_FORMAT ((__printf__, 5, 6));
+     extern _Noreturn void m4_failure (int, const char *, ...)

The old format may be awkward for starting the function name after the
return type, but even if I break that up, emacs still recommends:

extern void
m4_error (int, int, const char *, ...)
  ATTRIBUTE_COLD ATTRIBUTE_FORMAT ((__printf__, 3, 4));

And once indent gets messed up by the double attribute (both
ATTRIBUTE_COLD and ATTRIBUTE_FORMAT are macros that expand to
__attribute__ magic; the former without parameters), then the rest of
the file is messed up (as seen by the four-space indent before the
next extern function line).  Any ideas on how to tell indent about
ALL_CAPS macros that fit in attribute positions of declarations?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org


  • bug formatt... Eric Blake
    • Re: bu... Simon Josefsson via Bug reports for the GNU m4 macro processor
      • Re... Eric Blake
        • ... Simon Josefsson via Bug reports for the GNU m4 macro processor
          • ... Eric Blake
            • ... Simon Josefsson via Bug reports for the GNU m4 macro processor

Reply via email to