Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×

Comment Re:-Wall (Score 1) 470

To be honest, in this situation I would like the compiler to inform me that it had eliminated some code as it is probably not what I meant. Why not write it like this instead?

int foo(int a, unsigned int b)
{
a+=b;
return a;
}

Then in the calling code:
int *a;
unsigned int *b;
*b=10;
*a = foo(1,*b);

I understand that this is a simple example, but I prefer to write my code like this as it ensures that the pointers are only dereferenced within the scope in which they are declared.

Slashdot Top Deals

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...