This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Machine attributes and language attributes
- To: jsm28 at cam dot ac dot uk (Joseph S. Myers)
- Subject: Re: Machine attributes and language attributes
- From: Joern Rennecke <amylaar at redhat dot com>
- Date: Tue, 3 Jul 2001 20:28:31 +0100 (BST)
- Cc: gcc at gcc dot gnu dot org
> I'd like to move to more uniformity with other attribute parsing, and have
> targets and front ends provide instead a table of accepted attributes.
> This would contain function pointers for each attribute to handle that
> attribute, but would lose the ability to have infinitely many attributes
> for a target. Does anyone see problems with such a change?
If you are saying that the target code provides a table of finite size,
that'd be OK with me, but you shouldn't code in any arbitrary
restriction. That would not only potentially impede future work, it
would also be against the GNU coding standards:
Semantic Standards:
Avoid arbitrary limits on the length or number of *any* data structure,
including filenames, lines, files, and symbols, by allocating all
data structures dynamically. In most Unix utilities, "long lines
are silently truncated". This is not acceptable in a GNU utility.
(end quote)
In this case, you don't actually have to do dynamic allocation, you
can just have an array that is initialized by the target, and indicate
the size with a length counter or an end marker.