Type-safety in C
<p>Is there a way to make C a little more aware of types and assure type-safety?<br>
Consider this:</p>

<pre><code>typedef unsigned cent_t;
typedef unsigned dollar_t;

#define DOLLAR_2_CENT(dollar)       ((cent_t)(100*(dollar)))

void calc(cent_t amount) {
    // expecting 'amount' to semantically represents cents...
}

int main(int argc, char* argv[]) {
    dollar_t amount = 50;
    calc(DOLLAR_2_CENT(amount));  // ok
    calc(amount);                 // raise warning
    return 0;
}
</code></pre>

<p>Is there a way to make the above code at-least raise warning by the gcc?<br>
I know I can use C-structs to wrap <code>unsigned</code>s and achieve the desired result, I was just wondering if there was a more elegant way to do it.<br>
Can it be a little more than that?</p>