#endif
#define nethack_enter(argc, argv) nethack_enter_windows()
-extern void nethack_exit(int) NORETURN;
+ATTRNORETURN extern void nethack_exit(int) NORETURN;
extern boolean file_exists(const char *);
extern boolean file_newer(const char *, const char *);
#ifndef SYSTEM_H
static void get_valuables(struct obj *);
static void sort_valuables(struct valuable_data *, int);
static void artifact_score(struct obj *, boolean, winid);
-static void really_done(int) NORETURN;
+ATTRNORETURN static void really_done(int) NORETURN;
static void savelife(int);
static boolean should_query_disclose_option(int, char *);
#ifdef DUMPLOG
static void dump_everything(int, time_t);
#if defined(__BEOS__) || defined(MICRO) || defined(OS2) || defined(WIN32)
-extern void nethack_exit(int) NORETURN;
+ATTRNORETURN extern void nethack_exit(int) NORETURN;
#else
#define nethack_exit exit
#endif
#endif
#if defined(MICRO) || defined(OS2)
-void nethack_exit(int) NORETURN;
+ATTRNORETURN void nethack_exit(int) NORETURN;
#else
#define nethack_exit exit
#endif
#endif
#if defined(MICRO) || defined(OS2)
-void nethack_exit(int) NORETURN;
+ATTRNORETURN void nethack_exit(int) NORETURN;
#else
#define nethack_exit exit
#endif
static void consume_arg(int, int *, char ***);
static void consume_two_args(int, int *, char ***);
static void early_options(int *, char ***, char **);
-static void opt_terminate(void) NORETURN;
-static void opt_usage(const char *) NORETURN;
+ATTRNORETURN static void opt_terminate(void) NORETURN;
+ATTRNORETURN static void opt_usage(const char *) NORETURN;
static void opt_showpaths(const char *);
-static void scores_only(int, char **, const char *) NORETURN;
+ATTRNORETURN static void scores_only(int, char **, const char *) NORETURN;
#ifdef _M_UNIX
extern void check_sco_console(void);
/* for command-line options that perform some immediate action and then
terminate the program without starting play, like 'nethack --version'
or 'nethack -s Zelda'; do some cleanup before that termination */
-static void
+ATTRNORETURN static void
opt_terminate(void)
{
config_error_done(); /* free memory allocated by config_error_init() */
/*NOTREACHED*/
}
-static void
+ATTRNORETURN static void
opt_usage(const char *hackdir)
{
#ifdef CHDIR
/* handle "-s <score options> [character-names]" to show all the entries
in the high scores file ('record') belonging to particular characters;
nethack will end after doing so without starting play */
-static void
+ATTRNORETURN static void
scores_only(int argc, char **argv, const char *dir)
{
/* do this now rather than waiting for final termination, in case there
char *exename(void);
boolean fakeconsole(void);
void freefakeconsole(void);
-extern void nethack_exit(int) NORETURN;
+ATTRNORETURN extern void nethack_exit(int) NORETURN;
#if defined(MSWIN_GRAPHICS)
extern void mswin_destroy_reg(void);
#endif
* WinMain exist, the resulting executable won't work correctly.
*/
+DISABLE_WARNING_UNREACHABLE_CODE
+
#if defined(__MINGW32__) && defined(MSWIN_GRAPHICS)
#define MAIN mingw_main
#else
return 0;
}
+RESTORE_WARNING_UNREACHABLE_CODE
+
static void
process_options(int argc, char * argv[])
{
#include <string.h>
#endif
-static void xexit(int) NORETURN;
-extern void panic(const char *, ...) NORETURN;
+ATTRNORETURN static void xexit(int) NORETURN;
+ATTRNORETURN extern void panic(const char *, ...) NORETURN;
char *eos(char *); /* also used by dlb.c */
FILE *fopen_datafile(const char *, const char *);
unsigned FITSuint_(unsigned long long, const char *, int);
extern void close_library(library *);
static void Write(int, char *, long);
-static void usage(void) NORETURN;
-static void verbose_help(void) NORETURN;
+ATTRNORETURN static void usage(void) NORETURN;
+ATTRNORETURN static void verbose_help(void) NORETURN;
static void write_dlb_directory(int, int, libdir *, long, long, long);
static char default_progname[] = "dlb";
* C dir chdir to dir (used ONCE, not like tar's -C)
*/
-static void
+ATTRNORETURN static void
usage(void)
{
(void) printf("Usage: %s [ctxCIfv] arguments... [files...]\n", progname);
/*NOTREACHED*/
}
-static void
+ATTRNORETURN static void
verbose_help(void)
{
static const char *const long_help[] = {
#endif /* DLBLIB */
#endif /* DLB */
-static void
+ATTRNORETURN static void
xexit(int retcd)
{
#ifdef DLB
#include "../src/mdlib.c"
-static void makedefs_exit(int) NORETURN;
+ATTRNORETURN static void makedefs_exit(int) NORETURN;
-static void
+ATTRNORETURN static void
makedefs_exit(int how)
{
#if 0 /* makedefs doesn't need to do this */
/*#define COMCTL_URL
* "http://www.microsoft.com/msdownload/ieplatform/ie/comctrlx86.asp"*/
-extern void nethack_exit(int) NORETURN;
+ATTRNORETURN extern void nethack_exit(int) NORETURN;
static TCHAR *_get_cmd_arg(TCHAR *pCmdLine);
static HRESULT GetComCtlVersion(LPDWORD pdwMajor, LPDWORD pdwMinor);
BOOL WINAPI