Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Eric Botcazou
> Agreed. But I still think that these are two very different issues: > > * Doing implicit conversion to void * for builtins is just a convenient way > for interfacing with builtins. > > * Using void * for System.Address shouldn't have any immediate advantage > for users, but would be a better m

Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Tristan Gingold
On Jul 16, 2012, at 5:16 PM, Duncan Sands wrote: > PS: That said, I have to admit that using void* for builtins does cover the > most important cases. Agreed. But I still think that these are two very different issues: * Doing implicit conversion to void * for builtins is just a convenient way

Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Duncan Sands
PS: That said, I have to admit that using void* for builtins does cover the most important cases.

Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Duncan Sands
Hi Tristan, Ah, what you want is the use of 'void *' for System.Address. We didn't choose that because the semantic of System.Address (which includes arithmetic on the whole address space) doesn't match the void * one. void* arithmetic of this kind exists, it's a gcc extension to C :) The i

Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Tristan Gingold
On Jul 16, 2012, at 4:36 PM, Duncan Sands wrote: > Hi Tristan, > >> Ah, what you want is the use of 'void *' for System.Address. >> We didn't choose that because the semantic of System.Address (which includes >> arithmetic on the whole address space) doesn't match the void * one. > > void* ari

Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Duncan Sands
Hi Tristan, Ah, what you want is the use of 'void *' for System.Address. We didn't choose that because the semantic of System.Address (which includes arithmetic on the whole address space) doesn't match the void * one. void* arithmetic of this kind exists, it's a gcc extension to C :) But,

Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Tristan Gingold
On Jul 16, 2012, at 3:58 PM, Duncan Sands wrote: > Hi Tristan, > >>> indeed, for two years already. Is there any reason not to do this for all >>> functions, rather than just limiting it to builtins? >> >> I don't understand what do you mean. We need to do this implicit conversion >> for bui

Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Duncan Sands
Hi Tristan, indeed, for two years already. Is there any reason not to do this for all functions, rather than just limiting it to builtins? I don't understand what do you mean. We need to do this implicit conversion for builtins because they are known by the compiler. Which other functions

Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Tristan Gingold
On Jul 16, 2012, at 3:24 PM, Duncan Sands wrote: > Hi Tristan, > > On 16/07/12 15:17, Tristan Gingold wrote: >> >> On Jul 16, 2012, at 3:16 PM, Duncan Sands wrote: >> >>> Hi Arnaud, >>> The natural way to import a builtin that returns void * is to use System.Address in Ada, which is

Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Duncan Sands
Hi Tristan, On 16/07/12 15:17, Tristan Gingold wrote: On Jul 16, 2012, at 3:16 PM, Duncan Sands wrote: Hi Arnaud, The natural way to import a builtin that returns void * is to use System.Address in Ada, which is in fact an integral type. how about doing this for formal arguments too and n

Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Tristan Gingold
On Jul 16, 2012, at 3:16 PM, Duncan Sands wrote: > Hi Arnaud, > >> The natural way to import a builtin that returns void * is to use >> System.Address in Ada, which is in fact an integral type. > > how about doing this for formal arguments too and not just the return type? Formal arguments wer

Re: [Ada] Ease interface with builtins that returns void *

2012-07-16 Thread Duncan Sands
Hi Arnaud, The natural way to import a builtin that returns void * is to use System.Address in Ada, which is in fact an integral type. how about doing this for formal arguments too and not just the return type? This would improve optimization by LLVM of calls to standard library functions sinc