Changeset ffe2fad


Ignore:
Timestamp:
Apr 23, 2019, 2:41:32 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
673cd63
Parents:
8c3a0336
Message:

Fixed several warnings in libcfa

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • benchmark/ctxswitch/cfa_cor.cfa

    r8c3a0336 rffe2fad  
    1111}
    1212
    13 void main( GreatSuspender & this ) {
     13void main( __attribute__((unused)) GreatSuspender & this ) {
    1414        while( true ) {
    1515                suspend();
  • benchmark/ctxswitch/cfa_thrd2.cfa

    r8c3a0336 rffe2fad  
    88thread Fibre {};
    99
    10 void main(Fibre & this) {
     10void main(__attribute__((unused)) Fibre & this) {
    1111        while(!done) {
    1212                yield();
  • libcfa/src/bits/containers.hfa

    r8c3a0336 rffe2fad  
    186186
    187187        forall(dtype T | is_node(T))
    188         static inline bool ?!=?( __queue(T) & this, zero_t zero ) {
     188        static inline bool ?!=?( __queue(T) & this, __attribute__((unused)) zero_t zero ) {
    189189                return this.head != 0;
    190190        }
     
    196196//-----------------------------------------------------------------------------
    197197#ifdef __cforall
    198         forall(dtype TYPE | sized(TYPE))
     198        forall(dtype TYPE)
    199199        #define T TYPE
    200200        #define __getter_t * [T * & next, T * & prev] ( T & )
     
    268268
    269269        forall(dtype T | sized(T))
    270         static inline bool ?!=?( __dllist(T) & this, zero_t zero ) {
     270        static inline bool ?!=?( __dllist(T) & this, __attribute__((unused)) zero_t zero ) {
    271271                return this.head != 0;
    272272        }
  • libcfa/src/concurrency/coroutine.cfa

    r8c3a0336 rffe2fad  
    7070        bool userStack = ((intptr_t)this.storage & 0x1) != 0;
    7171        if ( ! userStack && this.storage ) {
    72                 *((intptr_t*)&this.storage) &= (intptr_t)-1;
     72                __attribute__((may_alias)) intptr_t * istorage = (intptr_t *)&this.storage;
     73                *istorage &= (intptr_t)-1;
     74
    7375                void * storage = this.storage->limit;
    7476                __cfaabi_dbg_debug_do(
     
    174176        this->storage->limit = storage;
    175177        this->storage->base  = (void*)((intptr_t)storage + size);
    176         *((intptr_t*)&this->storage) |= userStack ? 0x1 : 0x0;
     178        __attribute__((may_alias)) intptr_t * istorage = (intptr_t*)&this->storage;
     179        *istorage |= userStack ? 0x1 : 0x0;
    177180}
    178181
  • libcfa/src/concurrency/invoke.h

    r8c3a0336 rffe2fad  
    199199        #ifdef __cforall
    200200        extern "Cforall" {
    201                 static inline struct coroutine_desc * volatile active_coroutine() { return TL_GET( this_thread )->curr_cor; }
    202                 static inline struct thread_desc    * volatile active_thread   () { return TL_GET( this_thread    ); }
    203                 static inline struct processor      * volatile active_processor() { return TL_GET( this_processor ); } // UNSAFE
     201                static inline struct coroutine_desc * active_coroutine() { return TL_GET( this_thread )->curr_cor; }
     202                static inline struct thread_desc    * active_thread   () { return TL_GET( this_thread    ); }
     203                static inline struct processor      * active_processor() { return TL_GET( this_processor ); } // UNSAFE
    204204
    205205                static inline thread_desc * & get_next( thread_desc & this ) {
  • libcfa/src/concurrency/kernel.cfa

    r8c3a0336 rffe2fad  
    165165                base      = info->base;
    166166        }
    167         *((intptr_t*)&stack.storage) |= 0x1;
     167        __attribute__((may_alias)) intptr_t * istorage = (intptr_t*) &stack.storage;
     168        *istorage |= 0x1;
    168169        name = "Main Thread";
    169170        state = Start;
  • libcfa/src/time.hfa

    r8c3a0336 rffe2fad  
    3030
    3131static inline {
    32         Duration ?=?( Duration & dur, zero_t ) { return dur{ 0 }; }
     32        Duration ?=?( Duration & dur, __attribute__((unused)) zero_t ) { return dur{ 0 }; }
    3333
    3434        Duration +?( Duration rhs ) with( rhs ) {       return (Duration)@{ +tv }; }
     
    5959        bool ?>=?( Duration lhs, Duration rhs ) { return lhs.tv >= rhs.tv; }
    6060
    61         bool ?==?( Duration lhs, zero_t ) { return lhs.tv == 0; }
    62         bool ?!=?( Duration lhs, zero_t ) { return lhs.tv != 0; }
    63         bool ?<? ( Duration lhs, zero_t ) { return lhs.tv <  0; }
    64         bool ?<=?( Duration lhs, zero_t ) { return lhs.tv <= 0; }
    65         bool ?>? ( Duration lhs, zero_t ) { return lhs.tv >  0; }
    66         bool ?>=?( Duration lhs, zero_t ) { return lhs.tv >= 0; }
     61        bool ?==?( Duration lhs, __attribute__((unused)) zero_t ) { return lhs.tv == 0; }
     62        bool ?!=?( Duration lhs, __attribute__((unused)) zero_t ) { return lhs.tv != 0; }
     63        bool ?<? ( Duration lhs, __attribute__((unused)) zero_t ) { return lhs.tv <  0; }
     64        bool ?<=?( Duration lhs, __attribute__((unused)) zero_t ) { return lhs.tv <= 0; }
     65        bool ?>? ( Duration lhs, __attribute__((unused)) zero_t ) { return lhs.tv >  0; }
     66        bool ?>=?( Duration lhs, __attribute__((unused)) zero_t ) { return lhs.tv >= 0; }
    6767
    6868        Duration abs( Duration rhs ) { return rhs.tv >= 0 ? rhs : -rhs; }
     
    101101        void ?{}( timeval & t, time_t sec, suseconds_t usec ) { t.tv_sec = sec; t.tv_usec = usec; }
    102102        void ?{}( timeval & t, time_t sec ) { t{ sec, 0 }; }
    103         void ?{}( timeval & t, zero_t ) { t{ 0, 0 }; }
    104 
    105         timeval ?=?( timeval & t, zero_t ) { return t{ 0 }; }
     103        void ?{}( timeval & t, __attribute__((unused)) zero_t ) { t{ 0, 0 }; }
     104
     105        timeval ?=?( timeval & t, __attribute__((unused)) zero_t ) { return t{ 0 }; }
    106106        timeval ?+?( timeval lhs, timeval rhs ) { return (timeval)@{ lhs.tv_sec + rhs.tv_sec, lhs.tv_usec + rhs.tv_usec }; }
    107107        timeval ?-?( timeval lhs, timeval rhs ) { return (timeval)@{ lhs.tv_sec - rhs.tv_sec, lhs.tv_usec - rhs.tv_usec }; }
     
    116116        void ?{}( timespec & t, time_t sec, __syscall_slong_t nsec ) { t.tv_sec = sec; t.tv_nsec = nsec; }
    117117        void ?{}( timespec & t, time_t sec ) { t{ sec, 0}; }
    118         void ?{}( timespec & t, zero_t ) { t{ 0, 0 }; }
    119 
    120         timespec ?=?( timespec & t, zero_t ) { return t{ 0 }; }
     118        void ?{}( timespec & t, __attribute__((unused)) zero_t ) { t{ 0, 0 }; }
     119
     120        timespec ?=?( timespec & t, __attribute__((unused)) zero_t ) { return t{ 0 }; }
    121121        timespec ?+?( timespec lhs, timespec rhs ) { return (timespec)@{ lhs.tv_sec + rhs.tv_sec, lhs.tv_nsec + rhs.tv_nsec }; }
    122122        timespec ?-?( timespec lhs, timespec rhs ) { return (timespec)@{ lhs.tv_sec - rhs.tv_sec, lhs.tv_nsec - rhs.tv_nsec }; }
     
    145145void ?{}( Time & time, int year, int month = 0, int day = 0, int hour = 0, int min = 0, int sec = 0, int nsec = 0 );
    146146static inline {
    147         Time ?=?( Time & time, zero_t ) { return time{ 0 }; }
     147        Time ?=?( Time & time, __attribute__((unused)) zero_t ) { return time{ 0 }; }
    148148
    149149        void ?{}( Time & time, timeval t ) with( time ) { tv = (int64_t)t.tv_sec * TIMEGRAN + t.tv_usec * 1000; }
  • libcfa/src/time_t.hfa

    r8c3a0336 rffe2fad  
    2424
    2525static inline void ?{}( Duration & dur ) with( dur ) { tv = 0; }
    26 static inline void ?{}( Duration & dur, zero_t ) with( dur ) { tv = 0; }
     26static inline void ?{}( Duration & dur, __attribute__((unused)) zero_t ) with( dur ) { tv = 0; }
    2727
    2828
     
    3434
    3535static inline void ?{}( Time & time ) with( time ) { tv = 0; }
    36 static inline void ?{}( Time & time, zero_t ) with( time ) { tv = 0; }
     36static inline void ?{}( Time & time, __attribute__((unused)) zero_t ) with( time ) { tv = 0; }
    3737
    3838// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.