[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Possible bug in tcc

From: Ben
Subject: Re: [Tinycc-devel] Possible bug in tcc
Date: Tue, 01 Nov 2011 19:16:00 +0000

On Tue, 2011-11-01 at 19:25 +0100, Robert Clausecker wrote:

> It seems that I discovered a bug in tcc. ANSI C allows declaration of
> prototypes containing function pointers like this:
>         void traverse(mystruct_t*, void(mycontent_t*));
> tcc currently rejects this giving an error "')' expected". This
> equivalent prototype works:
>         void traverse(mystruct_t*,void(*)(mycontent_t*));
> Is this a bug or a feature?

The two prototypes are not equivalent.  The first is a syntax error but
the second one is fine -- provided you wanted to pass a pointer to a
function that takes a mycontent_t pointer and returns nothing.

Ben Bacarisse

reply via email to

[Prev in Thread] Current Thread [Next in Thread]