Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Clone in Desktop Download ZIP

Loading…

Add noreturn attribute to various *_exit functions #2

Merged
merged 1 commit into from

2 participants

@eugmes

This make report generated by llvm static analyzer much more usefull.

After applying this patch and running the analyzer:

scan-build ./configure
scan-build -v -V make

There are 4 reports. One is dead assignment (harmless, utils/dtop.c:646), two null pointer deferences in assert statements (liblsd/list.c:684, 719, with complex conditions) and another error in libnpfs/np.c:157 (here if s is 0 and buf_check_size(buf, 2+slen) is true memmove() gets a null argument.

@eugmes eugmes Add noreturn attribute to various *_exit functions
This make report generated by llvm static analyzer much more usefull.
f591ba8
@garlick garlick merged commit 5790d53 into chaos:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 23, 2011
  1. @eugmes

    Add noreturn attribute to various *_exit functions

    eugmes authored
    This make report generated by llvm static analyzer much more usefull.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 libdiod/diod_log.h
View
6 libdiod/diod_log.h
@@ -28,15 +28,15 @@ char *diod_log_get_dest (void);
void diod_log_msg (const char *fmt, va_list ap);
void err_exit (const char *fmt, ...)
- __attribute__ ((format (printf, 1, 2)));
+ __attribute__ ((format (printf, 1, 2), noreturn));
void err (const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
void errn_exit (int errnum, const char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
+ __attribute__ ((format (printf, 2, 3), noreturn));
void errn (int errnum, const char *fmt, ...)
__attribute__ ((format (printf, 2, 3)));
void msg_exit (const char *fmt, ...)
- __attribute__ ((format (printf, 1, 2)));
+ __attribute__ ((format (printf, 1, 2), noreturn));
void msg (const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
Something went wrong with that request. Please try again.