From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/38 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Cleanup patches Date: Mon, 6 Jun 2011 19:13:18 +0200 Message-ID: <20110606171317.GN6142@port70.net> References: <60BABB60-7D9B-4D66-8645-4CDFD07E1338@palsenberg.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1307380428 30970 80.91.229.12 (6 Jun 2011 17:13:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2011 17:13:48 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-121-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jun 06 19:13:42 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QTdMy-0002dr-MJ for gllmg-musl@lo.gmane.org; Mon, 06 Jun 2011 19:13:40 +0200 Original-Received: (qmail 1671 invoked by uid 550); 6 Jun 2011 17:13:40 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 1660 invoked from network); 6 Jun 2011 17:13:40 -0000 Content-Disposition: inline In-Reply-To: <60BABB60-7D9B-4D66-8645-4CDFD07E1338@palsenberg.com> User-Agent: Mutt/1.5.20 (2009-06-14) Xref: news.gmane.org gmane.linux.lib.musl.general:38 Archived-At: * Igmar Palsenberg [2011-06-06 17:40:35 +0200]: > See attached patches for a clang cleanup. No functional changes, just making sure it compiles without warnings. > --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ include/bits/alltypes.h: include/bits/alltypes.h.sh sh $< > $@ %.o: $(ARCH)/%.s - $(CC) $(CFLAGS) $(INC) -c -o $@ $< + $(CC) -c -o $@ $< this could be $(AS) -o $@ $< --- a/src/malloc/malloc.c +++ b/src/malloc/malloc.c @@ -16,9 +16,9 @@ void *__mremap(void *, size_t, size_t, int, ...); int __madvise(void *, size_t, int); struct chunk { - size_t data[1]; struct chunk *next; struct chunk *prev; + size_t data[]; }; this does not seem to be correct c->data[-1] now means something different --- a/src/regex/regcomp.c +++ b/src/regex/regcomp.c @@ -1845,13 +1845,12 @@ tre_add_tags(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *tree, case ADDTAGS_AFTER_ITERATION: { - int enter_tag; node = tre_stack_pop(stack); if (first_pass) node->num_tags = ((tre_iteration_t *)node->obj)->arg->num_tags + (int)tre_stack_pop(stack); else - enter_tag = (int)tre_stack_pop(stack); + (int)tre_stack_pop(stack); the (int) cast can go as well.. --- a/src/stdio/vfwprintf.c +++ b/src/stdio/vfwprintf.c @@ -185,7 +185,7 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_ /* Handle literal text and %% format specifiers */ for (a=s; *s && *s!='%'; s++); - litpct = wcsspn(s, L"%")/2; /* Optimize %%%% runs */ + litpct = wcsspn(s, (wchar_t *)L"%")/2; /* Optimize %%%% runs */ z = s+litpct; s += 2*litpct; l = z-a; this seems wrong L"" is already a wchar_t string literal and wcsspn arguments must be const qualified Subject: [PATCH 6/6] You can't weak alias a static function or variable you can, at least gcc/ld allows it, it just does not make much sense but the solution is bad, polluting the public namespace is not ok