[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: build failure
Re: build failure
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
>> 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
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>
>> 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!
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,
(FUNCTION_PRINT): Remove, unused.
diff --git a/src/system.h b/src/system.h
index 1ae6a6b..bf7f59f 100644
@@ -38,11 +38,6 @@
# include <stddef.h>
# include <stdlib.h>
# include <string.h>
-# if HAVE_SYS_TYPES_H
-# include <sys/types.h>
# include <unistd.h>
# include <inttypes.h>
@@ -105,7 +100,6 @@ typedef size_t uintptr_t;
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
-# define FUNCTION_PRINT() fprintf (stderr, "%s: ", __func__)
| NLS. |