[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: build failure
From: |
Akim Demaille |
Subject: |
Re: build failure |
Date: |
Tue, 4 Sep 2012 10:54:12 +0200 |
Le 3 sept. 2012 à 10:43, Akim Demaille a écrit :
>
> Le 1 sept. 2012 à 18:38, Eric Blake a écrit :
>
> Hi Eric,
>
>> I got the following error while building the latest master branch of
>> bison.git:
>>
>> CC src/bison-parse-gram.o
>> src/parse-gram.y: In function 'add_param':
>> src/parse-gram.y:779:5: error: implicit declaration of function
>> 'isspace' [-Werror=implicit-function-declaration]
>>
>> This patch fixes it for me, but I don't know if you instead want to
>> patch system.h:
>
> Jim is already on this, his patch will certainly be applied
> soon.
He did (in maint, I will merge it in master soon).
>> But while looking at system.h, I did notice one other thing;
>> it has:
>>
>> #if HAVE_SYS_TYPES_H
>> # include <sys/types.h>
>> #endif
>>
>> But because bison uses gnulib, we are guaranteed that:
>> 1. <sys/types.h> always exists, so the use of HAVE_SYS_TYPES_H is pointless
>> 2. these days, POSIX 2008 requires that most headers be self-contained
>> (that is, you need not include <sys/types.h> prior to another header,
>> but just use the other header, and the types you need will still be
>> declared); gnulib enforces this rule, making it quite portable to
>> compile without ever explicitly including <sys/types.h>.
>>
>> That is, I think you could delete those three lines with no ill effects.
>
> OK, I will do. Is this the only header like this? I'm
> also surprised that the gnulib's syntax-checks did not
> catch this.
I installed this. Thanks!
commit 592bdad15e13564e1d8e621bce53bc9c485ee792
Author: Akim Demaille <address@hidden>
Date: Tue Sep 4 09:49:17 2012 +0200
remove useless include
* src/system.h: Don't include sys/types.h.
Reported by Eric Blake,
<http://lists.gnu.org/archive/html/bug-bison/2012-09/msg00002.html>.
(FUNCTION_PRINT): Remove, unused.
diff --git a/src/system.h b/src/system.h
index 1ae6a6b..bf7f59f 100644
--- a/src/system.h
+++ b/src/system.h
@@ -38,11 +38,6 @@
# include <stddef.h>
# include <stdlib.h>
# include <string.h>
-
-# if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-# endif
-
# include <unistd.h>
# include <inttypes.h>
@@ -105,7 +100,6 @@ typedef size_t uintptr_t;
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# endif
-# define FUNCTION_PRINT() fprintf (stderr, "%s: ", __func__)
/*------.
| NLS. |