Ignore:
Timestamp:
May 5, 2018, 9:33:28 AM (6 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, with_gc
Children:
7867eb9
Parents:
43c461d
Message:

make directives work and use them to remove warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/interpose.c

    r43c461d rd7312ac  
    1010// Created On       : Wed Mar 29 16:10:31 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri May  4 14:35:13 2018
    13 // Update Count     : 97
     12// Last Modified On : Sat May  5 09:16:57 2018
     13// Update Count     : 99
    1414//
    1515
     
    8585
    8686struct {
    87         void (* exit)( int ) __attribute__ (( __noreturn__ ));
    88         void (* abort)( void ) __attribute__ (( __noreturn__ ));
     87        void (* exit)( int ) __attribute__(( __noreturn__ ));
     88        void (* abort)( void ) __attribute__(( __noreturn__ ));
    8989} __cabi_libc;
    9090
     
    9494                const char *version = NULL;
    9595
     96#pragma GCC diagnostic push
     97#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
    9698                INTERPOSE_LIBC( abort, version );
    9799                INTERPOSE_LIBC( exit , version );
     100#pragma GCC diagnostic pop
    98101
    99102                __cfaabi_sigaction( SIGSEGV, sigHandler_segv , SA_SIGINFO ); // Failure handler
     
    112115
    113116// Forward declare abort after the __typeof__ call to avoid ambiguities
    114 void exit( int status, const char fmt[], ... ) __attribute__ (( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ ));
    115 void abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));
     117void exit( int status, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ ));
     118void abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));
    116119
    117120extern "C" {
    118         void abort( void ) __attribute__ (( __nothrow__, __leaf__, __noreturn__ )) {
     121        void abort( void ) __attribute__(( __nothrow__, __leaf__, __noreturn__ )) {
    119122                abort( NULL );
    120123        }
    121124
    122         void __cabi_abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )) {
     125        void __cabi_abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )) {
    123126                va_list argp;
    124127                va_start( argp, fmt );
     
    127130        }
    128131
    129         void exit( int status ) __attribute__ (( __nothrow__, __leaf__, __noreturn__ )) {
     132        void exit( int status ) __attribute__(( __nothrow__, __leaf__, __noreturn__ )) {
    130133                __cabi_libc.exit( status );
    131134        }
    132135}
    133136
    134 void * kernel_abort    ( void ) __attribute__ (( __nothrow__, __leaf__, __weak__ )) { return NULL; }
    135 void   kernel_abort_msg( void * data, char * buffer, int size ) __attribute__ (( __nothrow__, __leaf__, __weak__ )) {}
    136 int kernel_abort_lastframe( void ) __attribute__ (( __nothrow__, __leaf__, __weak__ )) { return 4; }
     137void * kernel_abort    ( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return NULL; }
     138void   kernel_abort_msg( void * data, char * buffer, int size ) __attribute__(( __nothrow__, __leaf__, __weak__ )) {}
     139int kernel_abort_lastframe( void ) __attribute__(( __nothrow__, __leaf__, __weak__ )) { return 4; }
    137140
    138141enum { abort_text_size = 1024 };
     
    140143static int abort_lastframe;
    141144
    142 void exit( int status, const char fmt[], ... ) __attribute__ (( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ )) {
     145void exit( int status, const char fmt[], ... ) __attribute__(( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ )) {
    143146    va_list args;
    144147    va_start( args, fmt );
     
    148151}
    149152
    150 void abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )) {
     153void abort( const char fmt[], ... ) __attribute__(( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )) {
    151154        void * kernel_data = kernel_abort();                    // must be done here to lock down kernel
    152155        int len;
Note: See TracChangeset for help on using the changeset viewer.