On 05/27/2010 01:23 PM, Todd Rinaldo wrote:
> Today, I ran into an issue compiling m4 on RHEL6 beta. I had to apply this 
> patch to make it work or I got errors about S_ISDIR not being defined during 
> linking. Any ideas why this was an issue?

Thanks for the report.  Most likely, this is an actual bug in m4 relying
on the laziness of older systems that implicitly included <sys/stat.h>
inside other headers; contrasted with recent glibc which has
intentionally been tightening down system headers to avoid such
namespace pollution.  POSIX states that <fcntl.h> may, but not must,
include <sys/stat.h>; and it looks like m4.h had another include path
that included <fcntl.h> but not explicitly <sys/stat.h>.

> 
> diff --git a/src/path.c b/src/path.c
> index 682969d..e5870ae 100644
> --- a/src/path.c
> +++ b/src/path.c
> @@ -22,6 +22,7 @@
>  /* Handling of path search of included files via the builtins "include"
>     and "sinclude".  */
>  
> +#include "sys/stat.h"
>  #include "m4.h"

Your patch is not quite correct, since m4.h MUST come first to avoid
conflicts between <config.h> and gnulib replacements for other system
headers.  But adding "sys/stat.h" after m4.h, or as part of m4.h, will
indeed fix the problem.  I'll apply this on the development branches
shortly (not sure whether this warrants 1.4.15, or whether this will
wait until 1.6).

-- 
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to