Is creating local scopes with just a pair of brackets, would that be considered standard C?
#include <stdio.h>
int main(int argc, char *argv[]) {
{
register char x = 'a';
putchar(x); // works
}
//putchar(x); wont work
}
Or is it best to not use this? Is it a GCC compiler extension?
I have once been told that the accepted practice is a do {...} while (0);
loop. Is it true that all C compilers will recognise this practice just like it is safe to assume any given C compiler will recognise an if
statement?
I tried googling this, and my results were about scope behavior, and had nothing to do with manually applying scopes.