Skip to content

Remove "inline" from library models [blocks: #6863] #6901

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

Merged
merged 4 commits into from
Jun 3, 2022
Merged
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
1 change: 1 addition & 0 deletions regression/goto-analyzer/heap-allocation-nondet-1/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdlib.h>

int main()
{
Expand Down
1 change: 1 addition & 0 deletions regression/goto-analyzer/heap-allocation-nondet-2/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdlib.h>

int main()
{
Expand Down
1 change: 1 addition & 0 deletions regression/goto-analyzer/heap-allocation-nondet-3/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdlib.h>

int main()
{
Expand Down
1 change: 1 addition & 0 deletions regression/goto-analyzer/heap-allocation-nondet-4/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdlib.h>

int main()
{
Expand Down
1 change: 1 addition & 0 deletions regression/goto-analyzer/heap-allocation-nondet-5/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdlib.h>

int main()
{
Expand Down
1 change: 1 addition & 0 deletions regression/goto-analyzer/heap-allocation-nondet-6/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdlib.h>

int main()
{
Expand Down
1 change: 1 addition & 0 deletions regression/goto-analyzer/heap-allocation-write-2/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdlib.h>

int main()
{
Expand Down
1 change: 1 addition & 0 deletions regression/goto-analyzer/heap-allocation-write/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdlib.h>

int main()
{
Expand Down
1 change: 1 addition & 0 deletions regression/goto-analyzer/heap-allocation/main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <stdlib.h>

int main()
{
Expand Down
28 changes: 14 additions & 14 deletions src/ansi-c/library/ctype.c
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@

/* FUNCTION: isalnum */

inline int isalnum(int c)
int isalnum(int c)
{ return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9'); }

/* FUNCTION: isalpha */

inline int isalpha(int c)
int isalpha(int c)
{ return (c>='a' && c<='z') || (c>='A' && c<='Z'); }

/* FUNCTION: isblank */

inline int isblank(int c)
int isblank(int c)
{ return c==' ' || c=='\t'; }

/* FUNCTION: iscntrl */

inline int iscntrl(int c)
int iscntrl(int c)
{ return (c>=0 && c<='\037') || c=='\177'; }

/* FUNCTION: isdigit */

inline int isdigit(int c)
int isdigit(int c)
{ return c>='0' && c<='9'; }

/* FUNCTION: isgraph */

inline int isgraph(int c)
int isgraph(int c)
{ return c>='!' && c<='~'; }

/* FUNCTION: islower */

inline int islower(int c)
int islower(int c)
{ return c>='a' && c<='z'; }

/* FUNCTION: isprint */

inline int isprint(int c)
int isprint(int c)
{ return c>=' ' && c<='~'; }

/* FUNCTION: ispunct */

inline int ispunct(int c)
int ispunct(int c)
{ return c=='!' ||
c=='"' ||
c=='#' ||
Expand Down Expand Up @@ -77,7 +77,7 @@ inline int ispunct(int c)

/* FUNCTION: isspace */

inline int isspace(int c)
int isspace(int c)
{ return c=='\t' ||
c=='\n' ||
c=='\v' ||
Expand All @@ -87,20 +87,20 @@ inline int isspace(int c)

/* FUNCTION: isupper */

inline int isupper(int c)
int isupper(int c)
{ return c>='A' && c<='Z'; }

/* FUNCTION: isxdigit */

inline int isxdigit(int c)
int isxdigit(int c)
{ return (c>='A' && c<='F') || (c>='a' && c<='f') || (c>='0' && c<='9'); }

/* FUNCTION: tolower */

inline int tolower(int c)
int tolower(int c)
{ return (c>='A' && c<='Z')?c+('a'-'A'):c; }

/* FUNCTION: toupper */

inline int toupper(int c)
int toupper(int c)
{ return (c>='a' && c<='z')?c-('a'-'A'):c; }
6 changes: 3 additions & 3 deletions src/ansi-c/library/errno.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__CPROVER_thread_local int __CPROVER_errno;

inline int * __error(void)
int *__error(void)
{
return &__CPROVER_errno;
}
Expand All @@ -17,7 +17,7 @@ inline int * __error(void)

__CPROVER_thread_local int __CPROVER_errno;

inline int *__errno_location(void)
int *__errno_location(void)
{
return &__CPROVER_errno;
}
Expand All @@ -29,7 +29,7 @@ inline int *__errno_location(void)

__CPROVER_thread_local int __CPROVER_errno;

inline int *_errno(void)
int *_errno(void)
{
return &__CPROVER_errno;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ansi-c/library/fenv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

extern int __CPROVER_rounding_mode;

inline int fegetround(void)
int fegetround(void)
{
__CPROVER_HIDE:;
// CPROVER uses the x86 numbering of the rounding modes
Expand All @@ -24,7 +24,7 @@ __CPROVER_HIDE:;

#include <fenv.h>

inline int fesetround(int rounding_mode)
int fesetround(int rounding_mode)
{
__CPROVER_HIDE:;
// CPROVER uses the x86 numbering of the rounding modes
Expand Down
12 changes: 6 additions & 6 deletions src/ansi-c/library/float.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ unsigned int _controlfp(

__CPROVER_thread_local unsigned __CPROVER_fpu_control_word;

inline unsigned int _status87(void)
unsigned int _status87(void)
{
return __CPROVER_fpu_control_word;
}
Expand All @@ -39,7 +39,7 @@ inline unsigned int _status87(void)

__CPROVER_thread_local unsigned __CPROVER_fpu_control_word;

inline unsigned int _statusfp(void)
unsigned int _statusfp(void)
{
return __CPROVER_fpu_control_word;
}
Expand All @@ -52,7 +52,7 @@ inline unsigned int _statusfp(void)

__CPROVER_thread_local unsigned __CPROVER_fpu_control_word;

inline void _statusfp2(unsigned int *px86, unsigned int *pSSE2)
void _statusfp2(unsigned int *px86, unsigned int *pSSE2)
{
unsigned SSE2_status;
*px86=__CPROVER_fpu_control_word;
Expand All @@ -63,7 +63,7 @@ inline void _statusfp2(unsigned int *px86, unsigned int *pSSE2)

/* FUNCTION: _isnan */

inline int _isnan(double x)
int _isnan(double x)
{
return __CPROVER_isnand(x);
}
Expand All @@ -72,7 +72,7 @@ inline int _isnan(double x)

extern int __CPROVER_rounding_mode;

inline int __builtin_flt_rounds(void)
int __builtin_flt_rounds(void)
{
// This is a clang builtin for FLT_ROUNDS
// The magic numbers are C99 and different from the
Expand All @@ -88,7 +88,7 @@ inline int __builtin_flt_rounds(void)

int __builtin_flt_rounds(void);

inline int __flt_rounds(void)
int __flt_rounds(void)
{
// Spotted on FreeBSD
return __builtin_flt_rounds();
Expand Down
26 changes: 13 additions & 13 deletions src/ansi-c/library/gcc.c
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
/* FUNCTION: __builtin_ia32_sfence */

inline void __builtin_ia32_sfence(void)
void __builtin_ia32_sfence(void)
{
__asm("sfence");
}

/* FUNCTION: __builtin_ia32_lfence */

inline void __builtin_ia32_lfence(void)
void __builtin_ia32_lfence(void)
{
__asm("lfence");
}

/* FUNCTION: __builtin_ia32_mfence */

inline void __builtin_ia32_mfence(void)
void __builtin_ia32_mfence(void)
{
__asm("mfence");
}

/* FUNCTION: __sync_synchronize */

inline void __sync_synchronize(void)
void __sync_synchronize(void)
{
// WARNING: this was a NOP before gcc 4.3.1,
// but is now believed to be the strongest possible barrier.
Expand All @@ -37,7 +37,7 @@ inline void __sync_synchronize(void)

int __builtin_clz(unsigned int x);

inline int __builtin_ffs(int x)
int __builtin_ffs(int x)
{
if(x == 0)
return 0;
Expand All @@ -54,7 +54,7 @@ inline int __builtin_ffs(int x)

int __builtin_clzl(unsigned long x);

inline int __builtin_ffsl(long x)
int __builtin_ffsl(long x)
{
if(x == 0)
return 0;
Expand All @@ -71,7 +71,7 @@ inline int __builtin_ffsl(long x)

int __builtin_clzll(unsigned long long x);

inline int __builtin_ffsll(long long x)
int __builtin_ffsll(long long x)
{
if(x == 0)
return 0;
Expand All @@ -88,7 +88,7 @@ inline int __builtin_ffsll(long long x)

void __atomic_thread_fence(int memorder);

inline _Bool __atomic_test_and_set(void *ptr, int memorder)
_Bool __atomic_test_and_set(void *ptr, int memorder)
{
__CPROVER_HIDE:;
__CPROVER_atomic_begin();
Expand All @@ -103,7 +103,7 @@ __CPROVER_HIDE:;

void __atomic_thread_fence(int memorder);

inline void __atomic_clear(_Bool *ptr, int memorder)
void __atomic_clear(_Bool *ptr, int memorder)
{
__CPROVER_HIDE:;
__CPROVER_atomic_begin();
Expand Down Expand Up @@ -145,7 +145,7 @@ __CPROVER_HIDE:;
# define __ATOMIC_SEQ_CST 5
#endif

inline void __atomic_thread_fence(int memorder)
void __atomic_thread_fence(int memorder)
{
__CPROVER_HIDE:;
if(memorder == __ATOMIC_CONSUME || memorder == __ATOMIC_ACQUIRE)
Expand All @@ -168,15 +168,15 @@ __CPROVER_HIDE:;

void __atomic_thread_fence(int memorder);

inline void __atomic_signal_fence(int memorder)
void __atomic_signal_fence(int memorder)
{
__CPROVER_HIDE:;
__atomic_thread_fence(memorder);
}

/* FUNCTION: __atomic_always_lock_free */

inline _Bool __atomic_always_lock_free(__CPROVER_size_t size, void *ptr)
_Bool __atomic_always_lock_free(__CPROVER_size_t size, void *ptr)
{
__CPROVER_HIDE:;
(void)ptr;
Expand All @@ -185,7 +185,7 @@ __CPROVER_HIDE:;

/* FUNCTION: __atomic_is_lock_free */

inline _Bool __atomic_is_lock_free(__CPROVER_size_t size, void *ptr)
_Bool __atomic_is_lock_free(__CPROVER_size_t size, void *ptr)
{
__CPROVER_HIDE:;
(void)ptr;
Expand Down
7 changes: 3 additions & 4 deletions src/ansi-c/library/getopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ extern int optind;
__CPROVER_bool __VERIFIER_nondet___CPROVER_bool();
size_t __VERIFIER_nondet_size_t();

inline int getopt(
int argc, char * const argv[], const char *optstring)
int getopt(int argc, char *const argv[], const char *optstring)
{
__CPROVER_HIDE:;
int result=-1;
Expand Down Expand Up @@ -62,9 +61,9 @@ inline int getopt(
#define __CPROVER_GETOPT_H_INCLUDED
#endif

inline int getopt_long(
int getopt_long(
int argc,
char * const argv[],
char *const argv[],
const char *optstring,
const struct option *longopts,
int *longindex)
Expand Down
Loading