This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Number of significant characters in identifiers
- From: Ian Lance Taylor <iant at google dot com>
- To: "Jeffrey D. Cherry" <jeff dot cherry at actasc dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 24 May 2011 17:40:51 -0700
- Subject: Re: Number of significant characters in identifiers
- References: <4DDC145A.2030003@actasc.com>
"Jeffrey D. Cherry" <jeff.cherry@actasc.com> writes:
> We are evaluating some C code based on MISRA C:2004 standards, which
> state that "Identifiers (internal and external) shall not rely on the
> significance of more than 31 characters." The code uses a lot of
> internal identifiers that exceed the 31 character limit. The code is
> compiled with an old version of gcc, specifically version 2.96. From
> the documentation of the current version of gcc, we know that for all
> internal names, all characters are significant. Was this also the
> case for the older version of the compiler, even for the venerable old
> version 2.96? If so, is there some document that states this? (I
> can't find documentation that goes back to this old a version of the
> gcc.) Thanks in advance for any help you can provide.
The gcc compiler has never put any limit on the number of significant
characters in an identifier. I don't know whether this was ever
documented.
What matters here, though, is not gcc, but the assembler and linker.
Those are not part of gcc. Some assemblers and linker limit the length
of externally visible symbols. The GNU assembler and linker have never
had any limits, though.
Ian