From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 6 10:47:13 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 8A7EE106566C; Fri, 6 Apr 2012 10:47:13 +0000 (UTC) Date: Fri, 6 Apr 2012 10:47:13 +0000 From: Alexander Best To: freebsd-hackers@freebsd.org Message-ID: <20120406104713.GA12282@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline Subject: possible signedness issue in aic7xxx X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2012 10:47:13 -0000 --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline hi there, i noticed the following worning from clang when building HEAD: ===> sys/modules/aic7xxx/aicasm (obj,build-tools) /usr/github-freebsd-head/sys/modules/aic7xxx/aicasm/../../../dev/aic7xxx/aicasm/aicasm.c:604:5: warning: passing 'int *' to parameter of type 'unsigned int *' converts between pointers to integer types with different sign [-Wpointer-sign] &skip_addr, func_values) == 0) { ^~~~~~~~~~ /usr/github-freebsd-head/sys/modules/aic7xxx/aicasm/../../../dev/aic7xxx/aicasm/aicasm.c:83:24: note: passing argument to parameter 'skip_addr' here unsigned int *skip_addr, int *func_vals); ^ 1 warning generated. will the attached patch take care of the problem? cheers. alex --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="aicasm.c.patch" diff --git a/sys/dev/aic7xxx/aicasm/aicasm.c b/sys/dev/aic7xxx/aicasm/aicasm.c index 1b88ba0..08a540f 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm.c +++ b/sys/dev/aic7xxx/aicasm/aicasm.c @@ -353,7 +353,7 @@ output_code(void) patch_t *cur_patch; critical_section_t *cs; symbol_node_t *cur_node; - int instrcount; + unsigned int instrcount; instrcount = 0; fprintf(ofile, @@ -455,7 +455,7 @@ output_code(void) "static const int num_critical_sections = sizeof(critical_sections)\n" " / sizeof(*critical_sections);\n"); - fprintf(stderr, "%s: %d instructions used\n", appname, instrcount); + fprintf(stderr, "%s: %u instructions used\n", appname, instrcount); } static void @@ -526,11 +526,11 @@ output_listing(char *ifilename) patch_t *cur_patch; symbol_node_t *cur_func; int *func_values; - int instrcount; + unsigned int instrcount; int instrptr; unsigned int line; int func_count; - int skip_addr; + unsigned int skip_addr; instrcount = 0; instrptr = 0; --ikeVEW9yuYc//A+q--