in packages that define ARGMATCH_DIE_DECL, like coreutils.
* tests/test-exclude.c [ARGMATCH_DIE_DECL]: Also declare the function.
Since it always exits, declare with the "noreturn" attribute.
* tests/test-argmatch.c: Likewise.
2010-06-11 Jim Meyering <meyering@redhat.com>
+ tests: avoid compilation warnings in argmatch and exclude tests...
+ in packages that define ARGMATCH_DIE_DECL, like coreutils.
+ * tests/test-exclude.c [ARGMATCH_DIE_DECL]: Also declare the function.
+ Since it always exits, declare with the "noreturn" attribute.
+ * tests/test-argmatch.c: Likewise.
+
tests: avoid 'const' discard warnings in mbsstr tests
* tests/test-mbsstr1.c (main): Add "const" to avoid trivial warning.
* tests/test-mbsstr2.c (main): Likewise.
/* Some packages define ARGMATCH_DIE and ARGMATCH_DIE_DECL in <config.h>, and
thus must link with a definition of that function. Provide it here. */
#ifdef ARGMATCH_DIE_DECL
+#ifndef __attribute__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
+# define __attribute__(x) /* empty */
+# endif
+#endif
+
+#ifndef ATTRIBUTE_NORETURN
+# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#endif
+
+ARGMATCH_DIE_DECL ATTRIBUTE_NORETURN;
ARGMATCH_DIE_DECL { exit (1); }
#endif
/* Some packages define ARGMATCH_DIE and ARGMATCH_DIE_DECL in <config.h>, and
thus must link with a definition of that function. Provide it here. */
#ifdef ARGMATCH_DIE_DECL
+#ifndef __attribute__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
+# define __attribute__(x) /* empty */
+# endif
+#endif
+
+#ifndef ATTRIBUTE_NORETURN
+# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#endif
+
+ARGMATCH_DIE_DECL ATTRIBUTE_NORETURN;
ARGMATCH_DIE_DECL { exit (1); }
#endif