Changeset 7dcce0a in mainline


Ignore:
Timestamp:
2019-01-16T18:07:45Z (5 years ago)
Author:
jxsvoboda <5887334+jxsvoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4248ce5
Parents:
cf9e949
git-author:
Jaroslav Jindrak <dzejrou@…> (2019-01-12 15:09:49)
git-committer:
jxsvoboda <5887334+jxsvoboda@…> (2019-01-16 18:07:45)
Message:

cpp: abort and report when an unimplemented function is called

Location:
uspace/lib/cpp
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/__bits/adt/list.hpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include <__bits/adt/list_node.hpp>
    3333#include <__bits/insert_iterator.hpp>
     34#include <cassert>
    3435#include <cstdlib>
    3536#include <iterator>
     
    580581            {
    581582                // TODO: implement
     583                __unimplemented();
    582584            }
    583585
     
    585587            {
    586588                // TODO: implement
     589                __unimplemented();
    587590            }
    588591
     
    10421045            {
    10431046                // TODO: implement
     1047                __unimplemented();
    10441048            }
    10451049
     
    10531057            {
    10541058                // TODO: implement
     1059                __unimplemented();
    10551060            }
    10561061
     
    10641069            {
    10651070                // TODO: implement
     1071                __unimplemented();
    10661072            }
    10671073
     
    10691075            {
    10701076                // TODO: implement
     1077                __unimplemented();
    10711078            }
    10721079
     
    10751082            {
    10761083                // TODO: implement
     1084                __unimplemented();
    10771085            }
    10781086
  • uspace/lib/cpp/include/__bits/complex.hpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3030#define LIBCPP_BITS_COMPLEX
    3131
     32#include <cassert>
    3233#include <iosfwd>
    3334#include <sstream>
     
    724725    {
    725726        // TODO: implement
     727        __unimplemented();
     728        return is;
    726729    }
    727730
     
    766769    {
    767770        // TODO: implement
     771        __unimplemented();
    768772        return c;
    769773    }
     
    779783    {
    780784        // TODO: implement
     785        __unimplemented();
    781786        return c;
    782787    }
     
    786791    {
    787792        // TODO: implement
     793        __unimplemented();
    788794        return c;
    789795    }
     
    793799    {
    794800        // TODO: implement
     801        __unimplemented();
    795802        return complex<T>{};
    796803    }
     
    804811    {
    805812        // TODO: implement
     813        __unimplemented();
    806814        return c;
    807815    }
     
    811819    {
    812820        // TODO: implement
     821        __unimplemented();
    813822        return c;
    814823    }
     
    818827    {
    819828        // TODO: implement
     829        __unimplemented();
    820830        return c;
    821831    }
     
    825835    {
    826836        // TODO: implement
     837        __unimplemented();
    827838        return c;
    828839    }
     
    832843    {
    833844        // TODO: implement
     845        __unimplemented();
    834846        return c;
    835847    }
     
    839851    {
    840852        // TODO: implement
     853        __unimplemented();
    841854        return c;
    842855    }
     
    846859    {
    847860        // TODO: implement
     861        __unimplemented();
    848862        return c;
    849863    }
     
    853867    {
    854868        // TODO: implement
     869        __unimplemented();
    855870        return c;
    856871    }
     
    860875    {
    861876        // TODO: implement
     877        __unimplemented();
    862878        return c;
    863879    }
     
    867883    {
    868884        // TODO: implement
     885        __unimplemented();
    869886        return c;
    870887    }
     
    874891    {
    875892        // TODO: implement
     893        __unimplemented();
    876894        return c;
    877895    }
     
    881899    {
    882900        // TODO: implement
     901        __unimplemented();
    883902        return base;
    884903    }
     
    888907    {
    889908        // TODO: implement
     909        __unimplemented();
    890910        return base;
    891911    }
     
    895915    {
    896916        // TODO: implement
     917        __unimplemented();
    897918        return complex<T>{base};
    898919    }
     
    902923    {
    903924        // TODO: implement
     925        __unimplemented();
    904926        return c;
    905927    }
     
    909931    {
    910932        // TODO: implement
     933        __unimplemented();
    911934        return c;
    912935    }
     
    916939    {
    917940        // TODO: implement
     941        __unimplemented();
    918942        return c;
    919943    }
     
    923947    {
    924948        // TODO: implement
     949        __unimplemented();
    925950        return c;
    926951    }
     
    930955    {
    931956        // TODO: implement
     957        __unimplemented();
    932958        return c;
    933959    }
  • uspace/lib/cpp/include/__bits/functional/bind.hpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3333#include <__bits/functional/invoke.hpp>
    3434#include <__bits/functional/reference_wrapper.hpp>
     35#include <cassert>
    3536#include <tuple>
    3637#include <type_traits>
     
    133134                constexpr decltype(auto) operator[](const bind_t<R, B, F, BindArgs...> b)
    134135                {
     136                    __unimplemented();
    135137                    return b; // TODO: bind subexpressions
    136138                }
  • uspace/lib/cpp/include/__bits/io/fstream.hpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3030#define LIBCPP_BITS_IO_FSTREAM
    3131
     32#include <cassert>
    3233#include <cstdio>
    3334#include <ios>
     
    267268            {
    268269                // TODO: implement
     270                __unimplemented();
    269271                return nullptr;
    270272            }
     
    274276            {
    275277                // TODO: implement
     278                __unimplemented();
    276279                return pos_type{};
    277280            }
     
    281284            {
    282285                // TODO: implement
     286                __unimplemented();
    283287                return pos_type{};
    284288            }
  • uspace/lib/cpp/include/__bits/io/istream.hpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3030#define LIBCPP_BITS_IO_ISTREAM
    3131
     32#include <cassert>
    3233#include <ios>
    3334#include <iosfwd>
     
    339340            {
    340341                // TODO: implement
     342                __unimplemented();
     343                return *this;
    341344            }
    342345
     
    344347            {
    345348                // TODO: implement
     349                __unimplemented();
     350                return *this;
    346351            }
    347352
     
    349354            {
    350355                // TODO: implement
     356                __unimplemented();
     357                return *this;
    351358            }
    352359
     
    354361            {
    355362                // TODO: implement
     363                __unimplemented();
     364                return *this;
    356365            }
    357366
  • uspace/lib/cpp/include/__bits/io/ostream.hpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3030#define LIBCPP_BITS_IO_OSTREAM
    3131
     32#include <cassert>
    3233#include <ios>
    3334#include <iosfwd>
     
    458459            {
    459460                // TODO: implement
     461                __unimplemented();
    460462                return pos_type{};
    461463            }
     
    464466            {
    465467                // TODO: implement
     468                __unimplemented();
    466469                return *this;
    467470            }
     
    470473            {
    471474                // TODO: implement
     475                __unimplemented();
    472476                return *this;
    473477            }
  • uspace/lib/cpp/include/__bits/new.hpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3030#define LIBCPP_BITS_NEW
    3131
     32#include <cstddef>
    3233#include <exception>
    3334
  • uspace/lib/cpp/include/__bits/string/string.hpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3232#include <__bits/string/stringfwd.hpp>
    3333#include <algorithm>
     34#include <cassert>
    3435#include <initializer_list>
    3536#include <iosfwd>
     
    178179        {
    179180            // TODO: implement
     181            __unimplemented();
    180182            return 0;
    181183        }
     
    184186        {
    185187            // TODO: implement
     188            __unimplemented();
    186189            return 0;
    187190        }
     
    190193        {
    191194            // TODO: implement
     195            __unimplemented();
    192196            return nullptr;
    193197        }
     
    196200        {
    197201            // TODO: implement
     202            __unimplemented();
    198203            return nullptr;
    199204        }
     
    202207        {
    203208            // TODO: implement
     209            __unimplemented();
    204210            return nullptr;
    205211        }
     
    208214        {
    209215            // TODO: implement
     216            __unimplemented();
    210217            return nullptr;
    211218        }
     
    266273        {
    267274            // TODO: implement
     275            __unimplemented();
    268276            return 0;
    269277        }
     
    272280        {
    273281            // TODO: implement
     282            __unimplemented();
    274283            return 0;
    275284        }
     
    278287        {
    279288            // TODO: implement
     289            __unimplemented();
    280290            return nullptr;
    281291        }
     
    284294        {
    285295            // TODO: implement
     296            __unimplemented();
    286297            return nullptr;
    287298        }
     
    290301        {
    291302            // TODO: implement
     303            __unimplemented();
    292304            return nullptr;
    293305        }
     
    296308        {
    297309            // TODO: implement
     310            __unimplemented();
    298311            return nullptr;
    299312        }
     
    353366        {
    354367            // TODO: This function does not exits...
     368            __unimplemented();
    355369            //return hel::wstr_lcmp(s1, s2, n);
    356370            return 0;
     
    19391953        {
    19401954            // TODO: implement
     1955            __unimplemented();
    19411956            return size_t{};
    19421957        }
  • uspace/lib/cpp/include/__bits/thread/future.hpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3030#define LIBCPP_BITS_THREAD_FUTURE
    3131
     32#include <cassert>
    3233#include <memory>
    3334#include <system_error>
     
    171172    {
    172173        // TODO: implement
     174        __unimplemented();
    173175    }
    174176
     
    178180    {
    179181        // TODO: implement
     182        __unimplemented();
    180183    }
    181184}
  • uspace/lib/cpp/include/cassert

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    3131
    3232
    33 namespace std::hel
    34 {
    35     extern "C" {
    36         #include <assert.h>
    37     }
     33extern "C" {
     34    #include <assert.h>
    3835}
    3936
    40 namespace std
    41 {
    42     // Note: The only thing imported is assert
    43     //       and that is a macro.
    44 }
     37// TODO: For some reason, this function isn't visible (maybe the
     38//       noreturn attribute?), adding a redeclaration here for the
     39//       time being.
    4540
    46 /**
    47  * We need to fix the assert macro because it uses
    48  * a non-standard function that we have in the
    49  * std::hel namespace.
    50  */
    51 #undef assert
    52 #define assert(expr) \
    53         do { \
    54                 if (!(expr)) \
    55                         std::hel::assert_abort(#expr, __FILE__, __LINE__); \
    56         } while (0)
     41extern void __helenos_assert_abort(const char *, const char *, unsigned int);
     42
     43#define __unimplemented() assert(!"Not implemented!")
    5744
    5845#endif
  • uspace/lib/cpp/src/__bits/runtime.cpp

    rcf9e949 r7dcce0a  
    3333#include <mutex>
    3434
     35void* __dso_handle = nullptr;
     36
    3537namespace __cxxabiv1
    3638{
  • uspace/lib/cpp/src/__bits/unwind.cpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2017 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
     29#include <cassert>
    2930#include <cstdint>
    3031#include <cstdlib>
     
    175176    {
    176177        // TODO: implement
     178        __unimplemented();
    177179        return nullptr;
    178180    }
     
    181183    {
    182184        // TODO: implement
     185        __unimplemented();
    183186    }
    184187
     
    186189    {
    187190        // TODO: implement
     191        __unimplemented();
    188192    }
    189193
     
    191195    {
    192196        // TODO: implement
     197        __unimplemented();
    193198        return nullptr;
    194199    }
     
    197202    {
    198203        // TODO: implement
     204        __unimplemented();
    199205        return nullptr;
    200206    }
     
    203209    {
    204210        // TODO: implement
     211        __unimplemented();
    205212    }
    206213
     
    208215    {
    209216        // TODO: implement
     217        __unimplemented();
    210218    }
    211219
     
    213221    {
    214222        // TODO: implement
     223        __unimplemented();
    215224    }
    216225
     
    218227    {
    219228        // TODO: implement
     229        __unimplemented();
    220230    }
    221231
     
    223233    {
    224234        // TODO: implement
     235        __unimplemented();
    225236    }
    226237
     
    231242    {
    232243        // TODO: implement
     244        __unimplemented();
    233245        return _URC_NO_REASON;
    234246    }
  • uspace/lib/cpp/src/condition_variable.cpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
     29#include <cassert>
    2930#include <condition_variable>
    3031
     
    8889    {
    8990        // TODO: implement
     91        __unimplemented();
    9092    }
    9193}
  • uspace/lib/cpp/src/string.cpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
     29#include <cassert>
    2930#include <string>
    3031
     
    3435    {
    3536        // TODO: implement using stol once we have numeric limits
     37        __unimplemented();
    3638        return 0;
    3739    }
     
    7274    {
    7375        // TODO: implement using stol once we have numeric limits
     76        __unimplemented();
    7477        return 0;
    7578    }
     
    7881    {
    7982        // TODO: implement using stoul once we have numeric limits
     83        __unimplemented();
    8084        return 0;
    8185    }
     
    8488    {
    8589        // TODO: implement
     90        __unimplemented();
    8691        return 0.f;
    8792    }
     
    9095    {
    9196        // TODO: implement
     97        __unimplemented();
    9298        return 0.0;
    9399    }
     
    96102    {
    97103        // TODO: implement
     104        __unimplemented();
    98105        return 0.0l;
    99106    }
     
    206213    {
    207214        // TODO: implement
     215        __unimplemented();
    208216        return 0;
    209217    }
     
    212220    {
    213221        // TODO: implement
     222        __unimplemented();
    214223        return 0;
    215224    }
     
    218227    {
    219228        // TODO: implement
     229        __unimplemented();
    220230        return 0;
    221231    }
     
    224234    {
    225235        // TODO: implement
     236        __unimplemented();
    226237        return 0;
    227238    }
     
    230241    {
    231242        // TODO: implement
     243        __unimplemented();
    232244        return 0;
    233245    }
     
    236248    {
    237249        // TODO: implement
     250        __unimplemented();
    238251        return 0.f;
    239252    }
     
    242255    {
    243256        // TODO: implement
     257        __unimplemented();
    244258        return 0.0;
    245259    }
     
    248262    {
    249263        // TODO: implement
     264        __unimplemented();
    250265        return 0.0l;
    251266    }
     
    254269    {
    255270        // TODO: implement
     271        __unimplemented();
    256272        return wstring{};
    257273    }
     
    260276    {
    261277        // TODO: implement
     278        __unimplemented();
    262279        return wstring{};
    263280    }
     
    266283    {
    267284        // TODO: implement
     285        __unimplemented();
    268286        return wstring{};
    269287    }
     
    272290    {
    273291        // TODO: implement
     292        __unimplemented();
    274293        return wstring{};
    275294    }
     
    278297    {
    279298        // TODO: implement
     299        __unimplemented();
    280300        return wstring{};
    281301    }
     
    284304    {
    285305        // TODO: implement
     306        __unimplemented();
    286307        return wstring{};
    287308    }
     
    290311    {
    291312        // TODO: implement
     313        __unimplemented();
    292314        return wstring{};
    293315    }
     
    296318    {
    297319        // TODO: implement
     320        __unimplemented();
    298321        return wstring{};
    299322    }
     
    302325    {
    303326        // TODO: implement
     327        __unimplemented();
    304328        return wstring{};
    305329    }
  • uspace/lib/cpp/src/thread.cpp

    rcf9e949 r7dcce0a  
    11/*
    2  * Copyright (c) 2018 Jaroslav Jindrak
     2 * Copyright (c) 2019 Jaroslav Jindrak
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
     29#include <cassert>
    2930#include <cstdlib>
    3031#include <exception>
     
    120121    {
    121122        // TODO:
     123        __unimplemented();
    122124        return 0;
    123125    }
Note: See TracChangeset for help on using the changeset viewer.