grep fails with: source='search.c' object='search.o' libtool=no \ DEPDIR=.deps depmode=sgi /opt/portage/bin/bash ../depcomp \ cc -DHAVE_CONFIG_H -I. -I.. -I../intl -I../lib -DLOCALEDIR=\"/opt/portage/usr/share/locale\" -I/opt/portage/usr/include -c99 -O2 -n32 -mips4 -r14000 -float_const -use_readonly_const -TARG:isa=mips4:platform=ip35:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -diag_error 1035 -woff 1174,1183,1185,1552,3968,3970 -n32 -I/opt/portage/usr/include -c search.c cc-1117 cc: ERROR File = search.c, Line = 260 An expression appears after a "return" in a "void" function. return GEAcompile (pattern, size, ^ cc-1117 cc: ERROR File = search.c, Line = 266 An expression appears after a "return" in a "void" function. return GEAcompile (pattern, size, RE_SYNTAX_AWK); ^ cc-1117 cc: ERROR File = search.c, Line = 271 An expression appears after a "return" in a "void" function. return GEAcompile (pattern, size, RE_SYNTAX_POSIX_EGREP); ^ cc-3604 cc: WARNING File = search.c, Line = 1249 missing return statement at end of non-void function "Pexecute" } ^ 3 errors detected in the compilation of "search.c". make[2]: *** [search.o] Error 2 make[2]: Leaving directory `/usr/opt/portage/var/tmp/portage/sys-apps/grep-2.5.3-r1/work/grep-2.5.3/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/opt/portage/var/tmp/portage/sys-apps/grep-2.5.3-r1/work/grep-2.5.3' make: *** [all] Error 2 * ERROR: sys-apps/grep-2.5.3-r1 failed: * emake failed * * Call stack: * ebuild.sh: 49: <call src_compile> * environment:2429: emake || die "emake failed" ... this can be fixed by removing the "return" keyword from lines 260, 266, and 271.
... even with these changes, the grep (now sys-apps/grep-2.5.3-r01.1) testsuite still fails with: PASS: warning.sh PASS: khadafy.sh PASS: spencer1.sh PASS: bre.sh PASS: ere.sh PASS: pcre.sh PASS: status.sh PASS: empty.sh PASS: options.sh PASS: backref.sh PASS: file.sh Testing: ../src/grep Word -o -i input: "WordA/wordB/WORDC/" output: "" expect: "Word/word/WORD/" FAIL Testing: ../src/grep WORD -o -i input: "WordA/wordB/WORDC/" output: "" expect: "Word/word/WORD/" FAIL Testing: ../src/grep Word --color=always -i input: "WordA/wordb/WORDC/" output: "WordA/wordb/WORDC/" [without colouring] expect: "WordA/wordb/WORDC/" [with colouring] FAIL Testing: ../src/grep WORD --color=always -i input: "WordA/wordb/WORDC/" output: "WordA/wordb/WORDC/" [without colouring] expect: "WordA/wordb/WORDC/" [with colouring] FAIL FAIL: foad1.sh SKIP: fmbtest.sh PASS: yesno.sh ================================= 1 of 13 tests failed (1 tests were not run) make[2]: *** [check-TESTS] Error 1 make[2]: Leaving directory `/usr/opt/portage/var/tmp/portage/sys-apps/grep-2.5.3-r01.1/work/grep-2.5.3/tests' make[1]: *** [check-am] Error 2 make[1]: Leaving directory `/usr/opt/portage/var/tmp/portage/sys-apps/grep-2.5.3-r01.1/work/grep-2.5.3/tests' make: *** [check-recursive] Error 1 * ERROR: sys-apps/grep-2.5.3-r01.1 failed: * Make check failed. See above for details. * * Call stack: * ebuild.sh: 49: <call src_test> * environment:2469: <call _eapi0_src_test> * ebuild.sh: 616: hasq test $FEATURES && die "Make check failed. See above for details."
For the record, the WordA/wordB/WORDC tests also fail on BSD systems. And it seems to be upstream already: http://savannah.gnu.org/bugs/?24703
Created attachment 183166 [details, diff] Patch to prevent void functions from trying to return a value
The good news is that, with this patch, the grep-2.5.4 test-suite passes successfully.
please send this patch upstream and give us a reference so we can track the patch In the meanwhile I've committed it to the Prefix tree.
https://savannah.gnu.org/patch/index.php?6756