Skip to content
Snippets Groups Projects
Commit e42bdaeb authored by Patrick Baudin's avatar Patrick Baudin Committed by Virgile Prevosto
Browse files

[libC] fixes specification of abort and exit functions

parent 54ca5b81
No related branches found
No related tags found
No related merge requests found
...@@ -454,8 +454,11 @@ extern void *realloc(void *ptr, size_t size); ...@@ -454,8 +454,11 @@ extern void *realloc(void *ptr, size_t size);
/* ISO C: 7.20.4 */ /* ISO C: 7.20.4 */
/*@ assigns \nothing; /*@
@ ensures never_terminates: \false; */ assigns \exit_status \from \nothing;
exits status: \exit_status != EXIT_SUCCESS;
ensures never_terminates: \false;
*/
extern void abort(void) __attribute__ ((__noreturn__)); extern void abort(void) __attribute__ ((__noreturn__));
/*@ assigns \result \from \nothing ;*/ /*@ assigns \result \from \nothing ;*/
...@@ -465,7 +468,8 @@ extern int atexit(void (*func)(void)); ...@@ -465,7 +468,8 @@ extern int atexit(void (*func)(void));
extern int at_quick_exit(void (*func)(void)); extern int at_quick_exit(void (*func)(void));
/*@ /*@
assigns \nothing; assigns \exit_status \from status;
exits status: \exit_status == status;
ensures never_terminates: \false; ensures never_terminates: \false;
*/ */
extern void exit(int status) __attribute__ ((__noreturn__)); extern void exit(int status) __attribute__ ((__noreturn__));
......
...@@ -2346,8 +2346,11 @@ extern void free(void *p); ...@@ -2346,8 +2346,11 @@ extern void free(void *p);
*/ */
extern void *realloc(void *ptr, size_t size); extern void *realloc(void *ptr, size_t size);
/*@ ensures never_terminates: \false; /*@ exits status: \exit_status ≢ 0;
assigns \nothing; */ ensures never_terminates: \false;
assigns \exit_status \from \nothing;
*/
extern __attribute__((__noreturn__)) void abort(void); extern __attribute__((__noreturn__)) void abort(void);
/*@ assigns \result; /*@ assigns \result;
...@@ -2358,8 +2361,11 @@ extern int atexit(void (*func)(void)); ...@@ -2358,8 +2361,11 @@ extern int atexit(void (*func)(void));
assigns \result \from \nothing; */ assigns \result \from \nothing; */
extern int at_quick_exit(void (*func)(void)); extern int at_quick_exit(void (*func)(void));
/*@ ensures never_terminates: \false; /*@ exits status: \exit_status ≡ \old(status);
assigns \nothing; */ ensures never_terminates: \false;
assigns \exit_status \from status;
*/
extern __attribute__((__noreturn__)) void exit(int status); extern __attribute__((__noreturn__)) void exit(int status);
/*@ ensures never_terminates: \false; /*@ ensures never_terminates: \false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment