S
Sensei
Hi again!
I have still curiosity about the reason of some C constructs/keywords...
The first is about static functions. What was the reason of restricting
a function to be visible just in a specific source file? Wasn't it
sufficient not to be given a prototype (for visibility)?
What about register and volatile variables? Was at that time a compiler
not smart enough to optimize with in-register variables? And why would
someone suggest the compiler not to optimze by making a variable
volatile?
Last question! This is about the switch statement. The statement seems
to me to be completely different from others. Let me explain with an
example. A while(condition) will execute the statement after the
while(), and if someone wants to have more instructions to be executed
in the loop, then { } should be used. This is true also for if/else,
do/loop, but not with the switch. A case does not require any { } to
execute more than one instruction, moreover, a brake must be given to
make a single case being executed, otherwise all the following
non-brake case statements will be executed. Why wasn't the switch like
the others with { } and automatic brake?
It's probably useless, but not for curiosity...
I have still curiosity about the reason of some C constructs/keywords...
The first is about static functions. What was the reason of restricting
a function to be visible just in a specific source file? Wasn't it
sufficient not to be given a prototype (for visibility)?
What about register and volatile variables? Was at that time a compiler
not smart enough to optimize with in-register variables? And why would
someone suggest the compiler not to optimze by making a variable
volatile?
Last question! This is about the switch statement. The statement seems
to me to be completely different from others. Let me explain with an
example. A while(condition) will execute the statement after the
while(), and if someone wants to have more instructions to be executed
in the loop, then { } should be used. This is true also for if/else,
do/loop, but not with the switch. A case does not require any { } to
execute more than one instruction, moreover, a brake must be given to
make a single case being executed, otherwise all the following
non-brake case statements will be executed. Why wasn't the switch like
the others with { } and automatic brake?
It's probably useless, but not for curiosity...