inet_aton 0x0 in integer in structure

Toebs Douglass toby@winterflaw.net
Fri May 12 11:08:00 GMT 2017


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 :-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/libc-help/attachments/20170512/7bfe3b0f/attachment.sig>


More information about the Libc-help mailing list