Skip to content
This repository was archived by the owner on Oct 3, 2021. It is now read-only.

Commit 45b057b

Browse files
authored
Merge pull request #1146 from tautschnig/add-assert-0-take-2-headers
Insert assert(0) into the body of reach_error
2 parents 6c5337a + ddc22a5 commit 45b057b

File tree

188 files changed

+1979
-188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+1979
-188
lines changed

c/aws-c-common/prelude.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
typedef _Bool bool;
44

55
extern void abort(void);
6-
void reach_error(){}
6+
#include <assert.h>
7+
void reach_error() { assert(0); }
78
extern void abort(void);
89
void assume_abort_if_not(_Bool cond) {
910
if(!cond) {abort();}

c/busybox-1.22.0/basename-1.i

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ void assume_abort_if_not(int cond) {
99
if(!cond) {abort();}
1010
}
1111
extern void abort(void);
12-
void reach_error(){}
12+
13+
extern void __assert_fail (const char *__assertion, const char *__file,
14+
unsigned int __line, const char *__function)
15+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
16+
extern void __assert_perror_fail (int __errnum, const char *__file,
17+
unsigned int __line, const char *__function)
18+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
19+
extern void __assert (const char *__assertion, const char *__file, int __line)
20+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
21+
22+
void reach_error() { ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "busybox_sv_comp.h", 14, __extension__ __PRETTY_FUNCTION__); })); }
1323
typedef unsigned char __u_char;
1424
typedef unsigned short int __u_short;
1525
typedef unsigned int __u_int;

c/busybox-1.22.0/basename-2.i

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ void assume_abort_if_not(int cond) {
99
if(!cond) {abort();}
1010
}
1111
extern void abort(void);
12-
void reach_error(){}
12+
13+
extern void __assert_fail (const char *__assertion, const char *__file,
14+
unsigned int __line, const char *__function)
15+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
16+
extern void __assert_perror_fail (int __errnum, const char *__file,
17+
unsigned int __line, const char *__function)
18+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
19+
extern void __assert (const char *__assertion, const char *__file, int __line)
20+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
21+
22+
void reach_error() { ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "busybox_sv_comp.h", 14, __extension__ __PRETTY_FUNCTION__); })); }
1323
typedef unsigned char __u_char;
1424
typedef unsigned short int __u_short;
1525
typedef unsigned int __u_int;

c/busybox-1.22.0/busybox_sv_comp.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ void assume_abort_if_not(int cond) {
99
if(!cond) {abort();}
1010
}
1111
extern void abort(void);
12-
void reach_error(){}
12+
#define _GNU_SOURCE
13+
#include <assert.h>
14+
void reach_error() { assert(0); }

c/busybox-1.22.0/chgrp-incomplete-1.i

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ void assume_abort_if_not(int cond) {
99
if(!cond) {abort();}
1010
}
1111
extern void abort(void);
12-
void reach_error(){}
12+
13+
extern void __assert_fail (const char *__assertion, const char *__file,
14+
unsigned int __line, const char *__function)
15+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
16+
extern void __assert_perror_fail (int __errnum, const char *__file,
17+
unsigned int __line, const char *__function)
18+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
19+
extern void __assert (const char *__assertion, const char *__file, int __line)
20+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
21+
22+
void reach_error() { ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "busybox_sv_comp.h", 14, __extension__ __PRETTY_FUNCTION__); })); }
1323
typedef unsigned char __u_char;
1424
typedef unsigned short int __u_short;
1525
typedef unsigned int __u_int;

c/busybox-1.22.0/chgrp-incomplete-2.i

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ void assume_abort_if_not(int cond) {
99
if(!cond) {abort();}
1010
}
1111
extern void abort(void);
12-
void reach_error(){}
12+
13+
extern void __assert_fail (const char *__assertion, const char *__file,
14+
unsigned int __line, const char *__function)
15+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
16+
extern void __assert_perror_fail (int __errnum, const char *__file,
17+
unsigned int __line, const char *__function)
18+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
19+
extern void __assert (const char *__assertion, const char *__file, int __line)
20+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
21+
22+
void reach_error() { ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "busybox_sv_comp.h", 14, __extension__ __PRETTY_FUNCTION__); })); }
1323
typedef unsigned char __u_char;
1424
typedef unsigned short int __u_short;
1525
typedef unsigned int __u_int;

c/busybox-1.22.0/chroot-incomplete-1.i

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ void assume_abort_if_not(int cond) {
99
if(!cond) {abort();}
1010
}
1111
extern void abort(void);
12-
void reach_error(){}
12+
13+
extern void __assert_fail (const char *__assertion, const char *__file,
14+
unsigned int __line, const char *__function)
15+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
16+
extern void __assert_perror_fail (int __errnum, const char *__file,
17+
unsigned int __line, const char *__function)
18+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
19+
extern void __assert (const char *__assertion, const char *__file, int __line)
20+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
21+
22+
void reach_error() { ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "busybox_sv_comp.h", 14, __extension__ __PRETTY_FUNCTION__); })); }
1323
typedef unsigned char __u_char;
1424
typedef unsigned short int __u_short;
1525
typedef unsigned int __u_int;

c/busybox-1.22.0/chroot-incomplete-2.i

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ void assume_abort_if_not(int cond) {
99
if(!cond) {abort();}
1010
}
1111
extern void abort(void);
12-
void reach_error(){}
12+
13+
extern void __assert_fail (const char *__assertion, const char *__file,
14+
unsigned int __line, const char *__function)
15+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
16+
extern void __assert_perror_fail (int __errnum, const char *__file,
17+
unsigned int __line, const char *__function)
18+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
19+
extern void __assert (const char *__assertion, const char *__file, int __line)
20+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
21+
22+
void reach_error() { ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "busybox_sv_comp.h", 14, __extension__ __PRETTY_FUNCTION__); })); }
1323
typedef unsigned char __u_char;
1424
typedef unsigned short int __u_short;
1525
typedef unsigned int __u_int;

c/busybox-1.22.0/cut-1.i

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ void assume_abort_if_not(int cond) {
99
if(!cond) {abort();}
1010
}
1111
extern void abort(void);
12-
void reach_error(){}
12+
13+
extern void __assert_fail (const char *__assertion, const char *__file,
14+
unsigned int __line, const char *__function)
15+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
16+
extern void __assert_perror_fail (int __errnum, const char *__file,
17+
unsigned int __line, const char *__function)
18+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
19+
extern void __assert (const char *__assertion, const char *__file, int __line)
20+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
21+
22+
void reach_error() { ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "busybox_sv_comp.h", 14, __extension__ __PRETTY_FUNCTION__); })); }
1323
typedef __builtin_va_list __gnuc_va_list;
1424

1525
extern void closelog (void);

c/busybox-1.22.0/cut-2.i

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ void assume_abort_if_not(int cond) {
99
if(!cond) {abort();}
1010
}
1111
extern void abort(void);
12-
void reach_error(){}
12+
13+
extern void __assert_fail (const char *__assertion, const char *__file,
14+
unsigned int __line, const char *__function)
15+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
16+
extern void __assert_perror_fail (int __errnum, const char *__file,
17+
unsigned int __line, const char *__function)
18+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
19+
extern void __assert (const char *__assertion, const char *__file, int __line)
20+
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
21+
22+
void reach_error() { ((void) sizeof ((0) ? 1 : 0), __extension__ ({ if (0) ; else __assert_fail ("0", "busybox_sv_comp.h", 14, __extension__ __PRETTY_FUNCTION__); })); }
1323
typedef __builtin_va_list __gnuc_va_list;
1424

1525
extern void closelog (void);

0 commit comments

Comments
 (0)