This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/47650] wrong output of print_generic_decl() called from a plugin
- From: "joe at mcknight dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 6 Apr 2011 17:55:40 +0000
- Subject: [Bug middle-end/47650] wrong output of print_generic_decl() called from a plugin
- Auto-submitted: auto-generated
- References: <bug-47650-4@http.gcc.gnu.org/bugzilla/>
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.