`array_ref' not supported by dump_type (follow up?)
Ian Nixon
ian@tharas.com
Tue Apr 20 14:09:00 GMT 1999
Using:
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
on Solaris 2.6
The following:
#include <stdio.h>
void Func (FILE *fp)
{
if(!fp) return; // LINE 1
struct parser {
void Parse(const char *an, int sep = ':') { }
};
// LOCATION 2
char line[1024];
fgets(line, 1024, fp);
int len = strlen (line);
if (line[len-1] == '\n') { // IF BLOCK
line[len-1] = '\0';
}
if (line[0] == '#') {
parser Pp;
Pp.Parse (line);
}
}
Compiled with
g++ What.cc -c
Produces:
What.cc:23: sorry, not implemented: `array_ref' not supported by
dump_type
What.cc: In function `void Func(struct FILE *)':
What.cc:23: default argument to `int' from `'
The problem goes away (at least the compiler stops moaning) if you:
- Comment out LINE 1
or - Move LINE 1 to LOCATION 2
or - Comment out the IF BLOCK
or - Remove the default argument to parser::Parse
Thanks
Ian Nixon
More information about the Gcc-bugs
mailing list