[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] segmentation fault when linking with newt
From: |
Andrés Ramírez |
Subject: |
Re: [Tinycc-devel] segmentation fault when linking with newt |
Date: |
Mon, 06 Jul 2015 23:33:53 -0500 |
Hi Christophe.
You are right about the last NULL parameter, but just it happens that
gcc does not seg fault, with the same code without the NULL parameter.
Regards
ps: Feel free to leave it as it is.
At Tue, 7 Jul 2015 06:26:53 +0200,
Christophe Staïesse wrote:
>
> Well. Bad copy-pasting. I meant newtFormAddComponents() instead of
> newtOpenWindow() of course.
>
> Christophe.
>
> On Tue, 7 Jul 2015 06:23:37 +0200
> Christophe Staïesse <address@hidden> wrote:
>
> > Hi,
> >
> > This is due to a bug in your program: the last component in the call of
> > newtOpenWindow() should be followed by NULL.
> >
> > Christophe.
> >
> > On Mon, 06 Jul 2015 10:20:46 -0500
> > address@hidden (Andrés Ramírez) wrote:
> >
> > > Hi guys.
> > >
> > > I am trying this simple example (which fails on the line with
> > > newtFormAddComponents):
> > >
> > > #include <newt.h>
> > > #include <stdio.h>
> > > #include <stdlib.h>
> > > /* tcc -g -o button.bin button.c -lnewt */
> > > /* gdb --annotate=3 -i=mi --args button.bin */
> > > void main(void) {
> > > int left, top, width, height;
> > >
> > > newtComponent form, b1, b2, b3, b4, bback;
> > > newtInit();
> > > newtCls();
> > >
> > > left = 10;
> > > top = 5;
> > > width = 40;
> > > height = 10;
> > > newtOpenWindow(left, top, width, height, "Shell Buttons");
> > >
> > > b1 = newtCompactButton(left, 1, "Uno");
> > > b2 = newtCompactButton(left, 2, "Dos");
> > > b3 = newtCompactButton(left, 3, "Tres");
> > > b4 = newtCompactButton(left, 4, "Cuatro");
> > > bback = newtButton(left, 6, "Back");
> > > form = newtForm(NULL, NULL, 0);
> > > /* newtFormAddComponents fails with tcc */
> > > newtFormAddComponents(form, b1, b2, b3, b4, bback);
> > >
> > > newtRunForm(form);
> > >
> > > newtFormDestroy(form);
> > > newtFinished();
> > > }
> > >
> > >
> > > Let me know. If You need any other info. Best Regards
> > >
> > > _______________________________________________
> > > Tinycc-devel mailing list
> > > address@hidden
> > > https://lists.nongnu.org/mailman/listinfo/tinycc-devel
> >
> > _______________________________________________
> > Tinycc-devel mailing list
> > address@hidden
> > https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel