diff -urN bison-2.4.3/lib/binary-io.h bison-2.4.3-haiku/lib/binary-io.h
--- bison-2.4.3/lib/binary-io.h	2010-02-06 21:15:26.051118080 +0000
+++ bison-2.4.3-haiku/lib/binary-io.h	2011-01-26 11:15:38.000000000 +0000
@@ -19,24 +19,13 @@
 #define _BINARY_H
 
 /* For systems that distinguish between text and binary I/O.
-   O_BINARY is usually declared in <fcntl.h>. */
+   O_BINARY is guaranteed by the gnulib <fcntl.h>. */
 #include <fcntl.h>
 
 /* The MSVC7 <stdio.h> doesn't like to be included after '#define fileno ...',
    so we include it here first.  */
 #include <stdio.h>
 
-#if !defined O_BINARY && defined _O_BINARY
-  /* For MSC-compatible compilers.  */
-# define O_BINARY _O_BINARY
-# define O_TEXT _O_TEXT
-#endif
-#if defined __BEOS__ || defined __HAIKU__
-  /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect.  */
-# undef O_BINARY
-# undef O_TEXT
-#endif
-
 /* SET_BINARY (fd);
    changes the file descriptor fd to perform binary I/O.  */
 #if O_BINARY
@@ -58,8 +47,6 @@
 # endif
 #else
   /* On reasonable systems, binary I/O is the default.  */
-# undef O_BINARY
-# define O_BINARY 0
 # define SET_BINARY(fd) /* do nothing */ ((void) 0)
 #endif
 
diff -urN bison-2.4.3/src/location.c bison-2.4.3-haiku/src/location.c
--- bison-2.4.3/src/location.c	2010-08-06 00:37:58.001572864 +0000
+++ bison-2.4.3-haiku/src/location.c	2011-01-26 10:23:20.032505856 +0000
@@ -141,11 +141,11 @@
   /* Must search in reverse since the file name field may
    * contain `.' or `:'.  */
   char *delim = strrchr (loc_str, '.');
-  aver (delim);
+  aver (delim != NULL);
   *delim = '\0';
   bound->column = atoi (delim+1);
   delim = strrchr (loc_str, ':');
-  aver (delim);
+  aver (delim != NULL);
   *delim = '\0';
   bound->line = atoi (delim+1);
   bound->file = uniqstr_new (loc_str);
diff -urN bison-2.4.3/src/muscle_tab.c bison-2.4.3-haiku/src/muscle_tab.c
--- bison-2.4.3/src/muscle_tab.c	2010-08-06 00:37:58.065011712 +0000
+++ bison-2.4.3-haiku/src/muscle_tab.c	2011-01-26 10:23:20.033030144 +0000
@@ -338,7 +338,7 @@
 {
   location loc;
   char const *value = muscle_find_const (key);
-  aver (value);
+  aver (value != NULL);
   aver (*value == '[');
   aver (*++value == '[');
   while (*++value)
