Bug 12466

Summary: -Wold-style-definition incorrectly warns with ellipsises.
Product: gcc Reporter: Kelley Cook <kcook>
Component: cAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs
Priority: P2 Keywords: diagnostic
Version: 3.4.0   
Target Milestone: 3.4.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2003-09-30 19:56:18
Attachments: Reduced testcase
Proposed Patch

Description Kelley Cook 2003-09-30 17:43:43 UTC
In attempting to compile GCC with -Wold-style-definition, I ran into many of the
following errors, which are false positives due to the ellipsis.

From gengtype.c:70

/* Wrapper for xvasprintf.  */
char *
xasprintf (const char *format, ...)
{
  char *result;
  va_list ap;

  va_start (ap, format);
  xvasprintf (&result, format, ap);
  va_end (ap);
  return result;
}

This warns with:

../../gcc-snapshot/gcc/gengtype.c: In function `xasprintf':
../../gcc-snapshot/gcc/gengtype.c:73: warning: old-style parameter declaration

Reduced Testcase and suggested patch coming shortly
Comment 1 Kelley Cook 2003-09-30 17:45:11 UTC
Created attachment 4866 [details]
Reduced testcase

Compiling this with -Wold-style-definition will show the bug
Comment 2 Kelley Cook 2003-09-30 17:53:52 UTC
Created attachment 4868 [details]
Proposed Patch

http://gcc.gnu.org/ml/gcc-patches/2003-09/msg02134.html
Comment 3 Andrew Pinski 2003-09-30 19:56:18 UTC
I can confirm this on the mainline (20030930).
Comment 4 Andrew Pinski 2003-10-02 00:11:45 UTC
Closing as fixed as  the patch went in: <http://gcc.gnu.org/ml/gcc-cvs/2003-10/
msg00040.html>