R
Richard Delorme
Le 15/03/2010 21:32, jacob navia a écrit :
three() {
return 3;
}
Isn't it clear than in the above function I forgot the return type ?
Under the hypothesis that void is no more part of the language, I do not
understand your remark.
How ? Just by forbidding the usage of the address of the variable, or by
actually assigning the variable to a true register ?
For the programmer ? I guess a good programmer looking for some
performance will always avoid aliasing.
My code uses a lot of -> and I find it makes the code harder to read
than a single dot.
Richard Delorme a écrit :
This makes impossible to know if you forgot to type the return value
or you wanted to have a void function.
three() {
return 3;
}
Isn't it clear than in the above function I forgot the return type ?
Then, you can't know if you are dereferencing a void * by mistake!
Under the hypothesis that void is no more part of the language, I do not
understand your remark.
lcc-win honors the register directive...
How ? Just by forbidding the usage of the address of the variable, or by
actually assigning the variable to a true register ?
It is useful for remembering to avoid aliasing an address
For the programmer ? I guess a good programmer looking for some
performance will always avoid aliasing.
Maybe, but I find it clearer as it is now. You know that at the left
side of the name is a pointer, not an object.
My code uses a lot of -> and I find it makes the code harder to read
than a single dot.