Changeset d6c1dd0 for src/include


Ignore:
Timestamp:
Aug 1, 2017, 11:58:44 AM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
ff56efdf
Parents:
5c80197
Message:

formatting and add attribute "format" to C++ assert_fail_f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/include/assert.h

    r5c80197 rd6c1dd0  
    1010// Created On       : Thu Aug 18 13:19:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Aug 18 13:25:55 2016
    13 // Update Count     : 4
     12// Last Modified On : Tue Aug  1 11:56:01 2017
     13// Update Count     : 16
    1414//
    1515
     
    2222#define __STRINGIFY__(str) #str
    2323#define __VSTRINGIFY__(str) __STRINGIFY__(str)
    24 #define assertf(expr, fmt, ...) ((expr) ? static_cast<void>(0) : __assert_fail_f(__VSTRINGIFY__(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ## __VA_ARGS__ ))
     24#define assertf( expr, fmt, ... ) ((expr) ? static_cast<void>(0) : __assert_fail_f(__VSTRINGIFY__(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__, fmt, ## __VA_ARGS__ ))
    2525
    26 void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) __attribute__((noreturn));
     26void __assert_fail_f( const char *assertion, const char *file, unsigned int line, const char *function, const char *fmt, ... ) __attribute__((noreturn, format( printf, 5, 6) ));
    2727
    2828template<typename T, typename U>
    29 static inline T safe_dynamic_cast(const U& src) {
     29static inline T safe_dynamic_cast( const U & src ) {
    3030        T ret = dynamic_cast<T>(src);
    3131        assert(ret);
Note: See TracChangeset for help on using the changeset viewer.