[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#11185: flex %option "never-interactive" breaks few tests on Solaris
From: |
Peter Rosin |
Subject: |
bug#11185: flex %option "never-interactive" breaks few tests on Solaris |
Date: |
Thu, 05 Apr 2012 21:22:50 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 |
On 2012-04-05 15:40, Stefano Lattarini wrote:
> Severity: minor
> thanks
>
> Hello automakers, Peter.
>
> The commit v1.11-2058-g6f4b08d of 06-03-2012, "tests: explicitly state
> that our lexers do not require unistd.h", has been causing at least
> the tests 'lex-clean-cxx.test' and 'lex-depend-cxx.test' to break on
> Solaris, where lex is not flex, and does not understand the directive
> "%option never-interactive".
>
> Any opinion on how to better fix this? Is defining a dummy 'isatty'
> function in our C++ sources enough to avoid the failures on MSYS?
Yes, the test still passes with MSVC and the below patch. I have little
time at the moment, so if this works elsewhere and if someone else can
wrap it all up with a decent commit message etc, that would probably be
fastest approach.
It does not work to add the isatty function down by yywrap, it probably
works if you add a forward declaration where I put the function, but
the function is so small that I thought that was pretty pointless.
However, I am *not* fluent in lex, so what do I know?
Cheers,
Peter
diff --git a/tests/lex-clean-cxx.test b/tests/lex-clean-cxx.test
index 9ff2dbc..32ab327 100755
--- a/tests/lex-clean-cxx.test
+++ b/tests/lex-clean-cxx.test
@@ -55,8 +55,11 @@ END
cat > parsefoo.lxx << 'END'
%{
#define YY_NO_UNISTD_H 1
+int isatty (int fd)
+{
+ return 0;
+}
%}
-%option never-interactive
%%
"GOOD" return EOF;
.