Changeset 96ef156


Ignore:
Timestamp:
Dec 13, 2024, 5:29:12 PM (4 days ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
d30c229
Parents:
fb0f04d
Message:

Fix IO stream to be warning-free.

Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/debug.hfa

    rfb0f04d r96ef156  
    2323        #define __cfaabi_dbg_ctx __PRETTY_FUNCTION__
    2424        #define __cfaabi_dbg_ctx2 , __PRETTY_FUNCTION__
    25         #define __cfaabi_dbg_ctx_param const char caller[]
    26         #define __cfaabi_dbg_ctx_param2 , const char caller[]
     25        #define __cfaabi_dbg_ctx_param __attribute__((unused)) const char caller[]
     26        #define __cfaabi_dbg_ctx_param2 , __attribute__((unused)) const char caller[]
    2727        #define __cfaabi_dbg_ctx_fwd caller
    2828        #define __cfaabi_dbg_ctx_fwd2 , caller
  • libcfa/src/iostream.hfa

    rfb0f04d r96ef156  
    183183};
    184184
     185// FIXME: Should be an anonymous inner union of _Ostream_Manip.
     186// Hoisting manually to work around warning of #294.
     187union _Ostream_Manip_Mode {
     188        unsigned char all;
     189        _Ostream_Flags flags;
     190};
     191
    185192forall( T )
    186193struct _Ostream_Manip {
     
    188195        int wd, pc;                                                                                     // width, precision: signed for computations
    189196        char base;                                                                                      // numeric base / floating-point style
    190         union {
    191                 unsigned char all;
    192                 _Ostream_Flags flags;
    193         };
     197        inline _Ostream_Manip_Mode;
    194198}; // _Ostream_Manip
    195199
     
    459463} // distribution
    460464
    461 forall( T & | sized( T ) )
     465// FIXME: `| sized(T)` seems to be working around a bug, but it is logically unnecessary.
     466// Including sized(T) causes a warning that is telling us to get rid of it.
     467#pragma GCC diagnostic push
     468#pragma GCC diagnostic ignored "-Wunused-parameter"
     469forall( T & | sized(T) )
    462470struct _Istream_Manip {
    463471        T & val;                                                                                        // polymorphic base-type
     
    465473        bool ignore;                                                                            // do not change input argument
    466474}; // _Istream_Manip
     475#pragma GCC diagnostic pop
    467476
    468477#define INPUT_FMT_DECL( T ) \
Note: See TracChangeset for help on using the changeset viewer.