From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/44 Path: news.gmane.org!not-for-mail From: Igmar Palsenberg Newsgroups: gmane.linux.lib.musl.general Subject: Re: Cleanup patches Date: Tue, 7 Jun 2011 10:44:44 +0200 Message-ID: <495DC2BF-B857-4BD5-95B1-753C0DB0DE6A@palsenberg.com> References: <60BABB60-7D9B-4D66-8645-4CDFD07E1338@palsenberg.com> <20110606171317.GN6142@port70.net> <20110606173210.GD191@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1307436315 3148 80.91.229.12 (7 Jun 2011 08:45:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 7 Jun 2011 08:45:15 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-127-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jun 07 10:45:12 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 1QTruO-0003Wk-DK for gllmg-musl@lo.gmane.org; Tue, 07 Jun 2011 10:45:08 +0200 Original-Received: (qmail 19641 invoked by uid 550); 7 Jun 2011 08:45:07 -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 19631 invoked from network); 7 Jun 2011 08:45:07 -0000 In-Reply-To: <20110606173210.GD191@brightrain.aerifal.cx> X-Mailer: Apple Mail (2.1084) Xref: news.gmane.org gmane.linux.lib.musl.general:44 Archived-At: > On Mon, Jun 06, 2011 at 07:13:18PM +0200, Szabolcs Nagy wrote: >> %.o: $(ARCH)/%.s >> - $(CC) $(CFLAGS) $(INC) -c -o $@ $< >> + $(CC) -c -o $@ $< >>=20 >> this could be $(AS) -o $@ $< >=20 > Is there a reason this is necessary or beneficial? Clang complains about them. You could ignore them if you want : Werror = doesn't seem to be affected by this. It might use an internal assembler, = I'm not that familiar with clang internals. Looking at the flags, they = don't seem to matter when it comes to assembling .s files. >> struct chunk { >> - size_t data[1]; >> struct chunk *next; >> struct chunk *prev; >> + size_t data[]; >> }; >>=20 >> this does not seem to be correct >> c->data[-1] now means something different >=20 > This is definitely wrong. data[1] is not a flexible array member. If > this is causing serious problems I could update everything to use > structure pointers offset back by 1 word, and then use size_t > prev_size, size; or similar. But if I remember correctly that was > making the code a good big uglier when I first tried it. I need to check. I get out of bounds warning with this code. I'll check = and update this code. >> - int enter_tag; >> node =3D tre_stack_pop(stack); >> if (first_pass) >> node->num_tags =3D ((tre_iteration_t = *)node->obj)->arg->num_tags >> + (int)tre_stack_pop(stack); >> else >> - enter_tag =3D (int)tre_stack_pop(stack); >> + (int)tre_stack_pop(stack); >>=20 >> the (int) cast can go as well.. >=20 > Indeed. Short of bugs though my intent is not to touch the TRE code, > since I plan to replace it anyway. >=20 >> /* Handle literal text and %% format specifiers */ >> for (a=3Ds; *s && *s!=3D'%'; s++); >> - litpct =3D wcsspn(s, L"%")/2; /* Optimize %%%% runs */ >> + litpct =3D wcsspn(s, (wchar_t *)L"%")/2; /* Optimize = %%%% runs */ >> z =3D s+litpct; >> s +=3D 2*litpct; >> l =3D z-a; >>=20 >> this seems wrong >> L"" is already a wchar_t string literal >=20 > I'm guessing this might be an issue of some 32-bit x86 compilers > disagreeing on whether wchar_t is "int" or "long". Traditionally it > was "long" which worked but was obviously stupid conceptually. I don't > know a good way to make musl's wchar.h adapt to what the compiler > wants though... The cast should be OK. In cases where it is correct (and the cast isn't = necessary), it is simply a NOOP. >> and wcsspn arguments must be const qualified >=20 > This is wrong. A non-const-qualified pointer always implicitly > converts to the const-qualified version. Indeed. >> Subject: [PATCH 6/6] You can't weak alias a static function or = variable >>=20 >> you can, at least gcc/ld allows it, it just does not make much sense >=20 > It does make sense to allow it, but I can see how it might be a little > more work for the compiler and the compiler might not want to support > it. >=20 >> but the solution is bad, polluting the public namespace is not ok >=20 > Indeed, the names will all need changing if this is necessary. There is a clang bug somewhere never the less : I get weird errors with = the macro, if I expand them directly in the code, I get a different = error. It should give the same error in both cases. I'll recheck this. = We might want to make those function hidden if that solves the problem. Igmar=