[brlcad-commits] SF.net SVN: brlcad:[68950] brlcad/trunk/include/bu
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2016-09-30 20:27:10
|
Revision: 68950 http://sourceforge.net/p/brlcad/code/68950 Author: starseeker Date: 2016-09-30 20:27:07 +0000 (Fri, 30 Sep 2016) Log Message: ----------- Revert 68151. The separation is important - bu_badmagic won't build with _BU_ATTR_NORETURN, but the others need both. Modified Paths: -------------- brlcad/trunk/include/bu/defines.h brlcad/trunk/include/bu/log.h brlcad/trunk/include/bu/magic.h Modified: brlcad/trunk/include/bu/defines.h =================================================================== --- brlcad/trunk/include/bu/defines.h 2016-09-30 19:54:51 UTC (rev 68949) +++ brlcad/trunk/include/bu/defines.h 2016-09-30 20:27:07 UTC (rev 68950) @@ -120,15 +120,22 @@ /** * shorthand declaration of a function that doesn't return */ -#if defined(HAVE_NORETURN_ATTRIBUTE) && defined(HAVE_ANALYZER_NORETURN_ATTRIBUTE) - /* clang static analyzer is needing an additional flag set */ -# define _BU_ATTR_NORETURN __attribute__((__noreturn__)) __attribute__((analyzer_noreturn)) -#elif defined(HAVE_NORETURN_ATTRIBUTE) +#ifdef HAVE_NORETURN_ATTRIBUTE # define _BU_ATTR_NORETURN __attribute__((__noreturn__)) #else # define _BU_ATTR_NORETURN #endif +/* For the moment, we need to specially flag some functions + * for clang. It's not clear if we will always need to do + * this, but for now this suppresses a lot of noise in the + * reports */ +#ifdef HAVE_ANALYZER_NORETURN_ATTRIBUTE +# define _BU_ATTR_ANALYZE_NORETURN __attribute__((analyzer_noreturn)) +#else +# define _BU_ATTR_ANALYZE_NORETURN +#endif + /** * shorthand declaration of a function that should always be inline */ Modified: brlcad/trunk/include/bu/log.h =================================================================== --- brlcad/trunk/include/bu/log.h 2016-09-30 19:54:51 UTC (rev 68949) +++ brlcad/trunk/include/bu/log.h 2016-09-30 20:27:07 UTC (rev 68950) @@ -177,7 +177,7 @@ * This routine should never return unless there is a BU_SETJUMP() * handler registered. */ -BU_EXPORT extern void bu_bomb(const char *str) _BU_ATTR_NORETURN; +BU_EXPORT extern void bu_bomb(const char *str)_BU_ATTR_ANALYZE_NORETURN _BU_ATTR_NORETURN; /** * Semi-graceful termination of the application that doesn't cause a @@ -191,7 +191,7 @@ * * This routine should never return. */ -BU_EXPORT extern void bu_exit(int status, const char *fmt, ...) _BU_ATTR_NORETURN _BU_ATTR_PRINTF23; +BU_EXPORT extern void bu_exit(int status, const char *fmt, ...) _BU_ATTR_ANALYZE_NORETURN _BU_ATTR_NORETURN _BU_ATTR_PRINTF23; /** * @brief Modified: brlcad/trunk/include/bu/magic.h =================================================================== --- brlcad/trunk/include/bu/magic.h 2016-09-30 19:54:51 UTC (rev 68949) +++ brlcad/trunk/include/bu/magic.h 2016-09-30 20:27:07 UTC (rev 68950) @@ -247,7 +247,7 @@ /** * Support routine for BU_CKMAG macro. */ -BU_EXPORT extern void bu_badmagic(const uint32_t *ptr, uint32_t magic, const char *str, const char *file, int line) _BU_ATTR_NORETURN; +BU_EXPORT extern void bu_badmagic(const uint32_t *ptr, uint32_t magic, const char *str, const char *file, int line) _BU_ATTR_ANALYZE_NORETURN; /** @brief Routines involved with handling "magic numbers" used to identify various in-memory data structures. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |