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 <[email protected]> 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 > > [email protected] (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 > > > [email protected] > > > https://lists.nongnu.org/mailman/listinfo/tinycc-devel > > > > _______________________________________________ > > Tinycc-devel mailing list > > [email protected] > > https://lists.nongnu.org/mailman/listinfo/tinycc-devel > > _______________________________________________ > Tinycc-devel mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/tinycc-devel _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
