Skip to content

Commit

Permalink
[analyzer][StdLibraryFunctionsChecker] Add POSIX networking functions
Browse files Browse the repository at this point in the history
Summary:
Adding networking functions from the POSIX standard (2017). This includes
functions that deal with sockets from socket.h, netdb.h.

In 'socket.h' of some libc implementations (e.g. glibc) with C99, sockaddr
parameter is a transparent union of the underlying sockaddr_ family of pointers
instead of being a pointer to struct sockaddr. In these cases, the standardized
signature will not match, thus we try to match with another signature that has
the joker Irrelevant type. In the case of transparent unions, we also not add
those constraints which require pointer types for the sockaddr param.

Interestingly, in 'netdb.h' sockaddr is not handled as a transparent union.

Tags: #clang

Differential Revision: https://reviews.llvm.org/D83407
  • Loading branch information
Gabor Marton committed Jul 20, 2020
1 parent 78f543e commit 3ff220d
Show file tree
Hide file tree
Showing 3 changed files with 404 additions and 27 deletions.

0 comments on commit 3ff220d

Please sign in to comment.