Browse code

allow make distcheck to succeed (bb #1142) fix some more warnings filter -Werror in clamav-milter.c

git-svn: trunk@4141

Török Edvin authored on 2008/08/25 23:18:48
Showing 14 changed files
... ...
@@ -28,6 +28,6 @@ pkgconfig_DATA = libclamav.pc
28 28
 # don't complain that configuration files and databases are not removed, this is intended
29 29
 distuninstallcheck_listfiles = find . -type f ! -name clamd.conf ! -name freshclam.conf ! -name daily.cvd ! -name main.cvd -print
30 30
 DISTCLEANFILES = target.h
31
-DISTCHECK_CONFIGURE_FLAGS=--enable-milter CFLAGS="-Wno-pointer-sign -Wno-error=attributes -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wwrite-strings -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wpadded -Wno-error=type-limits -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wpacked -Wno-error=packed -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=padded"
31
+DISTCHECK_CONFIGURE_FLAGS=--enable-milter CFLAGS="-Wno-pointer-sign -Wno-error=attributes -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wwrite-strings -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wno-error=missing-format-attribute -Wpadded -Wno-error=type-limits -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wpacked -Wno-error=packed -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=padded"
32 32
 lcov:
33 33
 	($(MAKE); cd unit_tests; $(MAKE) lcov)
... ...
@@ -263,7 +263,25 @@ pkgconfig_DATA = libclamav.pc
263 263
 # don't complain that configuration files and databases are not removed, this is intended
264 264
 distuninstallcheck_listfiles = find . -type f ! -name clamd.conf ! -name freshclam.conf ! -name daily.cvd ! -name main.cvd -print
265 265
 DISTCLEANFILES = target.h
266
-DISTCHECK_CONFIGURE_FLAGS = --enable-milter CFLAGS="-Wno-pointer-sign -Wno-error=attributes -Werror-implicit-function-declaration -Werror -Wextra -Wall -Wbad-function-cast -Wcast-align -Wendif-labels -Wfloat-equal -Wformat=2 -Wmissing-declarations -Wmissing-prototypes -Wno-error=missing-prototypes -Wnested-externs -Wno-error=nested-externs -Wpointer-arith -Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch -Wno-switch-enum -Wundef -Wwrite-strings -Wstrict-overflow=1 -Winit-self -Wmissing-include-dirs -Wstrict-aliasing -Wdeclaration-after-statement -Waggregate-return -Wmissing-format-attribute -Wpadded -Wno-error=type-limits -Wno-error=unused-value -Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual -Wno-error=sign-compare -Wshadow -Wno-error=shadow -Wno-error=uninitialized -fdiagnostics-show-option -Wno-unused-parameter -Wpacked -Wno-error=packed -Wno-error=unreachable-code -Winvalid-pch -Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -Wno-error=padded"
266
+DISTCHECK_CONFIGURE_FLAGS = --enable-milter CFLAGS="-Wno-pointer-sign \
267
+	-Wno-error=attributes -Werror-implicit-function-declaration \
268
+	-Werror -Wextra -Wall -Wbad-function-cast -Wcast-align \
269
+	-Wendif-labels -Wfloat-equal -Wformat=2 -Wmissing-declarations \
270
+	-Wmissing-prototypes -Wno-error=missing-prototypes \
271
+	-Wnested-externs -Wno-error=nested-externs -Wpointer-arith \
272
+	-Wstrict-prototypes -Wno-error=strict-prototypes -Wno-switch \
273
+	-Wno-switch-enum -Wundef -Wwrite-strings -Wstrict-overflow=1 \
274
+	-Winit-self -Wmissing-include-dirs -Wstrict-aliasing \
275
+	-Wdeclaration-after-statement -Waggregate-return \
276
+	-Wmissing-format-attribute -Wno-error=missing-format-attribute \
277
+	-Wpadded -Wno-error=type-limits -Wno-error=unused-value \
278
+	-Wno-error=unused-variable -Wcast-qual -Wno-error=cast-qual \
279
+	-Wno-error=sign-compare -Wshadow -Wno-error=shadow \
280
+	-Wno-error=uninitialized -fdiagnostics-show-option \
281
+	-Wno-unused-parameter -Wpacked -Wno-error=packed \
282
+	-Wno-error=unreachable-code -Winvalid-pch \
283
+	-Wno-error=invalid-pch -O2 -D_FORTIFY_SOURCE=2 \
284
+	-fstack-protector-all -Wstack-protector -Wno-error=padded"
267 285
 all: clamav-config.h
268 286
 	$(MAKE) $(AM_MAKEFLAGS) all-recursive
269 287
 
... ...
@@ -34,7 +34,6 @@ clamav_milter_SOURCES = \
34 34
     $(top_srcdir)/shared/network.c \
35 35
     $(top_srcdir)/shared/network.h \
36 36
     clamav-milter.c
37
-
38 37
 man_MANS = $(top_builddir)/docs/man/clamav-milter.8
39 38
 
40 39
 endif
... ...
@@ -44,3 +43,6 @@ LIBS = $(top_builddir)/libclamav/libclamav.la @CLAMAV_MILTER_LIBS@ @THREAD_LIBS@
44 44
 AM_CPPFLAGS = -I$(top_srcdir)/clamd -I$(top_srcdir)/libclamav -I$(top_srcdir)/shared -I$(top_srcdir)
45 45
 EXTRA_DIST = clamav-milter.c INSTALL
46 46
 CLEANFILES=*.gcda *.gcno
47
+CFLAGS=`echo "@CFLAGS@" | sed -e 's/-Werror[^-]//'`
48
+
49
+
... ...
@@ -113,7 +113,7 @@ AWK = @AWK@
113 113
 CC = @CC@
114 114
 CCDEPMODE = @CCDEPMODE@
115 115
 CFGDIR = @CFGDIR@
116
-CFLAGS = @CFLAGS@
116
+CFLAGS = `echo "@CFLAGS@" | sed -e 's/-Werror[^-]//'`
117 117
 CHECK_CFLAGS = @CHECK_CFLAGS@
118 118
 CHECK_LIBS = @CHECK_LIBS@
119 119
 CLAMAVGROUP = @CLAMAVGROUP@
... ...
@@ -354,7 +354,6 @@ int writen(int fd, void *buff, unsigned int count)
354 354
 */
355 355
 int readsock(int sockfd, char *buf, size_t size, unsigned char delim, int timeout_sec, int force_delim, int read_command)
356 356
 {
357
-	int fd;
358 357
 	ssize_t n;
359 358
 	size_t boff = 0;
360 359
 	char *pdelim;
... ...
@@ -116,7 +116,7 @@ static int recvfd_and_scan(int desc, const struct cl_engine *engine, const struc
116 116
 int command(int desc, const struct cl_engine *engine, const struct cl_limits *limits, unsigned int options, const struct cfgstruct *copt, int timeout)
117 117
 {
118 118
 	char buff[1025];
119
-	int bread, opt;
119
+	int bread;
120 120
 
121 121
     bread = readsock(desc, buff, sizeof(buff)-1, '\n', timeout, 0, 1);
122 122
     if(bread == -2) /* timeout */
... ...
@@ -583,7 +583,7 @@ static int cli_html_normalise(int fd, m_area_t *m_area, const char *dirname, tag
583 583
 {
584 584
 	int fd_tmp, tag_length, tag_arg_length, binary;
585 585
 	int retval=FALSE, escape, value = 0, hex, tag_val_length=0;
586
-	int look_for_screnc=FALSE, in_screnc=FALSE,in_script=FALSE, text_space_written=FALSE, spacew=FALSE;
586
+	int look_for_screnc=FALSE, in_screnc=FALSE,in_script=FALSE, text_space_written=FALSE;
587 587
 	FILE *stream_in = NULL;
588 588
 	html_state state=HTML_NORM, next_state=HTML_BAD_STATE, saved_next_state=HTML_BAD_STATE;
589 589
 	char filename[1024], tag[HTML_STR_LENGTH+1], tag_arg[HTML_STR_LENGTH+1];
... ...
@@ -601,7 +601,6 @@ static int cli_html_normalise(int fd, m_area_t *m_area, const char *dirname, tag
601 601
 	unsigned char* in_form_action = NULL;/* the action URL of the current <form> tag, if any*/
602 602
 
603 603
 	struct entity_conv conv;
604
-	int rc;
605 604
 	unsigned char entity_val[HTML_STR_LENGTH+1];
606 605
 	size_t entity_val_length = 0;
607 606
 	const int dconf_entconv = dconf && dconf->phishing&PHISHING_CONF_ENTCONV;
... ...
@@ -1720,7 +1719,7 @@ int html_normalise_fd(int fd, const char *dirname, tag_arguments_t *hrefs,const
1720 1720
 
1721 1721
 int html_screnc_decode(int fd, const char *dirname)
1722 1722
 {
1723
-	int fd_tmp, result, count, retval=FALSE;
1723
+	int fd_tmp, count, retval=FALSE;
1724 1724
 	unsigned char *line, tmpstr[6];
1725 1725
 	unsigned char *ptr, filename[1024];
1726 1726
 	FILE *stream_in;
... ...
@@ -4534,7 +4534,6 @@ my_r_gethostbyname(const char *hostname, struct hostent *hp, char *buf, size_t l
4534 4534
 		return h_errno;
4535 4535
 #else
4536 4536
 	/* Single thread the code e.g. VS2005 */
4537
-
4538 4537
 #ifdef  CL_THREAD_SAFE
4539 4538
 	pthread_mutex_lock(&hostent_mutex);
4540 4539
 #endif
... ...
@@ -860,7 +860,6 @@ static void free_regex(regex_t* p)
860 860
 
861 861
 int phishing_init(struct cl_engine* engine)
862 862
 {
863
-	char *url_regex, *realurl_regex;
864 863
 	struct phishcheck* pchk;
865 864
 	if(!engine->phishcheck) {
866 865
 		pchk = engine->phishcheck = cli_malloc(sizeof(struct phishcheck));
... ...
@@ -1252,7 +1251,7 @@ static int url_hash_match(const struct regex_matcher *rlist, const char *inurl,
1252 1252
 		else k = 1;
1253 1253
 		pp[k++] = 0;
1254 1254
 		while(k < COMPONENTS+2) {
1255
-			const char *p = strchr(path_begin + pp[k-1] + 1, '/');
1255
+			p = strchr(path_begin + pp[k-1] + 1, '/');
1256 1256
 			if(p && p > path_begin) {
1257 1257
 				pp[k++] = p - path_begin;
1258 1258
 			} else
... ...
@@ -56,7 +56,7 @@ enum { UPACK_399, UPACK_11_12, UPACK_0151477, UPACK_0297729 };
56 56
 int unupack(int upack, char *dest, uint32_t dsize, char *buff, uint32_t vma, uint32_t ep, uint32_t base, uint32_t va, int file)
57 57
 {
58 58
 	int j, searchval;
59
-	char *loc_esi, *loc_edi, *loc_ebx, *end_edi, *save_edi, *rpeb, *alvalue;
59
+	char *loc_esi, *loc_edi, *loc_ebx, *end_edi, *save_edi, *alvalue;
60 60
 	char *paddr, *pushed_esi, *save2;
61 61
 	uint32_t save1, save3, loc_ecx, count, shlsize, original_ep, ret, loc_ebx_u;
62 62
 	struct cli_exe_section section;
... ...
@@ -434,7 +434,7 @@ static int restart_model_rare(ppm_data_t *ppm_data)
434 434
 	
435 435
 static int start_model_rare(ppm_data_t *ppm_data, int max_order)
436 436
 {
437
-	int i, k, m, step, ret;
437
+	int i, k, m, step;
438 438
 	
439 439
 	ppm_data->esc_count = 1;
440 440
 	ppm_data->max_order = max_order;
... ...
@@ -630,8 +630,7 @@ static int update_model(ppm_data_t *ppm_data)
630 630
 	struct state_tag fs, *p;
631 631
 	struct ppm_context *pc, *successor;
632 632
 	unsigned int ns1, ns, cf, sf, s0;
633
-	int ret;
634
-	
633
+
635 634
 	rar_dbgmsg("in update_model\n");
636 635
 	fs = *ppm_data->found_state;
637 636
 	p = NULL;
... ...
@@ -379,7 +379,6 @@ int unrar_extract_next_prepare(unrar_state_t *state, const char *dirname)
379 379
 	char filename[1024];
380 380
 	int ofd;
381 381
 	unrar_metadata_t *new_metadata;
382
-	unpack_data_t *unpack_data;
383 382
 
384 383
 
385 384
     state->file_header = read_block(state->fd, FILE_HEAD);
... ...
@@ -62,9 +62,11 @@ int r_gethostbyname(const char *hostname, struct hostent *hp, char *buf, size_t
62 62
 {
63 63
 	struct hostent *hp2;
64 64
 	int ret = -1;
65
+#if !defined(HAVE_GETHOSTBYNAME_R_6) && !defined(HAVE_GETHOSTBYNAME_R_5) && !defined(HAVE_GETHOSTBYNAME_R_3)
65 66
 #ifdef  CL_THREAD_SAFE
66 67
 	static pthread_mutex_t hostent_mutex = PTHREAD_MUTEX_INITIALIZER;
67 68
 #endif
69
+#endif
68 70
 
69 71
 	if((hostname == NULL) || (hp == NULL))
70 72
 		return -1;
... ...
@@ -791,6 +791,9 @@ static void print_hex_buff (unsigned char *start, unsigned char *end, int hex_ou
791 791
     printf ("]\n");
792 792
 }
793 793
 
794
+#ifdef __GNUC__
795
+static void wm_decode_macro (unsigned char *buff, uint32_t len, int hex_output) __attribute__((unused));
796
+#endif
794 797
 static void wm_decode_macro (unsigned char *buff, uint32_t len, int hex_output)
795 798
 {
796 799
     uint32_t i;