5 ms·
There was a time when "I haven't written C in a bit" was a reason for immediately recognizing code such as this. (-:
by JdeBP 8y ago
There was a time when "I haven't written C in a bit" was a reason for immediately recognizing code such as this. (-:
- ktpsns 8y agoInterestingly, this way of function definitions is "still" the way subroutines/functions are defined in (modern/all time) Fortran (if one ignores the syntactic differences). Also, at "old" C, declarations only may come at the beginning of a block -- just as it still is with Fortran. Out of curiosity, is there any reason for the similiarity?
- ethhics 8y agoAt least for the declarations at the beginning of the block, that allows for very simple compiler design as it is very easy to split the code and data sections. Start off allocating space for all the variables it sees, and then when it reaches something not a declaration or definition, start emitting assembly.