Changeset d7312ac for src/libcfa/interpose.c
- Timestamp:
- May 5, 2018, 9:33:28 AM (6 years ago)
- 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, with_gc
- Children:
- 7867eb9
- Parents:
- 43c461d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/interpose.c
r43c461d rd7312ac 10 10 // Created On : Wed Mar 29 16:10:31 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri May 4 14:35:13201813 // Update Count : 9 712 // Last Modified On : Sat May 5 09:16:57 2018 13 // Update Count : 99 14 14 // 15 15 … … 85 85 86 86 struct { 87 void (* exit)( int ) __attribute__ 88 void (* abort)( void ) __attribute__ 87 void (* exit)( int ) __attribute__(( __noreturn__ )); 88 void (* abort)( void ) __attribute__(( __noreturn__ )); 89 89 } __cabi_libc; 90 90 … … 94 94 const char *version = NULL; 95 95 96 #pragma GCC diagnostic push 97 #pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" 96 98 INTERPOSE_LIBC( abort, version ); 97 99 INTERPOSE_LIBC( exit , version ); 100 #pragma GCC diagnostic pop 98 101 99 102 __cfaabi_sigaction( SIGSEGV, sigHandler_segv , SA_SIGINFO ); // Failure handler … … 112 115 113 116 // Forward declare abort after the __typeof__ call to avoid ambiguities 114 void exit( int status, const char fmt[], ... ) __attribute__ 115 void abort( const char fmt[], ... ) __attribute__ 117 void exit( int status, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ )); 118 void abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )); 116 119 117 120 extern "C" { 118 void abort( void ) __attribute__ 121 void abort( void ) __attribute__(( __nothrow__, __leaf__, __noreturn__ )) { 119 122 abort( NULL ); 120 123 } 121 124 122 void __cabi_abort( const char fmt[], ... ) __attribute__ 125 void __cabi_abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )) { 123 126 va_list argp; 124 127 va_start( argp, fmt ); … … 127 130 } 128 131 129 void exit( int status ) __attribute__ 132 void exit( int status ) __attribute__(( __nothrow__, __leaf__, __noreturn__ )) { 130 133 __cabi_libc.exit( status ); 131 134 } 132 135 } 133 136 134 void * kernel_abort ( void ) __attribute__ 135 void kernel_abort_msg( void * data, char * buffer, int size ) __attribute__ 136 int kernel_abort_lastframe( void ) __attribute__ 137 void * kernel_abort ( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return NULL; } 138 void kernel_abort_msg( void * data, char * buffer, int size ) __attribute__(( __nothrow__, __leaf__, __weak__ )) {} 139 int kernel_abort_lastframe( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return 4; } 137 140 138 141 enum { abort_text_size = 1024 }; … … 140 143 static int abort_lastframe; 141 144 142 void exit( int status, const char fmt[], ... ) __attribute__ 145 void exit( int status, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ )) { 143 146 va_list args; 144 147 va_start( args, fmt ); … … 148 151 } 149 152 150 void abort( const char fmt[], ... ) __attribute__ 153 void abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )) { 151 154 void * kernel_data = kernel_abort(); // must be done here to lock down kernel 152 155 int len;
Note: See TracChangeset
for help on using the changeset viewer.