[Bug c/20258] New: error generated for storage class specified for function parameter
schlie at comcast dot net
gcc-bugzilla@gcc.gnu.org
Tue Mar 1 03:05:00 GMT 2005
Which may not be litterally a bug, but would like to restrict the functions parameter in this way.
Is this possible? (as given the below code example, wan't to be able to identify data stored in
program read-only program ROM as being "static const", which they are, and corespondingly
identify parameters to functions similarly restricted to "static const" data which actually needs
to be accessed via a different load instruction on the avr, do to it's harvard memory architecture.
simple example desired code:
int foo (static const char * s, char v) /* where s is desired to be restricted to a (static const *) */
{
return s[v];
}
int main (void)
{
volatile char v;
static const char s[] = "some string"; /* as s[] is stored in program memory */
return foo (s, v);
}
Where idealy then if GCC can preserve the (static const *) attributes then even such references
within functions should be able to be idententifed during rtl/template matching for code generation
hopefully enabling (static const *) to be dereferenced with differnt load instructions than (const *)?
--
Summary: error generated for storage class specified for function
parameter
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schlie at comcast dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: ppc-apple-darwin7.8
GCC host triplet: ppc-apple-darwin7.8
GCC target triplet: avr-unknown-none
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20258
More information about the Gcc-bugs
mailing list