[FFmpeg-cvslog] attributes: add av_noreturn

Reinhard Tartler git at videolan.org
Wed Jul 4 00:36:33 CEST 2012


ffmpeg | branch: master | Reinhard Tartler <siretart at tauware.de> | Sun Jul  1 19:38:40 2012 +0200| [22662ca56086ddb7240dc84a68ad89c785682f36] | committer: Reinhard Tartler

attributes: add av_noreturn

Also use it in the declaration of the various exit_program
implementations in avtools.

inspired by a clang-scan report.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=22662ca56086ddb7240dc84a68ad89c785682f36
---

 cmdutils.h             |    2 +-
 libavutil/attributes.h |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/cmdutils.h b/cmdutils.h
index 793a1e8..ca4f4c1 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -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.
diff --git a/libavutil/attributes.h b/libavutil/attributes.h
index 7a9b18b..292a0a1 100644
--- a/libavutil/attributes.h
+++ b/libavutil/attributes.h
@@ -113,4 +113,10 @@
 #    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 */



More information about the ffmpeg-cvslog mailing list