On 28.01.2016 11:04, Andreas Schwab wrote:
> John Paul Adrian Glaubitz writes:
>
>> [suggestion to use "void" as dummy return type]
>>
>> Wait. Do you think this would actually allow ghc to determine the
>> return type later? If I remember correctly, ghc currently initially
>> declares the functio
Why does the dummy declaration need to use a pointer type?
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
> > package Import is
> >
> >function Foo return System.Address;
> >pragma Import (C, Foo);
> >
> >function Bar return Integer;
> >
> > end Import;
> >
> > package body Import is
> >
> >function Bar return Integer is
> > function Foo_2 return Integer;
> > pragma Imp
> I suspect Ada needs something like this already. I expect the following
> to work (although it is quite hideous).
>
> with System;
>
> package Import is
>
>function Foo return System.Address;
>pragma Import (C, Foo);
>
>function Bar return Integer;
>
> end Import;
>
> package b
On Thu, Jan 28, 2016 at 11:11 AM, Florian Weimer wrote:
> On 01/27/2016 04:17 PM, Richard Biener wrote:
>
>> We are trying to support
>>
>> t.c
>> ---
>> void *foo();
>>
>> int bar()
>> {
>> return ((int (*)())foo) ();
>> }
>>
>> t2.c
>> -
>> int foo () { return 0; }
>>
>> thus doing a direc
On 01/27/2016 04:17 PM, Richard Biener wrote:
> We are trying to support
>
> t.c
> ---
> void *foo();
>
> int bar()
> {
> return ((int (*)())foo) ();
> }
>
> t2.c
> -
> int foo () { return 0; }
>
> thus doing a direct call to a function with a (wrong) prototype via a function
> pointer c
John Paul Adrian Glaubitz writes:
> Wait. Do you think this would actually allow ghc to determine the
> return type later? If I remember correctly, ghc currently initially
> declares the function prototype with return type void*, doesn't it?
Replace a lie with a different lie. Spot the pattern?
Richard Biener writes:
> I think that's reasonable and what GHC expects - declare "there is a function
> foo defined, no idea what prototype yet", unfortunately C requires to specify
> a return type.
Like void, f.ex.
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA
On 01/28/2016 09:55 AM, Andreas Schwab wrote:
> Richard Biener writes:
>
>> I think that's reasonable and what GHC expects - declare "there is a function
>> foo defined, no idea what prototype yet", unfortunately C requires to specify
>> a return type.
>
> Like void, f.ex.
Wait. Do you think th
9 matches
Mail list logo