[cfe-dev] Function prototype with K&R definition and resulting call.

Eli Friedman eli.friedman at gmail.com
Mon Aug 29 17:00:29 PDT 2011


On Mon, Aug 29, 2011 at 4:48 PM, JP
<jpbonn-keyword-cfedev.957c48 at corniceresearch.com> wrote:
> I'm noticing some behavior I don't understand. There is a function
> prototype in scope but the function definition is K&R style.  My
> understanding is the actual call to the function should be non-varargs
> since the prototype is present.  What I'm seeing is the call is being
> made as a varargs call.  What is the correct behavior in this case?

If a prototype is visible, the fact that there's also a definition
shouldn't have any effect; sounds like a bug.

See also the discussion in http://llvm.org/bugs/show_bug.cgi?id=10713 .

-Eli




More information about the cfe-dev mailing list