summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-25 23:01:03 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-25 23:01:03 -0800
commit8ccaa53c2d6bf96aa1b7db291f880a8ee5900d2f (patch)
tree3f86dc81c6225958f1cd86c382669847b0a1c281
parentd064b170315f3ba4615215930e6ffc27dc7de21e (diff)
downloadtxr-8ccaa53c2d6bf96aa1b7db291f880a8ee5900d2f.tar.gz
txr-8ccaa53c2d6bf96aa1b7db291f880a8ee5900d2f.tar.bz2
txr-8ccaa53c2d6bf96aa1b7db291f880a8ee5900d2f.zip
* configure: Make it an error to have implicit function declarations by
means of -Werror=implicit-function-declarations. Fix broken mkdir and mknod tests. Regenerate config.make if we add -U__STRICT_ANSI__ to the compiler options, so that later tests benefit from this. Regenerate config.make right away if adding -D_DARWIN_C_SOURCE. This allows the makedev test to pass. * stream.c: Include <sys/types.h> for makedev. (mknod_wrap): Don't rely on makedev wrappers to be there; test.
-rw-r--r--ChangeLog12
-rwxr-xr-xconfigure24
-rw-r--r--stream.c9
3 files changed, 35 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 0fd3deaf..6a6a1f45 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2014-02-25 Kaz Kylheku <kaz@kylheku.com>
+ * configure: Make it an error to have implicit function declarations by
+ means of -Werror=implicit-function-declarations. Fix broken mkdir and
+ mknod tests. Regenerate config.make if we add -U__STRICT_ANSI__
+ to the compiler options, so that later tests benefit from this.
+ Regenerate config.make right away if adding -D_DARWIN_C_SOURCE.
+ This allows the makedev test to pass.
+
+ * stream.c: Include <sys/types.h> for makedev.
+ (mknod_wrap): Don't rely on makedev wrappers to be there; test.
+
+2014-02-25 Kaz Kylheku <kaz@kylheku.com>
+
* parser.y (spec): Bugfix: SECRET_ESCAPE_E should use n_expr
not expr. expr is subject to expand_meta.
(n_expr): Do not associate source info with character
diff --git a/configure b/configure
index bdd20873..dc8a6291 100755
--- a/configure
+++ b/configure
@@ -83,7 +83,7 @@ yacc_given=
nm='$(cross)$(tool_prefix)nm'
opt_flags=-O2
lang_flags='-ansi -D_BSD_SOURCE -D_POSIX_C_SOURCE=199309L'
-diag_flags='-Wall -Werror=missing-prototypes -Werror=strict-prototypes'
+diag_flags='-Wall -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=strict-prototypes'
debug_flags=-g
inline=
platform_flags=
@@ -725,6 +725,9 @@ rm -f conftest$exe
if ! $make EXTRA_FLAGS=-Werror conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then
printf "no\n"
lang_flags="$lang_flags -U__STRICT_ANSI__"
+ printf "Regenerating config.make ..."
+ gen_config_make
+ printf "done\n"
else
printf "yes\n"
fi
@@ -737,8 +740,12 @@ case "$ccname" in
*gcc )
printf "Checking for Apple environment ... "
if echo | gcc -dM -E - | grep -s __APPLE__ > /dev/null 2>&1 ; then
- need_darwin_c_source=y
printf "yes\n"
+ need_darwin_c_source=y
+ lang_flags="$lang_flags -D_DARWIN_C_SOURCE"
+ printf "Regenerating config.make ..."
+ gen_config_make
+ printf "done\n"
else
printf "no\n"
fi
@@ -1631,7 +1638,7 @@ fi
printf "Checking for POSIX mkdir ... "
cat > conftest.c <<!
-#included "config.h"
+#include "config.h"
#include <sys/stat.h>
#if HAVE_WINDOWS_H
#include <windows.h>
@@ -1648,15 +1655,17 @@ if ! $make conftest > conftest.err 2>&1 || ! [ -x conftest ] ; then
printf "no\n"
else
printf "yes\n"
-cat conftest.err
-exit 1
printf "#define HAVE_MKDIR 1\n" >> config.h
fi
printf "Checking for mknod ... "
cat > conftest.c <<!
+#include "config.h"
#include <unistd.h>
+#if HAVE_SYS_STAT
+#include <sys/stat.h>
+#endif
int main(void)
{
@@ -1777,11 +1786,6 @@ fi
#
printf "Regenerating config.make ... "
-
-if [ -n "$need_darwin_c_source" ] ; then
- lang_flags="$lang_flags -D_DARWIN_C_SOURCE"
-fi
-
gen_config_make
printf "done\n"
diff --git a/stream.c b/stream.c
index 68a1e772..14dbc028 100644
--- a/stream.c
+++ b/stream.c
@@ -48,6 +48,9 @@
#if HAVE_WINDOWS_H
#include <windows.h>
#endif
+#if HAVE_MAKEDEV
+#include <sys/types.h>
+#endif
#include "lib.h"
#include "gc.h"
#include "signal.h"
@@ -2471,9 +2474,15 @@ val mknod_wrap(val path, val mode, val dev)
free(u8path);
if (err < 0)
+#if HAVE_MAKEDEV
uw_throwf(file_error_s, lit("mknod ~a ~a ~a (~a:~a): ~a/~s"),
path, mode, dev, major_wrap(dev), minor_wrap(dev), num(errno),
string_utf8(strerror(errno)), nao);
+#else
+ uw_throwf(file_error_s, lit("mknod ~a ~a ~a: ~a/~s"),
+ path, mode, dev, num(errno),
+ string_utf8(strerror(errno)), nao);
+#endif
return t;
}