From: Stefano Lattarini Date: Wed, 16 May 2012 14:26:39 +0000 (+0200) Subject: yacc tests: avoid a spurious failure with Sun C++ 5.9 X-Git-Tag: v1.12.0b~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0592e126d5f8e2de04894944c4cad9fe35198d30;p=thirdparty%2Fautomake.git yacc tests: avoid a spurious failure with Sun C++ 5.9 * t/yacc-cxx.sh (parse1.yy): When calling the 'getchar' function declared in the #included , fully qualify it as std::getchar', to avoid Sun C++ 5.9 erroring out with: "parse1.yy", line 5: Error: The function "getc" must have a prototype. * t/yacc-clean-cxx.sh (sub1/parsefoo.yxx): Likewise. Signed-off-by: Stefano Lattarini --- diff --git a/t/yacc-clean-cxx.sh b/t/yacc-clean-cxx.sh index d8ee1c65f..399f02657 100755 --- a/t/yacc-clean-cxx.sh +++ b/t/yacc-clean-cxx.sh @@ -68,7 +68,8 @@ cat > sub1/parsefoo.yxx << 'END' %{ // This file should contain valid C++ but invalid C. #include -int yylex (void) { return (getchar ()); } +// "std::" qualification required by Sun C++ 5.9. +int yylex (void) { return std::getchar (); } void yyerror (const char *s) { return; } %} %% diff --git a/t/yacc-cxx.sh b/t/yacc-cxx.sh index dfcc12a40..41a25ec4a 100755 --- a/t/yacc-cxx.sh +++ b/t/yacc-cxx.sh @@ -46,7 +46,8 @@ cat > parse1.yy << 'END' // Valid C++, but deliberately invalid C. #include #include -int yylex (void) { return getchar (); } +// "std::" qualification required by Sun C++ 5.9. +int yylex (void) { return std::getchar (); } void yyerror (const char *s) { return; } %} %%