[Bug middle-end/47650] wrong output of print_generic_decl() called from a plugin
joe at mcknight dot de
gcc-bugzilla@gcc.gnu.org
Wed Apr 6 17:55:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47650
--- Comment #29 from joe at mcknight dot de 2011-04-06 17:55:30 UTC ---
FWIW, I can reproduce this now on Solaris without any magic compiler switches:
The program is just this here:
-------------------
void
foo(char *buf, int bufsz);
void
foo(char * const buf, const int bufsz)
{
}
-------------------
Compiling with just
gcc -fplugin=/path/to/plugin/testplugin.so -c foo.c
(gcc 4.5.2 with your patch on sparc-sun-solaris2.10)
gives me:
static void foo (char * const, int, void, ...);
However it only shows up on Solaris, I tried it on a Linux installation I have
as well and I get the correct output there :-(
Note the differences between the declaration and the definition regarding
"const". If I remove any const in the definition (for buf or bufsz) or add a
const to the declaration, the output will be correct.
More information about the Gcc-bugs
mailing list