attributes: add av_noreturn
authorReinhard Tartler <siretart@tauware.de>
Sun, 1 Jul 2012 17:38:40 +0000 (19:38 +0200)
committerReinhard Tartler <siretart@tauware.de>
Tue, 3 Jul 2012 15:26:51 +0000 (17:26 +0200)
Also use it in the declaration of the various exit_program
implementations in avtools.

inspired by a clang-scan report.

cmdutils.h
libavutil/attributes.h

index 793a1e8..ca4f4c1 100644 (file)
@@ -373,7 +373,7 @@ FILE *get_preset_file(char *filename, size_t filename_size,
  * Do all the necessary cleanup and abort.
  * This function is implemented in the avtools, not cmdutils.
  */
-void exit_program(int ret);
+av_noreturn void exit_program(int ret);
 
 /**
  * Realloc array to hold new_size elements of elem_size.
index 7a9b18b..292a0a1 100644 (file)
 #    define av_printf_format(fmtpos, attrpos)
 #endif
 
+#if AV_GCC_VERSION_AT_LEAST(2,5)
+#    define av_noreturn __attribute__((noreturn))
+#else
+#    define av_noreturn
+#endif
+
 #endif /* AVUTIL_ATTRIBUTES_H */