Alexander Bluhm <[email protected]> writes:
> On Thu, Feb 04, 2016 at 02:02:46PM +0100, J??r??mie Courr??ges-Anglas wrote:
>> +static void usage(void);
>
> Can you make the usage static __dead void?
gsoares made the same comment, there are other functions that could be
marked __dead and I initially wanted to do them in one pass.
>> +#define OPTIONS ":c:ds"
>
> Our other daemons don't have a leading ':', why to be special here?
No good reason, just an old habit. I have removed it.
>> while ((ch = getopt(argc, argv, OPTIONS)) != -1) {
>
> This OPTIONS define looks quite useless. Why not put the string here?
Indeed, fixed.
The diff below adds __dead to relevant function decls and tidies up
log.h a bit.
ok?
Index: log.h
===================================================================
RCS file: /cvs/src/usr.sbin/rtadvd/log.h,v
retrieving revision 1.1
diff -u -p -r1.1 log.h
--- log.h 21 Apr 2008 20:40:55 -0000 1.1
+++ log.h 5 Feb 2016 12:22:39 -0000
@@ -19,10 +19,10 @@
void log_init(int);
void logit(int pri, const char *fmt, ...);
-void fatal(const char*);
+__dead void fatal(const char*);
+__dead void fatalx(const char*);
+
void log_warn(const char*, ...) __attribute__((format(printf, 1, 2)));
+void log_warnx(const char*, ...) __attribute__((format(printf, 1, 2)));
void log_info(const char*, ...) __attribute__((format(printf, 1, 2)));
void log_debug(const char*, ...) __attribute__((format(printf, 1, 2)));
-
-void fatalx(const char*);
-void log_warnx(const char*, ...) __attribute__((format(printf, 1, 2)));
Index: rtadvd.c
===================================================================
RCS file: /cvs/src/usr.sbin/rtadvd/rtadvd.c,v
retrieving revision 1.63
diff -u -p -r1.63 rtadvd.c
--- rtadvd.c 5 Feb 2016 12:16:21 -0000 1.63
+++ rtadvd.c 5 Feb 2016 12:22:39 -0000
@@ -132,7 +132,7 @@ u_int32_t ndopt_flags[] = {
static __dead void usage(void);
static void set_die(int);
-static void die(void);
+static __dead void die(void);
static void sock_open(void);
static void rtsock_open(void);
static void rtadvd_input(void);
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE