This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: inet_aton 0x0 in integer in structure


On 12/05/17 13:02, tomas@tuxteam.de wrote:
> On Fri, May 12, 2017 at 11:56:40AM +0200, alleswirdbesser@posteo.de wrote:
>> It is valid ANSI C code and it makes sense. And it is a pointer,
>> like in the header:
>> extern int inet_aton (const char *__cp, struct in_addr *__inp) __THROW;
>> The compiler accepted it as well.
> 
> No. Sorry to be a bit blunt, but I think you haven't understood C.

The language itself does not express what should happen here.  A pointer
looks the same as a pointer to allocated store.  Of course, a developer
familiar with C will infer the latter because if you were going to
allocate in the function you'd pass in a pointer to pointer - but,
again, here, the language is not itself *actually explicitly expressing
in what you actually write* what's what.  A pointer is a pointer is a
pointer :-)

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]