• Kevin Modzelewski's avatar
    Add "noexcept" specifications to all C API endpoints · 91321622
    Kevin Modzelewski authored
    Add a PYSTON_NOEXCEPT define that gets defined to "noexcept" in C++ mode,
    and to the empty string in C mode.
    
    I don't think 'extern "C"' implies noexcept.
    
    This is partly for better performance when we know that a function cannot throw
    an exception, but also as an annotation for us since the exception model is
    the main difference between C land and Pyston land.
    
    Vim substitution: %s/\(\<PyAPI_FUNC\>(.*).*(\([^)]\|\n\)*)\);/\1 PYSTON_NOEXCEPT;/gc
    - This will catch almost all cases, except for functions not marked with PyAPI_FUNC
      and function definitions that have extra paretheses (in comments, usually)
    91321622
warnings.h 759 Bytes