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

Reply via email to