On 10/19/21 23:57, Akim Demaille wrote: > Hi Dennis, > >> Le 15 oct. 2021 à 01:01, Dennis Clarke <dcla...@blastwave.org> a écrit : >> >> On 10/14/21 01:28, Akim Demaille wrote: >>> Hi Dennis, >>> >>>> Le 14 oct. 2021 à 03:40, Dennis Clarke <dcla...@blastwave.org> a écrit : >>>> >>>> *res = { >>>> name = 0x105c30 "<bad address 0x0000000000105c30>" >>>> type = 0 >>>> value = { >>>> var = 0.0 >>>> fun = (nil) >>>> } >>>> next = (nil) >>>> } >>> >>> Really??? So it seems that strdup on this machine is dead broken. >> >> This will be really silly long but strdup seems to work just fine : >> >> beta $ cat /tmp/foo.c > ... >> #define _XOPEN_SOURCE 600 > > Would that be the difference? If you define this early enough in > the original test case, does it work properly? > > I have attached "without-my-strdup.y", that must be installed as > mfcalc.y, for convenience. >
OKay, I will do this in two passes. Firstly I use your "without-my-strdup.y" as examples/c/mfcalc/mfcalc.y where we get great results : gmake[3]: 'tests/bison' is up to date. gmake[3]: Nothing to be done for 'tests/atconfig'. gmake[3]: 'tests/atlocal' is up to date. gmake[3]: Leaving directory '/opt/bw/build/bison-3.8.2_sunos5.10_sparcv9.005' /opt/bw/bin/gmake check-TESTS check-local gmake[3]: Entering directory '/opt/bw/build/bison-3.8.2_sunos5.10_sparcv9.005' gmake[4]: Entering directory '/opt/bw/build/bison-3.8.2_sunos5.10_sparcv9.005' PASS: examples/c/mfcalc/mfcalc.test PASS: examples/c/rpcalc/rpcalc.test SKIP: examples/c/bistromathic/bistromathic.test PASS: examples/c/calc/calc.test FAIL: examples/c/glr/c++-types.test PASS: examples/c/lexcalc/lexcalc.test PASS: examples/c/pushcalc/calc.test SKIP: examples/c/reccalc/reccalc.test ============================================================================ Testsuite summary for GNU Bison 3.8.2 ============================================================================ # TOTAL: 8 # PASS: 5 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 ============================================================================ See ./test-suite.log Please report to bug-bison@gnu.org ============================================================================ gmake[4]: *** [Makefile:10492: test-suite.log] Error 1 gmake[4]: Leaving directory '/opt/bw/build/bison-3.8.2_sunos5.10_sparcv9.005' gmake[3]: *** [Makefile:10600: check-TESTS] Error 2 gmake[3]: Leaving directory '/opt/bw/build/bison-3.8.2_sunos5.10_sparcv9.005' gmake[2]: *** [Makefile:10826: check-am] Error 2 gmake[2]: Leaving directory '/opt/bw/build/bison-3.8.2_sunos5.10_sparcv9.005' gmake[1]: *** [Makefile:10377: check-recursive] Error 1 gmake[1]: Leaving directory '/opt/bw/build/bison-3.8.2_sunos5.10_sparcv9.005' gmake: *** [Makefile:10828: check] Error 2 real 13.63 user 7.47 sys 1.04 beta $ beta $ beta $ beta $ beta $ cat ./test-suite.log ======================================= GNU Bison 3.8.2: ./test-suite.log ======================================= # TOTAL: 8 # PASS: 5 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 .. contents:: :depth: 2 SKIP: examples/c/bistromathic/bistromathic ========================================== checking for diff --strip-trailing-cr... diff: illegal option -- strip-trailing-cr usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2 diff [-bitw] [-C number | -U number] file1 file2 diff [-bitw] [-D string] file1 file2 diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2 checking for diff --strip-trailing-cr... ./examples/test: line 50: 29348 Segmentation Fault (core dumped) "$abs_medir/$me" "$@" checking for readline output... 1,3d0 < > 0 < 0 < > 1d0 < 0 SKIP: this is not the GNU Readline we expect SKIP examples/c/bistromathic/bistromathic.test (exit status: 77) FAIL: examples/c/glr/c++-types ============================== checking for diff --strip-trailing-cr... diff: illegal option -- strip-trailing-cr usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2 diff [-bitw] [-C number | -U number] file1 file2 diff [-bitw] [-D string] file1 file2 diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2 checking for diff --strip-trailing-cr... c++-types: FAIL: 1 (expected status: 0, effective: 139) ./examples/test: line 50: 29449 Segmentation Fault (core dumped) "$abs_medir/$me" "$@" FAIL examples/c/glr/c++-types.test (exit status: 1) SKIP: examples/c/reccalc/reccalc ================================ checking for diff --strip-trailing-cr... diff: illegal option -- strip-trailing-cr usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2 diff [-bitw] [-C number | -U number] file1 file2 diff [-bitw] [-D string] file1 file2 diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2 checking for diff --strip-trailing-cr... SKIP: gimme one seq SKIP examples/c/reccalc/reccalc.test (exit status: 77) beta $ So that looks very good. Next I need to use your "with-my-strdup.y" and repeat the process. I see you have your own : > > +static char *my_strdup (const char *s) > +{ > + size_t len = strlen (s) + 1; > + void *res = malloc (len); > + > + if (res == NULL) > + return NULL; > + > + return (char *) memcpy (res, s, len); > +} > + Personally I like calloc and then the nul termination is assured but whatever. However I also see that "#define _XOPEN_SOURCE 600" happens. So the results look the same : PASS: examples/c/mfcalc/mfcalc.test PASS: examples/c/rpcalc/rpcalc.test SKIP: examples/c/bistromathic/bistromathic.test PASS: examples/c/calc/calc.test FAIL: examples/c/glr/c++-types.test PASS: examples/c/lexcalc/lexcalc.test PASS: examples/c/pushcalc/calc.test SKIP: examples/c/reccalc/reccalc.test ============================================================================ Testsuite summary for GNU Bison 3.8.2 ============================================================================ # TOTAL: 8 # PASS: 5 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 ============================================================================ See ./test-suite.log Please report to bug-bison@gnu.org ============================================================================ gmake[4]: *** [Makefile:10492: test-suite.log] Error 1 gmake[4]: Leaving directory '/opt/bw/build/bison-3.8.2_sunos5.10_sparcv9.006' gmake[3]: *** [Makefile:10600: check-TESTS] Error 2 gmake[3]: Leaving directory '/opt/bw/build/bison-3.8.2_sunos5.10_sparcv9.006' gmake[2]: *** [Makefile:10826: check-am] Error 2 gmake[2]: Leaving directory '/opt/bw/build/bison-3.8.2_sunos5.10_sparcv9.006' gmake[1]: *** [Makefile:10377: check-recursive] Error 1 gmake[1]: Leaving directory '/opt/bw/build/bison-3.8.2_sunos5.10_sparcv9.006' gmake: *** [Makefile:10828: check] Error 2 real 13.65 user 7.47 sys 1.04 beta $ beta $ cat ./test-suite.log ======================================= GNU Bison 3.8.2: ./test-suite.log ======================================= # TOTAL: 8 # PASS: 5 # SKIP: 2 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 .. contents:: :depth: 2 SKIP: examples/c/bistromathic/bistromathic ========================================== checking for diff --strip-trailing-cr... diff: illegal option -- strip-trailing-cr usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2 diff [-bitw] [-C number | -U number] file1 file2 diff [-bitw] [-D string] file1 file2 diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2 checking for diff --strip-trailing-cr... ./examples/test: line 50: 15428 Segmentation Fault (core dumped) "$abs_medir/$me" "$@" checking for readline output... 1,3d0 < > 0 < 0 < > 1d0 < 0 SKIP: this is not the GNU Readline we expect SKIP examples/c/bistromathic/bistromathic.test (exit status: 77) FAIL: examples/c/glr/c++-types ============================== checking for diff --strip-trailing-cr... diff: illegal option -- strip-trailing-cr usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2 diff [-bitw] [-C number | -U number] file1 file2 diff [-bitw] [-D string] file1 file2 diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2 checking for diff --strip-trailing-cr... c++-types: FAIL: 1 (expected status: 0, effective: 139) ./examples/test: line 50: 15529 Segmentation Fault (core dumped) "$abs_medir/$me" "$@" FAIL examples/c/glr/c++-types.test (exit status: 1) SKIP: examples/c/reccalc/reccalc ================================ checking for diff --strip-trailing-cr... diff: illegal option -- strip-trailing-cr usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2 diff [-bitw] [-C number | -U number] file1 file2 diff [-bitw] [-D string] file1 file2 diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2 checking for diff --strip-trailing-cr... SKIP: gimme one seq SKIP examples/c/reccalc/reccalc.test (exit status: 77) beta $ I really don't think we need to implement a new strdup. -- Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional