mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Mark a few functions as __attribute__((noreturn)).
This is mostly to make static analysers and compiler warnings a bit happier - now they know that a call to, say, modalfatalbox() means they don't have to worry about what the rest of the function will do.
This commit is contained in:
parent
144b738f31
commit
d2ff948207
6
defs.h
6
defs.h
@ -113,4 +113,10 @@ typedef struct PacketProtocolLayer PacketProtocolLayer;
|
|||||||
TYPECHECK(object == &((type *)0)->field, \
|
TYPECHECK(object == &((type *)0)->field, \
|
||||||
((type *)(((char *)(object)) - offsetof(type, field))))
|
((type *)(((char *)(object)) - offsetof(type, field))))
|
||||||
|
|
||||||
|
#if defined __GNUC__ || defined __clang__
|
||||||
|
#define NORETURN __attribute__((__noreturn__))
|
||||||
|
#else
|
||||||
|
#define NORETURN
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* PUTTY_DEFS_H */
|
#endif /* PUTTY_DEFS_H */
|
||||||
|
2
pscp.c
2
pscp.c
@ -226,7 +226,7 @@ static void ssh_scp_init(void)
|
|||||||
/*
|
/*
|
||||||
* Print an error message and exit after closing the SSH link.
|
* Print an error message and exit after closing the SSH link.
|
||||||
*/
|
*/
|
||||||
static void bump(const char *fmt, ...)
|
static NORETURN void bump(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
char *str, *str2;
|
char *str, *str2;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
7
putty.h
7
putty.h
@ -1141,11 +1141,8 @@ struct TermWinVtable {
|
|||||||
* Global functions not specific to a connection instance.
|
* Global functions not specific to a connection instance.
|
||||||
*/
|
*/
|
||||||
void nonfatal(const char *, ...);
|
void nonfatal(const char *, ...);
|
||||||
void modalfatalbox(const char *, ...);
|
NORETURN void modalfatalbox(const char *, ...);
|
||||||
#ifdef macintosh
|
NORETURN void cleanup_exit(int);
|
||||||
#pragma noreturn(modalfatalbox)
|
|
||||||
#endif
|
|
||||||
void cleanup_exit(int);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exports from conf.c, and a big enum (via parametric macro) of
|
* Exports from conf.c, and a big enum (via parametric macro) of
|
||||||
|
Loading…
Reference in New Issue
Block a user