automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests: explicitly state that our lexers do not require unist


From: Peter Rosin
Subject: Re: [PATCH] tests: explicitly state that our lexers do not require unistd.h
Date: Tue, 06 Mar 2012 08:38:27 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

Stefano Lattarini skrev 2012-03-05 21:05:
> Hi Peter.
> 
> On 03/05/2012 03:10 PM, Peter Rosin wrote:
>> By default, GNU flex generates code that is dependent on unistd.h,
>> which is not portable to non-ANSI systems causing spurious test
>> failures.
>>
>> * tests/cond35.test (tscan.l): Define YY_NO_UNISTD_H.
>> * tests/lex-clean.test (lexer.l): Likewise.
>> * tests/lex-depend-cxx.test (joe.ll): Likewise.
>> * tests/lex-depend.test (joe.l): Likewise.
>> * tests/lex-lib-external.test (foo.l): Likewise.
>> ...
>>  19 files changed, 65 insertions(+), 0 deletions(-)
>>
>> Hi!
>>
>> Ok for master?
>>
> Yes...  but I'd like to see a little addition squashed-in if you can: a
> new entry in 'tests/README' explaining that a "#define YY_NO_UNISTD_H"
> is needed in lex input files, and why it is so.

Like this?

Cheers,
Peter

diff --git a/tests/README b/tests/README
index 42afa2c..80faefc 100644
--- a/tests/README
+++ b/tests/README
@@ -263,6 +263,17 @@ Do
   directory, but use '$am_scriptdir' instead.  The complete list of
   such "$am_...dir" variables can be found in tests/defs-static.in.

+  When writing input for lex, include the following in the definitions
+  section
+    %{
+    #define YY_NO_UNISTD_H 1
+    %}
+  to accomodate non-ANSI systems, since GNU flex generates code that
+  includes unistd.h otherwise.  Also add
+    %option never-interactive
+  to the definitions section if the generated code is to be compiled
+  by a C++ compiler, for the same reason.
+
   Before commit: make sure the test is executable, add the tests to
   TESTS in Makefile.am, add it to XFAIL_TESTS in addition if needed,
   write a ChangeLog entry, send the diff to <address@hidden>.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]