GNU bug report logs -
#14495
unistd.h problem in t/lex-header.sh
Previous Next
Reported by: Peter Rosin <peda <at> lysator.liu.se>
Date: Wed, 29 May 2013 00:11:01 UTC
Severity: minor
Tags: patch
Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14495 in the body.
You can then email your comments to 14495 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-automake <at> gnu.org
:
bug#14495
; Package
automake
.
(Wed, 29 May 2013 00:11:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Peter Rosin <peda <at> lysator.liu.se>
:
New bug report received and forwarded. Copy sent to
bug-automake <at> gnu.org
.
(Wed, 29 May 2013 00:11:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi!
When t/lex-header.sh tries to compile main.c on the master branch, it fails
like this snippet below, since MSVC does not have unistd.h. I suppose main.c
should add
#define YY_NO_UNISTD_H 1
before it includes mylex.h? Or is this something else? I know very little
about lexers...
Cheers,
Peter
log snippet follows:
source='main.c' object='main.obj' libtool=no \
DEPDIR=.deps depmode=msvc7msys /bin/sh ./depcomp \
/home/peda/automake/lib/compile cl -nologo -DPACKAGE_NAME=\"lex-header\" -DPACKAGE_TARNAME=\"lex-header\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"lex-header\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"lex-header\" -DVERSION=\"1.0\" -I. -c -o main.obj $(echo main.c)
main.c
mylex.h(228) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
make[1]: *** [main.obj] Error 2
Information forwarded
to
bug-automake <at> gnu.org
:
bug#14495
; Package
automake
.
(Wed, 29 May 2013 08:41:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 14495 <at> debbugs.gnu.org (full text, mbox):
On 2013-05-29 02:08, Peter Rosin wrote:
> Hi!
>
> When t/lex-header.sh tries to compile main.c on the master branch, it fails
> like this snippet below, since MSVC does not have unistd.h. I suppose main.c
> should add
>
> #define YY_NO_UNISTD_H 1
>
> before it includes mylex.h? Or is this something else? I know very little
> about lexers...
The problem is the same on the micro branch (87e49f4f040c8ab).
Cheers,
Peter
Information forwarded
to
bug-automake <at> gnu.org
:
bug#14495
; Package
automake
.
(Wed, 29 May 2013 09:09:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 14495 <at> debbugs.gnu.org (full text, mbox):
On 05/29/2013 10:39 AM, Peter Rosin wrote:
> On 2013-05-29 02:08, Peter Rosin wrote:
>> Hi!
>>
>> When t/lex-header.sh tries to compile main.c on the master branch, it fails
>> like this snippet below, since MSVC does not have unistd.h. I suppose main.c
>> should add
>>
>> #define YY_NO_UNISTD_H 1
>>
>> before it includes mylex.h? Or is this something else? I know very little
>> about lexers...
>
> The problem is the same on the micro branch (87e49f4f040c8ab).
>
We had already solved a similar issue one, in the very Automake test suite.
Let me see if I can find the reference ... Oh wait, no need to, we have
registered the learned lesson in t/README already:
* When writing input for lex, include the following in the definitions
section:
%{
#define YY_NO_UNISTD_H 1
%}
to accommodate non-ANSI systems, since GNU flex generates code that
includes unistd.h otherwise.
And peeking in the Git history, I see you already fixed a similar
problem about an year ago, in commit v1.11-2058-g6f4b08d.
Can you try a fix on those lines?
Thanks,
Stefano
Information forwarded
to
bug-automake <at> gnu.org
:
bug#14495
; Package
automake
.
(Wed, 29 May 2013 09:46:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 14495 <at> debbugs.gnu.org (full text, mbox):
On 2013-05-29 11:06, Stefano Lattarini wrote:
> On 05/29/2013 10:39 AM, Peter Rosin wrote:
>> On 2013-05-29 02:08, Peter Rosin wrote:
>>> Hi!
>>>
>>> When t/lex-header.sh tries to compile main.c on the master branch, it fails
>>> like this snippet below, since MSVC does not have unistd.h. I suppose main.c
>>> should add
>>>
>>> #define YY_NO_UNISTD_H 1
>>>
>>> before it includes mylex.h? Or is this something else? I know very little
>>> about lexers...
>>
>> The problem is the same on the micro branch (87e49f4f040c8ab).
>>
> We had already solved a similar issue one, in the very Automake test suite.
> Let me see if I can find the reference ... Oh wait, no need to, we have
> registered the learned lesson in t/README already:
>
> * When writing input for lex, include the following in the definitions
> section:
>
> %{
> #define YY_NO_UNISTD_H 1
> %}
>
> to accommodate non-ANSI systems, since GNU flex generates code that
> includes unistd.h otherwise.
>
> And peeking in the Git history, I see you already fixed a similar
> problem about an year ago, in commit v1.11-2058-g6f4b08d.
>
> Can you try a fix on those lines?
That %{ ... %}-block is causes the #define to be added to the generated
foo-lexer.c file, and the block is in fact already present so adding it
a second time will probably not help :-) The new problem in this
testcase is that the main.c file includes the generated mylex.h without
defining YY_NO_UNISTD_H file.
The below one-liner makes the test pass. Ok to push such a change?
Cheers,
Peter
diff --git a/t/lex-header.sh b/t/lex-header.sh
index 005ae86..0789af4 100644
--- a/t/lex-header.sh
+++ b/t/lex-header.sh
@@ -55,6 +55,7 @@ cat > lexer.l << 'END'
END
cat > main.c <<'END'
+#define YY_NO_UNISTD_H 1
#include "mylex.h"
int main (void)
{
Information forwarded
to
bug-automake <at> gnu.org
:
bug#14495
; Package
automake
.
(Wed, 29 May 2013 09:54:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 14495 <at> debbugs.gnu.org (full text, mbox):
On 05/29/2013 11:43 AM, Peter Rosin wrote:
> On 2013-05-29 11:06, Stefano Lattarini wrote:
>> On 05/29/2013 10:39 AM, Peter Rosin wrote:
>>> On 2013-05-29 02:08, Peter Rosin wrote:
>>>> Hi!
>>>>
>>>> When t/lex-header.sh tries to compile main.c on the master branch, it fails
>>>> like this snippet below, since MSVC does not have unistd.h. I suppose main.c
>>>> should add
>>>>
>>>> #define YY_NO_UNISTD_H 1
>>>>
>>>> before it includes mylex.h? Or is this something else? I know very little
>>>> about lexers...
>>>
>>> The problem is the same on the micro branch (87e49f4f040c8ab).
>>>
>> We had already solved a similar issue one, in the very Automake test suite.
>> Let me see if I can find the reference ... Oh wait, no need to, we have
>> registered the learned lesson in t/README already:
>>
>> * When writing input for lex, include the following in the definitions
>> section:
>>
>> %{
>> #define YY_NO_UNISTD_H 1
>> %}
>>
>> to accommodate non-ANSI systems, since GNU flex generates code that
>> includes unistd.h otherwise.
>>
>> And peeking in the Git history, I see you already fixed a similar
>> problem about an year ago, in commit v1.11-2058-g6f4b08d.
>>
>> Can you try a fix on those lines?
>
> That %{ ... %}-block is causes the #define to be added to the generated
> foo-lexer.c file, and the block is in fact already present so adding it
> a second time will probably not help :-)
>
Oops, I missed that. *blush*.
> The new problem in this
> testcase is that the main.c file includes the generated mylex.h without
> defining YY_NO_UNISTD_H file.
>
> The below one-liner makes the test pass. Ok to push such a change?
>
Sure, and sorry for the confusion.
> Cheers,
> Peter
>
> diff --git a/t/lex-header.sh b/t/lex-header.sh
> index 005ae86..0789af4 100644
> --- a/t/lex-header.sh
> +++ b/t/lex-header.sh
> @@ -55,6 +55,7 @@ cat > lexer.l << 'END'
> END
>
> cat > main.c <<'END'
> +#define YY_NO_UNISTD_H 1
> #include "mylex.h"
> int main (void)
> {
>
Thanks,
Stefano
Information forwarded
to
bug-automake <at> gnu.org
:
bug#14495
; Package
automake
.
(Wed, 29 May 2013 10:11:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 14495 <at> debbugs.gnu.org (full text, mbox):
On 2013-05-29 11:51, Stefano Lattarini wrote:
> On 05/29/2013 11:43 AM, Peter Rosin wrote:
>> diff --git a/t/lex-header.sh b/t/lex-header.sh
>> index 005ae86..0789af4 100644
>> --- a/t/lex-header.sh
>> +++ b/t/lex-header.sh
>> @@ -55,6 +55,7 @@ cat > lexer.l << 'END'
>> END
>>
>> cat > main.c <<'END'
>> +#define YY_NO_UNISTD_H 1
>> #include "mylex.h"
>> int main (void)
>> {
>>
Pushing this:
From a4598c57d3dded53851f1319f23d187b2c8132d3 Mon Sep 17 00:00:00 2001
From: Peter Rosin <peda <at> lysator.liu.se>
Date: Wed, 29 May 2013 12:01:07 +0200
Subject: [PATCH 1/2] tests: avoid a spurious failure on non-POSIX systems
Fixes automake bug#14495.
* t/lex-header.sh: Make sure unistd.h isn't included.
Signed-off-by: Peter Rosin <peda <at> lysator.liu.se>
---
t/lex-header.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/t/lex-header.sh b/t/lex-header.sh
index 005ae86..0789af4 100644
--- a/t/lex-header.sh
+++ b/t/lex-header.sh
@@ -55,6 +55,7 @@ cat > lexer.l << 'END'
END
cat > main.c <<'END'
+#define YY_NO_UNISTD_H 1
#include "mylex.h"
int main (void)
{
--
1.7.9
Added tag(s) patch.
Request was from
Stefano Lattarini <stefano.lattarini <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Thu, 30 May 2013 21:08:02 GMT)
Full text and
rfc822 format available.
Severity set to 'minor' from 'normal'
Request was from
Stefano Lattarini <stefano.lattarini <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Thu, 30 May 2013 21:08:02 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
14495 <at> debbugs.gnu.org and Peter Rosin <peda <at> lysator.liu.se>
Request was from
Stefano Lattarini <stefano.lattarini <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Thu, 30 May 2013 21:08:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 28 Jun 2013 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 48 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.