This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28554] New: Use of __attribute__ ((constructor)) on functions issues confusing error
- From: "fjahanian at apple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jul 2006 18:47:44 -0000
- Subject: [Bug c++/28554] New: Use of __attribute__ ((constructor)) on functions issues confusing error
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In this test case, g++ issues a diagnostics which is confusing. If use of
__attribute__ ((constructor)) on a function with argument list other than
'void' is illegal, it should say so:
__attribute__ ((constructor))
static void Initialize(int argc, char *argv[], char *envp[]) {
}
% g++ -c ctor.C
ctor.C: In function '(static initializers for ctor.C)':
ctor.C:2: error: too few arguments to function 'void Initialize(int, char**,
char**)'
ctor.C:3: error: at this point in file
--
Summary: Use of __attribute__ ((constructor)) on functions issues
confusing error
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fjahanian at apple dot com
GCC build triplet: apple-ppc-darwin
GCC host triplet: apple-ppc-darwin
GCC target triplet: apple-ppc-darwin
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28554