Subdividing common headers

  • Less merging
  • Fewer build dependencies

Error handling

As return value

ERRCODE child()
{
    ERRCODE err = NO_ERR;
    ...
    return err;
}

ERRCODE parent()
{
    ERRCODE err = NO_ERR;
    err = child();
    ...
    return err;
}

As var parameter

void child(ERRCODE* err)
{
    err = NO_ERR;
    ...
}

void parent(ERRCODE* err)
{
    child(err);
    if (err == NO_ERR)
    {
        child2(err);
    }
}

Is there significant overhead in the first case from stack allocation for autos?

Headers

  • One header per interface