Any use of restrict keyword I have seen is done in function declaration. Does have any sense to declare a global var with restrict keyword? (yes, I now, I must not use globals.....)
Any use of restrict keyword I have seen is done in function declaration. Does have any sense to declare a global var with restrict keyword? (yes, I now, I must not use globals.....)
Sure, why not? As long as you are aware "restrict" is part of C99.
BTW, you can use global variables, the caveat is not to become dependent on them and to use them as little as possible by reserving them only for important, often accessed variables and situations where NOT doing so would hamper efficiency or comprehensibility. For example, some API's allow callbacks where the callback can only be passed a single variable. You can always create a struct to include more, but if each one of these structs is unique in the sense that it is always variable X + some other variable, and X is getting passed around between a lot of your functions this (or any) way, you you might reasonably consider making X global if the total code base is only a few thousand lines or so.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge