Skip to content

Take advantage of clang-3.9 new nonnull attribute #1370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/ansi-c/library/pthread_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,8 @@ inline int pthread_create(
this_thread_id=++__CPROVER_next_thread_id;
__CPROVER_atomic_end();

if(thread)
{
// pthread_t is a pointer type on some systems
*thread=(pthread_t)this_thread_id;
}
// pthread_t is a pointer type on some systems
*thread=(pthread_t)this_thread_id;

#ifdef __CPROVER_CUSTOM_BITVECTOR_ANALYSIS
__CPROVER_set_must(thread, "pthread-id");
Expand Down
8 changes: 4 additions & 4 deletions src/ansi-c/library/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ inline int strcmp(const char *s1, const char *s2)
{
__CPROVER_HIDE:;
#if !defined(__linux__) || defined(__GLIBC__)
if(s1!=0 && s1==s2) return 0;
if(s1==s2) return 0;
#else
// musl guarantees non-null of s1
if(s1==s2) return 0;
Expand Down Expand Up @@ -346,7 +346,7 @@ inline int strcasecmp(const char *s1, const char *s2)
{
__CPROVER_HIDE:;
#if !defined(__linux__) || defined(__GLIBC__)
if(s1!=0 && s1==s2) return 0;
if(s1==s2) return 0;
#else
// musl guarantees non-null of s1
if(s1==s2) return 0;
Expand Down Expand Up @@ -396,7 +396,7 @@ inline int strncmp(const char *s1, const char *s2, size_t n)
{
__CPROVER_HIDE:;
#if !defined(__linux__) || defined(__GLIBC__)
if(s1!=0 && s1==s2) return 0;
if(s1==s2) return 0;
#else
// musl guarantees non-null of s1
if(s1==s2) return 0;
Expand Down Expand Up @@ -440,7 +440,7 @@ inline int strncasecmp(const char *s1, const char *s2, size_t n)
{
__CPROVER_HIDE:;
#if !defined(__linux__) || defined(__GLIBC__)
if(s1!=0 && s1==s2) return 0;
if(s1==s2) return 0;
#else
// musl guarantees non-null of s1
if(s1==s2) return 0;
Expand Down