This is an archive of the discontinued LLVM Phabricator instance.

[DFSan] Fix test_inet_pton for big endian archs
ClosedPublic

Authored by mohit.bhakkad on Feb 29 2016, 10:39 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

mohit.bhakkad retitled this revision from to [DFSan] Fix test_inet_pton for big endian archs.
mohit.bhakkad updated this object.
mohit.bhakkad added reviewers: pcc, samsonov, kcc.
mohit.bhakkad set the repository for this revision to rL LLVM.
ed added a subscriber: ed.Feb 29 2016, 10:59 PM

I think that the preferred way of normally doing this is by using the htonl() function provided by <arpa/inet.h>:

assert(in4.s_addr == htonl(0x7f000001);

There is no need to explicitly take the byte ordering of the architecture into account.

Changed as suggested.

sorry, updating again with a full context diff.

Hi @pcc, @samsonov, could you please review this?

samsonov accepted this revision.Mar 8 2016, 12:07 PM
samsonov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Mar 8 2016, 12:07 PM
This revision was automatically updated to reflect the committed changes.