Re: [Tinycc-devel] tcc(1) from current [mob] doesn't recognize "const" attribute suffix
Oh - and sorry for the false classification of the attachment, this is the development version of this MUA, the released correctly states Content-Type: application/x-xz; charset=binary Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="redux-4-tcc.tar.xz" instead... ._. Ciao! --steffen ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] tcc(1) from current [mob] doesn't recognize "const" attribute suffix
Hallo, Michael Matzwrote: |On Wed, 16 Mar 2016, Steffen Nurpmeso wrote: |> So now with [mob] i face the problem that the "const" attribute |> results in "unknown struct/union/enum" error when used in the way |> i do, the uncommon suffix way, i.e., TYPE ATTRIBUTE PTR/REF NAME, |> as in "char const *myname", rather following Stroustrup i guess, |> defining the pointer to a constant type. So we have |> |> struct htmlflt_tag const *hf_ign_tag; |> |> In file included from accmacvar.c:40: |> nail.h:1598: error: unknown struct/union/enum | |Fixed in mob. Cool! Yes i can confirm! |> And then [mob] crashes with |> |> tcc: x86_64-gen.c:421: load: Assertion `((ft & VT_BTYPE) == VT_IN\ |> T) || ((ft & VT_BTYPE) == VT_LLONG) || ((ft & VT_BTYPE) == VT_PTR\ |> ) || ((ft & VT_BTYPE) == VT_ENUM) || ((ft & VT_BTYPE) == VT_FUNC)\ |> ' failed. |> /bin/sh: line 3: 20505 Aborted (core dumped) /hom\ |> e/sdaoden/usr/opt/tcc-mob/bin/tcc -Wall -Wextra -pedantic -b -g -\ |> I/home/sdaoden/usr/include -I/usr/local/include -I/usr/include -c tty.c | |Can't reproduce, please provide a testcase. I still can. I'll attach a heavily vaporised variant of the source in question, just run "make build" and it should happen -- you likely need to adjust some make variables on top of the mk.mk file, i've placed all in question at the top of this file. I still see ?0[sdaoden@wales redux-4-tcc]$ make build make[1]: Entering directory '/home/sdaoden/src/x/redux-4-tcc' Building.. . CC : /home/sdaoden/usr/opt/tcc-mob/bin/tcc . CFLAGS : -Wall -Wextra -pedantic -b -g . INCS: -I/home/sdaoden/usr/include -I/usr/local/include -I/usr/include . LIBS: -L/home/sdaoden/usr/lib -L/lib -L/usr/local/lib -L/usr/lib -lssl -lcrypto -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lcurses CC tty.c tcc: x86_64-gen.c:421: load: Assertion `((ft & VT_BTYPE) == VT_INT) || ((ft & VT_BTYPE) == VT_LLONG) || ((ft & VT_BTYPE) == VT_PTR) || ((ft & VT_BTYPE) == VT_ENUM) || ((ft & VT_BTYPE) == VT_FUNC)' failed. /bin/sh: line 3: 22918 Aborted (core dumped) /home/sdaoden/usr/opt/tcc-mob/bin/tcc -Wall -Wextra -pedantic -b -g -I/home/sdaoden/usr/include -I/usr/local/include -I/usr/include -c tty.c mk.mk:108: recipe for target 'tty.o' failed make[1]: *** [tty.o] Error 134 make[1]: Leaving directory '/home/sdaoden/src/x/redux-4-tcc' makefile:15: recipe for target 'build' failed make: *** [build] Error 2 ?2[sdaoden@wales redux-4-tcc]$ |Ciao, Ya.. Ciao! ^.^ --steffen redux-4-tcc.tar.xz Description: Binary data ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] tcc segfaults with complex struct initialization
Hi, On Wed, 16 Mar 2016, Assaf Gordon wrote: > $ git clone git://git.sv.gnu.org/coreutils.git && cd coreutils > $ ./bootstrap > $ ./configure --without-selinux CC=tcc > $ make V=1 Thanks for the report. > The offending code is a complex struct initialization, perhaps related to > recent discussion: > http://lists.nongnu.org/archive/html/tinycc-devel/2016-03/msg00042.html Not directly, it's more an extension in that our initializer parsing is heavily confused when some initializers are structs themself. I.e. the particular situation TCC stumbles upon is: struct S { long j;}; struct T { struct S t;}; struct S ts = {0}; void foo (void) { struct T its = { ts }; } So, the struct field its.t (of type struct S) is supposed to be initialized by the variable ts (also of type struct S). But our struct initializer parsing is confused, recursing eagerly into the LHS its.struct S, seeing member its.S.j of type long and then is surprised that the initializer for this long is of type 'struct S' (namely still the ts variable). I.e. either there's lock-step recursion missing (i.e. when going into its.S.j it should also go into ts.j), or detection of the situation that a struct initializer can also be a full struct itself. The latter seems more correct and easier, but the routines are a slight mess, so I'd need to think a bit about this (or wait for somebody else :) ). (I do think we had some other reports about this or similar situations as well). Ciao, Michael. ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] GAS symbols
Hi, On Thu, 24 Mar 2016, Vladimir Vissoultchev wrote: > Thanks for the effort! Apologies for not finding the time to rollback to > prev impl, had this on my todo, I swear :-)) No matter; had found a couple of minutes under my desk just now myself ;) Ciao, Michael. ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] GAS symbols
Thanks for the effort! Apologies for not finding the time to rollback to prev impl, had this on my todo, I swear :-)) cheers, -Original Message- From: tinycc-devel-bounces+wqweto=gmail@nongnu.org [mailto:tinycc-devel-bounces+wqweto=gmail@nongnu.org] On Behalf Of Michael Matz Sent: Thursday, March 24, 2016 5:04 PM To: tinycc-devel@nongnu.org Subject: Re: [Tinycc-devel] GAS symbols Hi, On Thu, 17 Mar 2016, Vladimir Vissoultchev wrote: > About the TOK_DOTS saga -- yes, the original code was using PEEKC > canonically, I'm not sure about the unget hack it implemented though. It is, as the comment written next to it explained. I fixed the parsing of ..\n. now in mob with a testcase. Ciao, Michael. ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] tcc(1) from current [mob] doesn't recognize "const" attribute suffix
Hi, On Wed, 16 Mar 2016, Steffen Nurpmeso wrote: > So now with [mob] i face the problem that the "const" attribute > results in "unknown struct/union/enum" error when used in the way > i do, the uncommon suffix way, i.e., TYPE ATTRIBUTE PTR/REF NAME, > as in "char const *myname", rather following Stroustrup i guess, > defining the pointer to a constant type. So we have > > struct htmlflt_tag const *hf_ign_tag; > > In file included from accmacvar.c:40: > nail.h:1598: error: unknown struct/union/enum Fixed in mob. > struct htmlflt_tag; > ... > struct htmlflt_tag const *hf_ign_tag; > > And then [mob] crashes with > > tcc: x86_64-gen.c:421: load: Assertion `((ft & VT_BTYPE) == VT_INT) || ((ft > & VT_BTYPE) == VT_LLONG) || ((ft & VT_BTYPE) == VT_PTR) || ((ft & VT_BTYPE) > == VT_ENUM) || ((ft & VT_BTYPE) == VT_FUNC)' failed. > /bin/sh: line 3: 20505 Aborted (core dumped) > /home/sdaoden/usr/opt/tcc-mob/bin/tcc -Wall -Wextra -pedantic -b -g > -I/home/sdaoden/usr/include -I/usr/local/include -I/usr/include -c tty.c Can't reproduce, please provide a testcase. Ciao, Michael. ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel
Re: [Tinycc-devel] GAS symbols
Hi, On Thu, 17 Mar 2016, Vladimir Vissoultchev wrote: > About the TOK_DOTS saga -- yes, the original code was using PEEKC > canonically, I'm not sure about the unget hack it implemented though. It is, as the comment written next to it explained. I fixed the parsing of ..\n. now in mob with a testcase. Ciao, Michael. ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel