Skip to content

Commit

Permalink
mark functions that never return as NORETURN
Browse files Browse the repository at this point in the history
@pmatos did all the work here in #8 and
racket/racket#2344.
  • Loading branch information
mflatt committed Jun 21, 2019
1 parent 098fdb7 commit 2e3a618
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions c/externs.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ off64_t lseek64(int,off64_t,int);
#include <setjmp.h>
#endif

#if !defined(NORETURN)
# if defined(__GNUC__) || defined(__clang__)
# define NORETURN __attribute__((noreturn))
# elif defined(_MSC_VER)
# define NORETURN __declspec(noreturn)
# else
# define NORETURN
# endif /* defined(__GNUC__) || defined(__clang__) */
#endif /* !defined(NORETURN) */

/* external procedure declarations */
/* prototypes gen. by ProtoGen Version 0.31 (Haydn Huntley) 1/18/93 */

Expand Down Expand Up @@ -321,13 +331,13 @@ extern void S_handle_overflood PROTO((void));
extern void S_handle_apply_overflood PROTO((void));
extern void S_overflow PROTO((ptr tc, iptr frame_request));
extern void S_error_reset PROTO((const char *s));
extern void S_error_abort PROTO((const char *s));
extern void S_abnormal_exit PROTO((void));
extern void S_error_abort PROTO((const char *s)) NORETURN;
extern void S_abnormal_exit PROTO((void)) NORETURN;
extern void S_error PROTO((const char *who, const char *s));
extern void S_error1 PROTO((const char *who, const char *s, ptr x));
extern void S_error2 PROTO((const char *who, const char *s, ptr x, ptr y));
extern void S_error3 PROTO((const char *who, const char *s, ptr x, ptr y, ptr z));
extern void S_boot_error PROTO((const ptr who, ptr s, ptr args));
extern void S_boot_error PROTO((const ptr who, ptr s, ptr args)) NORETURN;
extern void S_handle_docall_error PROTO((void));
extern void S_handle_arg_error PROTO((void));
extern void S_handle_nonprocedure_symbol PROTO((void));
Expand Down

1 comment on commit 2e3a618

@pmatos
Copy link
Collaborator

@pmatos pmatos commented on 2e3a618 Jun 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mflatt Thank you very much for this commit.

Please sign in to comment.