Bug 12466 - -Wold-style-definition incorrectly warns with ellipsises.
Summary: -Wold-style-definition incorrectly warns with ellipsises.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2003-09-30 17:43 UTC by Kelley Cook
Modified: 2003-10-02 00:11 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-09-30 19:56:18


Attachments
Reduced testcase (124 bytes, text/plain)
2003-09-30 17:45 UTC, Kelley Cook
Details
Proposed Patch (623 bytes, patch)
2003-09-30 17:53 UTC, Kelley Cook
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>