On Sat, May 27, 2017 at 08:14:37PM +0200, Michal Mazurek wrote: > print_ioctl() is unused if not debugging. Found with clang, after > marking the function "static". Use OSFP_DEBUG, in a similar > fashion to OPT_DEBUG (pfctl_optimize.c). > > OK?
OK bluhm@ > > Index: sbin/pfctl/pfctl_osfp.c > =================================================================== > RCS file: /cvs/src/sbin/pfctl/pfctl_osfp.c,v > retrieving revision 1.23 > diff -u -p -r1.23 pfctl_osfp.c > --- sbin/pfctl/pfctl_osfp.c 10 Dec 2015 17:27:00 -0000 1.23 > +++ sbin/pfctl/pfctl_osfp.c 27 May 2017 18:08:57 -0000 > @@ -39,7 +39,8 @@ > > #define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b)) > > -#if 0 > +/* #define OSFP_DEBUG 1 */ > +#ifdef OSFP_DEBUG > # define DEBUG(fp, str, v...) \ > fprintf(stderr, "%s:%s:%s " str "\n", (fp)->fp_os.fp_class_nm, \ > (fp)->fp_os.fp_version_nm, (fp)->fp_os.fp_subtype_nm , ## v); > @@ -74,7 +75,9 @@ int get_tcpopts(const char *, int, co > pf_tcpopts_t *, int *, int *, int *, int *, int *, > int *); > void import_fingerprint(struct pf_osfp_ioctl *); > +#ifdef OSFP_DEBUG > const char *print_ioctl(struct pf_osfp_ioctl *); > +#endif > void print_name_list(int, struct name_list *, const char *); > void sort_name_list(int, struct name_list *); > struct name_entry *lookup_name_list(struct name_list *, const char *); > @@ -990,6 +993,7 @@ get_field(char **line, size_t *len, int > } > > > +#ifdef OSFP_DEBUG > const char * > print_ioctl(struct pf_osfp_ioctl *fp) > { > @@ -1091,3 +1095,4 @@ print_ioctl(struct pf_osfp_ioctl *fp) > > return (buf); > } > +#endif > > -- > Michal Mazurek