Improve function typing

Issue #18 wontfix
Tygre repo owner created an issue

Improve function typing by returning a value in an enum of RETURN_OK, RETURN_WARN, and RETURN_ERROR instead of an int. (See http://stackoverflow.com/a/742716)

Comments (1)

  1. Tygre reporter

    Unfortunately, C does not allow "strong" typing... I was thinking of defining

    typedef enum {
        ERROR,
        WARN,
        OK
    } return3_t
    

    and have my functions return return3_t... but then C still allows comparison with any int because enumerated values convert into int!

  2. Log in to comment