Functions already have a local namespace.
How big are your functions that you need to have multiple namespaces inside
them!
C calls a function body, or other block, or a translation-unit ~=
source file, 'scope' (in each case excluding any contained scope
which re-declares aka shadows the identifier). 'namespace' means
something else, namely one of: tags; members per struct/union;
labels per function; or all other 'ordinary' identifiers per scope.
(I believe C allows you at least 1e50 distinct identifiers within one
namespace, and that's without even making use of case sensitivity.)
Do you mean 'allow' as in an implementation must provide (and a
portable progam may use) or an implementation _may_ provide?
5.2.4.1 specifies some 'minimum maximums', amounts an implementation
must provide (although formally only in 'one program' which may well
not be any program you want) including the following with
C89value/C99value :
- 127/511 identifiers with block scope [per] block
- 31/127 parameters [per] function
- 511/4095 file-scope identifiers per t.u.
- 127/1023 members of a struct or union; members of an enumeration are
ordinary identifiers in the containing scope, and I don't see anything
about the number of tags per scope or t.u.
The only obvious maximum maximum (!) is the number of distinct
identifiers using the specified (C89) or basic (C99) character set
of length up to 31 (C89) or 63 (C99) less keywords (negligible).
The former of these is in the general area of 1e55, and may be what
you were thinking of, but a program containing that many identifiers
could not be recorded in the universe. Possibly something like the old
BASIC CHAIN$ applied to universes would help -- but not any of us,
since we wouldn't exist when (if ever) the answer (42?) is produced.
Presumably you can also do this:
for(int i=0; i<LIMIT1;i++)
for(int i=0; i<LIMIT2;i++)
for(int i=0; i<LIMIT3;i++) int a=i+i+i;
Very neat.
Indeed you can, although it's mostly useless, even if you (try to)
make the body less trivial.