Bug 28848 - argument mismatch for late-prototyped function should be warning, not error
Summary: argument mismatch for late-prototyped function should be warning, not error
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks: 29842
  Show dependency treegraph
 
Reported: 2006-08-25 19:09 UTC by Jorn Wolfgang Rennecke
Modified: 2018-08-14 23:19 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jorn Wolfgang Rennecke 2006-08-25 19:09:10 UTC
gcc.dg/noncompile/pr16876 should actually compile with a warning, rather
than fail with an error.

Some work on related issues has been done before in:
http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00772.html

I suppose in this code:
    case ic_argpass:
    case ic_argpass_nonproto:
      /* ??? This should not be an error when inlining calls to
         unprototyped functions.  */
      error ("incompatible type for argument %d of %qE", parmnum, rname);
      break;
we should emit a warning rather than an error for the ic_argpass_nonproto case.
However, since we are then not set up to fail the compilation, we should not
return an error_mark_node, as this could mask subsequent actual
constraint violations;
Instead, we should return a value of the required type; e.g. we could
make NULL pointer of type pointer to type, and generate and INDIRECT_REF.
Comment 1 Martin Sebor 2018-08-14 23:19:32 UTC
The test was removed in r125974 but it compiles without an error or warning now.