From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/36 Path: news.gmane.org!not-for-mail From: Igmar Palsenberg Newsgroups: gmane.linux.lib.musl.general Subject: Cleanup patches Date: Mon, 6 Jun 2011 17:40:35 +0200 Message-ID: <60BABB60-7D9B-4D66-8645-4CDFD07E1338@palsenberg.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/mixed; boundary=Apple-Mail-4-502637404 X-Trace: dough.gmane.org 1307375901 31138 80.91.229.12 (6 Jun 2011 15:58:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2011 15:58:21 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-119-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jun 06 17:58:17 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 1QTcC1-0001Gv-0J for gllmg-musl@lo.gmane.org; Mon, 06 Jun 2011 17:58:17 +0200 Original-Received: (qmail 15601 invoked by uid 550); 6 Jun 2011 15:58:16 -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 3275 invoked from network); 6 Jun 2011 15:40:58 -0000 X-Mailer: Apple Mail (2.1084) Xref: news.gmane.org gmane.linux.lib.musl.general:36 Archived-At: --Apple-Mail-4-502637404 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, See attached patches for a clang cleanup. No functional changes, just = making sure it compiles without warnings. Regards, Igmar --Apple-Mail-4-502637404 Content-Disposition: attachment; filename=0001-s-target-cleanup.patch Content-Type: application/octet-stream; name="0001-s-target-cleanup.patch" Content-Transfer-Encoding: quoted-printable =46rom=203fdb12ef8182b8bbe1f3113a55f3bfad4288f432=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Igmar=20Palsenberg=20=0A= Date:=20Mon,=206=20Jun=202011=2016:25:14=20+0200=0ASubject:=20[PATCH=20= 1/6]=20Remove=20CFLAGS=20and=20INC=20from=20the=20.s=20target.=20Not=20= needed,=0A=20generates=20warnings=20with=20clang.=0A=0A---=0A=20Makefile=20= |=20=20=20=202=20+-=0A=201=20files=20changed,=201=20insertions(+),=201=20= deletions(-)=0A=0Adiff=20--git=20a/Makefile=20b/Makefile=0Aindex=20= 5c17642..64003f1=20100644=0A---=20a/Makefile=0A+++=20b/Makefile=0A@@=20= -63,7=20+63,7=20@@=20include/bits/alltypes.h:=20= include/bits/alltypes.h.sh=0A=20=09sh=20$<=20>=20$@=0A=20=0A=20%.o:=20= $(ARCH)/%.s=0A-=09$(CC)=20$(CFLAGS)=20$(INC)=20-c=20-o=20$@=20$<=0A+=09= $(CC)=20-c=20-o=20$@=20$<=0A=20=0A=20%.o:=20%.c=20$(GENH)=0A=20=09$(CC)=20= $(CFLAGS)=20$(INC)=20-c=20-o=20$@=20$<=0A--=20=0A1.7.5.2=0A=0A= --Apple-Mail-4-502637404 Content-Disposition: attachment; filename=0002-Use-flexible-array-member.patch Content-Type: application/octet-stream; name="0002-Use-flexible-array-member.patch" Content-Transfer-Encoding: quoted-printable =46rom=205bd75381f4c002b0381adfeb587be735fc11367c=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Igmar=20Palsenberg=20=0A= Date:=20Mon,=206=20Jun=202011=2016:27:16=20+0200=0ASubject:=20[PATCH=20= 2/6]=20-=20Use=20flexible=20array=20member=20instead=20of=20[1].=0A=0A= ---=0A=20include/dirent.h=20=20=20=20|=20=20=20=202=20+-=0A=20= src/malloc/malloc.c=20|=20=20=20=202=20+-=0A=202=20files=20changed,=202=20= insertions(+),=202=20deletions(-)=0A=0Adiff=20--git=20a/include/dirent.h=20= b/include/dirent.h=0Aindex=20ca000bd..5496be3=20100644=0A---=20= a/include/dirent.h=0A+++=20b/include/dirent.h=0A@@=20-18,7=20+18,7=20@@=20= struct=20dirent=0A=20=09off_t=20d_off;=0A=20=09unsigned=20short=20= d_reclen;=0A=20=09unsigned=20char=20d_type;=0A-=09char=20d_name[1];=0A+=09= char=20d_name[];=0A=20};=0A=20=0A=20#define=20d_fileno=20d_ino=0Adiff=20= --git=20a/src/malloc/malloc.c=20b/src/malloc/malloc.c=0Aindex=20= bc8382e..79db0fa=20100644=0A---=20a/src/malloc/malloc.c=0A+++=20= b/src/malloc/malloc.c=0A@@=20-16,9=20+16,9=20@@=20void=20*__mremap(void=20= *,=20size_t,=20size_t,=20int,=20...);=0A=20int=20__madvise(void=20*,=20= size_t,=20int);=0A=20=0A=20struct=20chunk=20{=0A-=09size_t=20data[1];=0A=20= =09struct=20chunk=20*next;=0A=20=09struct=20chunk=20*prev;=0A+=09size_t=20= data[];=0A=20};=0A=20=0A=20struct=20bin=20{=0A--=20=0A1.7.5.2=0A=0A= --Apple-Mail-4-502637404 Content-Disposition: attachment; filename=0003-Use-raise.patch Content-Type: application/octet-stream; name="0003-Use-raise.patch" Content-Transfer-Encoding: quoted-printable =46rom=20f7d562be536bca329065acdde5a3fcfc0d123d07=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Igmar=20Palsenberg=20=0A= Date:=20Mon,=206=20Jun=202011=2016:53:13=20+0200=0ASubject:=20[PATCH=20= 3/6]=20Use=20raise(SIGSEGV)=20instead=20of=20the=20nasty=20NULL=20= pointer=0A=20dereference=0A=0A---=0A=20src/malloc/malloc.c=20=20|=20=20=20= =206=20++++--=0A=20src/time/__asctime.c=20|=20=20=20=203=20++-=0A=202=20= files=20changed,=206=20insertions(+),=203=20deletions(-)=0A=0Adiff=20= --git=20a/src/malloc/malloc.c=20b/src/malloc/malloc.c=0Aindex=20= 79db0fa..fda7004=20100644=0A---=20a/src/malloc/malloc.c=0A+++=20= b/src/malloc/malloc.c=0A@@=20-395,7=20+395,8=20@@=20void=20*realloc(void=20= *p,=20size_t=20n)=0A=20=09=09size_t=20oldlen=20=3D=20n0=20+=20extra;=0A=20= =09=09size_t=20newlen=20=3D=20n=20+=20extra;=0A=20=09=09/*=20Crash=20on=20= realloc=20of=20freed=20chunk=20*/=0A-=09=09if=20((uintptr_t)base=20<=20= mal.brk)=20*(char=20*)0=3D0;=0A+=09=09if=20((uintptr_t)base=20<=20= mal.brk)=0A+=09=09=09raise(SIGSEGV);=0A=20=09=09if=20(newlen=20<=20= PAGE_SIZE=20&&=20(new=20=3D=20malloc(n)))=20{=0A=20=09=09=09memcpy(new,=20= p,=20n-OVERHEAD);=0A=20=09=09=09free(p);=0A@@=20-458,7=20+459,8=20@@=20= void=20free(void=20*p)=0A=20=09=09char=20*base=20=3D=20(char=20*)self=20= -=20extra;=0A=20=09=09size_t=20len=20=3D=20CHUNK_SIZE(self)=20+=20extra;=0A= =20=09=09/*=20Crash=20on=20double=20free=20*/=0A-=09=09if=20= ((uintptr_t)base=20<=20mal.brk)=20*(char=20*)0=3D0;=0A+=09=09if=20= ((uintptr_t)base=20<=20mal.brk)=0A+=09=09=09raise(SIGSEGV);=0A=20=09=09= __munmap(base,=20len);=0A=20=09=09return;=0A=20=09}=0Adiff=20--git=20= a/src/time/__asctime.c=20b/src/time/__asctime.c=0Aindex=20= 1853580..fc4d61d=20100644=0A---=20a/src/time/__asctime.c=0A+++=20= b/src/time/__asctime.c=0A@@=20-1,5=20+1,6=20@@=0A=20#include=20=0A= =20#include=20=0A+#include=20=0A=20#include=20= =0A=20=0A=20const=20char=20*__langinfo(nl_item);=0A@@=20= -21,7=20+22,7=20@@=20char=20*__asctime(const=20struct=20tm=20*tm,=20char=20= *buf)=0A=20=09=09=20*=20application=20developers=20that=20they=20may=20= not=20be=20so=20lucky=0A=20=09=09=20*=20on=20other=20implementations=20= (e.g.=20stack=20smashing..).=0A=20=09=09=20*/=0A-=09=09*(int*)0=20=3D=20= 0;=0A+=09=09raise(SIGSEGV);=0A=20=09}=0A=20=09return=20buf;=0A=20}=0A--=20= =0A1.7.5.2=0A=0A= --Apple-Mail-4-502637404 Content-Disposition: attachment; filename=0004-Dead-code-elimination.patch Content-Type: application/octet-stream; name="0004-Dead-code-elimination.patch" Content-Transfer-Encoding: quoted-printable =46rom=207e37b1c58d28fc0fb2de5f6b29903bcdba8da250=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Igmar=20Palsenberg=20=0A= Date:=20Mon,=206=20Jun=202011=2016:57:02=20+0200=0ASubject:=20[PATCH=20= 4/6]=20Dead=20code=20elimination=0A=0A---=0A=20src/regex/regcomp.c=20=20=20= |=20=20=20=203=20+--=0A=20src/regex/regexec.c=20=20=20|=20=20=20=204=20= ----=0A=20src/stdio/vfwprintf.c=20|=20=20=20=203=20+--=0A=203=20files=20= changed,=202=20insertions(+),=208=20deletions(-)=0A=0Adiff=20--git=20= a/src/regex/regcomp.c=20b/src/regex/regcomp.c=0Aindex=203307942..cb7e272=20= 100644=0A---=20a/src/regex/regcomp.c=0A+++=20b/src/regex/regcomp.c=0A@@=20= -1845,13=20+1845,12=20@@=20tre_add_tags(tre_mem_t=20mem,=20tre_stack_t=20= *stack,=20tre_ast_node_t=20*tree,=0A=20=0A=20=09case=20= ADDTAGS_AFTER_ITERATION:=0A=20=09=20=20{=0A-=09=20=20=20=20int=20= enter_tag;=0A=20=09=20=20=20=20node=20=3D=20tre_stack_pop(stack);=0A=20=09= =20=20=20=20if=20(first_pass)=0A=20=09=09node->num_tags=20=3D=20= ((tre_iteration_t=20*)node->obj)->arg->num_tags=0A=20=09=09=20=20+=20= (int)tre_stack_pop(stack);=0A=20=09=20=20=20=20else=0A-=09=09enter_tag=20= =3D=20(int)tre_stack_pop(stack);=0A+=09=09(int)tre_stack_pop(stack);=0A=20= =0A=20=09=20=20=20=20DPRINT(("After=20iteration\n"));=0A=20=09=20=20=20=20= direction=20=3D=20TRE_TAG_MAXIMIZE;=0Adiff=20--git=20= a/src/regex/regexec.c=20b/src/regex/regexec.c=0Aindex=20f7aef50..5aa52d9=20= 100644=0A---=20a/src/regex/regexec.c=0A+++=20b/src/regex/regexec.c=0A@@=20= -180,7=20+180,6=20@@=20tre_tnfa_run_parallel(const=20tre_tnfa_t=20*tnfa,=20= const=20void=20*string,=20int=20len,=0A=20=20=20int=20num_tags,=20i;=0A=20= =0A=20=20=20int=20match_eo=20=3D=20-1;=09=20=20=20/*=20end=20offset=20of=20= match=20(-1=20if=20no=20match=20found=20yet)=20*/=0A-=20=20int=20= new_match=20=3D=200;=0A=20=20=20int=20*tmp_tags=20=3D=20NULL;=0A=20=20=20= int=20*tmp_iptr;=0A=20=0A@@=20-287,7=20+286,6=20@@=20= tre_tnfa_run_parallel(const=20tre_tnfa_t=20*tnfa,=20const=20void=20= *string,=20int=20len,=0A=20=09=09=20=20=20=20{=0A=20=09=09=20=20=20=20=20= =20DPRINT(("=09=20found=20empty=20match\n"));=0A=20=09=09=20=20=20=20=20=20= match_eo=20=3D=20pos;=0A-=09=09=20=20=20=20=20=20new_match=20=3D=201;=0A=20= =09=09=20=20=20=20=20=20for=20(i=20=3D=200;=20i=20<=20num_tags;=20i++)=0A= =20=09=09=09match_tags[i]=20=3D=20reach_next_i->tags[i];=0A=20=09=09=20=20= =20=20}=0A@@=20-387,7=20+385,6=20@@=20tre_tnfa_run_parallel(const=20= tre_tnfa_t=20*tnfa,=20const=20void=20*string,=20int=20len,=0A=20=09=09=09= {=0A=20=09=09=09=20=20DPRINT(("=20=20found=20match=20%p\n",=20= trans_i->state));=0A=20=09=09=09=20=20match_eo=20=3D=20pos;=0A-=09=09=09=20= =20new_match=20=3D=201;=0A=20=09=09=09=20=20for=20(i=20=3D=200;=20i=20<=20= num_tags;=20i++)=0A=20=09=09=09=20=20=20=20match_tags[i]=20=3D=20= reach_next_i->tags[i];=0A=20=09=09=09}=0A@@=20-411,7=20+408,6=20@@=20= tre_tnfa_run_parallel(const=20tre_tnfa_t=20*tnfa,=20const=20void=20= *string,=20int=20len,=0A=20=09=09=09=20=20=20=20{=0A=20=09=09=09=20=20=20= =20=20=20DPRINT(("=09=20found=20better=20match\n"));=0A=20=09=09=09=20=20= =20=20=20=20match_eo=20=3D=20pos;=0A-=09=09=09=20=20=20=20=20=20= new_match=20=3D=201;=0A=20=09=09=09=20=20=20=20=20=20for=20(i=20=3D=200;=20= i=20<=20num_tags;=20i++)=0A=20=09=09=09=09match_tags[i]=20=3D=20= tmp_tags[i];=0A=20=09=09=09=20=20=20=20}=0Adiff=20--git=20= a/src/stdio/vfwprintf.c=20b/src/stdio/vfwprintf.c=0Aindex=20= 42ce304..064adb9=20100644=0A---=20a/src/stdio/vfwprintf.c=0A+++=20= b/src/stdio/vfwprintf.c=0A@@=20-160,7=20+160,7=20@@=20static=20const=20= char=20sizeprefix['y'-'a']=20=3D=20{=0A=20=0A=20static=20int=20= wprintf_core(FILE=20*f,=20const=20wchar_t=20*fmt,=20va_list=20*ap,=20= union=20arg=20*nl_arg,=20int=20*nl_type)=0A=20{=0A-=09wchar_t=20*a,=20= *z,=20*s=3D(wchar_t=20*)fmt,=20*s0;=0A+=09wchar_t=20*a,=20*z,=20= *s=3D(wchar_t=20*)fmt;=0A=20=09unsigned=20l10n=3D0,=20litpct,=20fl;=0A=20= =09int=20w,=20p;=0A=20=09union=20arg=20arg;=0A@@=20-235,7=20+235,6=20@@=20= static=20int=20wprintf_core(FILE=20*f,=20const=20wchar_t=20*fmt,=20= va_list=20*ap,=20union=20arg=20*nl_=0A=20=09=09}=20else=20p=20=3D=20-1;=0A= =20=0A=20=09=09/*=20Format=20specifier=20state=20machine=20*/=0A-=09=09= s0=3Ds;=0A=20=09=09st=3D0;=0A=20=09=09do=20{=0A=20=09=09=09if=20= (OOB(*s))=20return=20-1;=0A--=20=0A1.7.5.2=0A=0A= --Apple-Mail-4-502637404 Content-Disposition: attachment; filename=0005-Use-proper-cast-to-wchar_t.patch Content-Type: application/octet-stream; name="0005-Use-proper-cast-to-wchar_t.patch" Content-Transfer-Encoding: quoted-printable =46rom=209ae03979b02f7ba9f0016ebb2ec3f31094f48fa0=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Igmar=20Palsenberg=20=0A= Date:=20Mon,=206=20Jun=202011=2017:01:44=20+0200=0ASubject:=20[PATCH=20= 5/6]=20Use=20proper=20cast=20to=20wchar_t=20*=0A=0A---=0A=20= src/stdio/vfwprintf.c=20|=20=20=20=202=20+-=0A=201=20files=20changed,=20= 1=20insertions(+),=201=20deletions(-)=0A=0Adiff=20--git=20= a/src/stdio/vfwprintf.c=20b/src/stdio/vfwprintf.c=0Aindex=20= 064adb9..6e7bb5d=20100644=0A---=20a/src/stdio/vfwprintf.c=0A+++=20= b/src/stdio/vfwprintf.c=0A@@=20-185,7=20+185,7=20@@=20static=20int=20= wprintf_core(FILE=20*f,=20const=20wchar_t=20*fmt,=20va_list=20*ap,=20= union=20arg=20*nl_=0A=20=0A=20=09=09/*=20Handle=20literal=20text=20and=20= %%=20format=20specifiers=20*/=0A=20=09=09for=20(a=3Ds;=20*s=20&&=20= *s!=3D'%';=20s++);=0A-=09=09litpct=20=3D=20wcsspn(s,=20L"%")/2;=20/*=20= Optimize=20%%%%=20runs=20*/=0A+=09=09litpct=20=3D=20wcsspn(s,=20(wchar_t=20= *)L"%")/2;=20/*=20Optimize=20%%%%=20runs=20*/=0A=20=09=09z=20=3D=20= s+litpct;=0A=20=09=09s=20+=3D=202*litpct;=0A=20=09=09l=20=3D=20z-a;=0A--=20= =0A1.7.5.2=0A=0A= --Apple-Mail-4-502637404 Content-Disposition: attachment; filename=0006-weak-alias-fix.patch Content-Type: application/octet-stream; name="0006-weak-alias-fix.patch" Content-Transfer-Encoding: quoted-printable =46rom=20f98e49f1c9cc282161f19ec517dd16edc20170fc=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Igmar=20Palsenberg=20=0A= Date:=20Mon,=206=20Jun=202011=2017:02:30=20+0200=0ASubject:=20[PATCH=20= 6/6]=20You=20can't=20weak=20alias=20a=20static=20function=20or=20= variable=0A=0A---=0A=20src/thread/cancel_dummy.c=20=20=20|=20=20=20=203=20= ++-=0A=20src/thread/pthread_create.c=20|=20=20=20=202=20+-=0A=20= src/thread/pthread_self.c=20=20=20|=20=20=20=202=20+-=0A=20= src/time/timer_create.c=20=20=20=20=20|=20=20=20=202=20+-=0A=204=20files=20= changed,=205=20insertions(+),=204=20deletions(-)=0A=0Adiff=20--git=20= a/src/thread/cancel_dummy.c=20b/src/thread/cancel_dummy.c=0Aindex=20= a39117e..dac340d=20100644=0A---=20a/src/thread/cancel_dummy.c=0A+++=20= b/src/thread/cancel_dummy.c=0A@@=20-1,6=20+1,7=20@@=0A=20#include=20= "pthread_impl.h"=0A+#include=20"syscall.h"=0A=20=0A-static=20long=20= sccp(long=20nr,=20long=20u,=20long=20v,=20long=20w,=20long=20x,=20long=20= y,=20long=20z)=0A+long=20sccp(long=20nr,=20long=20u,=20long=20v,=20long=20= w,=20long=20x,=20long=20y,=20long=20z)=0A=20{=0A=20=09return=20= (__syscall)(nr,=20u,=20v,=20w,=20x,=20y,=20z);=0A=20}=0Adiff=20--git=20= a/src/thread/pthread_create.c=20b/src/thread/pthread_create.c=0Aindex=20= a645f9f..bb13e8f=20100644=0A---=20a/src/thread/pthread_create.c=0A+++=20= b/src/thread/pthread_create.c=0A@@=20-1,6=20+1,6=20@@=0A=20#include=20= "pthread_impl.h"=0A=20=0A-static=20void=20dummy_0()=0A+void=20dummy_0()=0A= =20{=0A=20}=0A=20weak_alias(dummy_0,=20__rsyscall_lock);=0Adiff=20--git=20= a/src/thread/pthread_self.c=20b/src/thread/pthread_self.c=0Aindex=20= 55d20c9..4ec5e5c=20100644=0A---=20a/src/thread/pthread_self.c=0A+++=20= b/src/thread/pthread_self.c=0A@@=20-3,7=20+3,7=20@@=0A=20static=20struct=20= pthread=20main_thread;=0A=20=0A=20/*=20pthread_key_create.c=20overrides=20= this=20*/=0A-static=20const=20void=20*dummy[1]=20=3D=20{=200=20};=0A= +const=20void=20*dummy[1]=20=3D=20{=200=20};=0A=20weak_alias(dummy,=20= __pthread_tsd_main);=0A=20=0A=20static=20int=20*errno_location()=0Adiff=20= --git=20a/src/time/timer_create.c=20b/src/time/timer_create.c=0Aindex=20= 1561d79..795fab8=20100644=0A---=20a/src/time/timer_create.c=0A+++=20= b/src/time/timer_create.c=0A@@=20-13,7=20+13,7=20@@=20struct=20= start_args=20{=0A=20=09struct=20sigevent=20*sev;=0A=20};=0A=20=0A-static=20= void=20dummy_1(pthread_t=20self)=0A+void=20dummy_1(pthread_t=20self)=0A=20= {=0A=20}=0A=20weak_alias(dummy_1,=20__pthread_tsd_run_dtors);=0A--=20=0A= 1.7.5.2=0A=0A= --Apple-Mail-4-502637404--