PATCH: fix MAP_FAILED and __attribute__ parse error issues

David Relson relson at osagesoftware.com
Mon Jan 19 05:23:15 CET 2004


On Mon, 19 Jan 2004 05:02:02 +0100
Matthias Andree <matthias.andree at gmx.de> wrote:

> As authenticated CVS is currently down on SourceForge for scheduled
> maintenance; these patches should fix Henri van Riel's problems.
> 
> I'll commit them when CVS is back up.

It's been down for hours, though I haven't tried recently

> 
> The Makefile.am patch is unrelated and fixes a "mv asks questions"
> bug. It can safely be omitted and should be if your automake is older
> than a recent 1.7.X version.

Sounds fine.


> Index: contrib/bogogrep.c
> ===================================================================
> RCS file: /cvsroot/bogofilter/bogofilter/contrib/bogogrep.c,v
> retrieving revision 1.3
> diff -u -r1.3 bogogrep.c
> --- contrib/bogogrep.c	17 Dec 2003 12:54:29 -0000	1.3
> +++ contrib/bogogrep.c	19 Jan 2004 03:56:38 -0000
> @@ -17,7 +17,7 @@
>  #include <unistd.h>
>  #include <fcntl.h>
>  
> -#ifdef __DGUX__
> +#if defined(__DGUX__) || !defined(MAP_FAILED)
>  #define MAP_FAILED (-1)
>  #endif

The usage of MAP_FAILED expects a pointer.  /usr/include/sys/mman.h
defines it as 

#define MAP_FAILED ((void *) -1)

Also, when test for __DGUX__.  Why not simply have

#ifndef MAP_FAILED
#define MAP_FAILED ((void *) -1)
#endif

...[snip]...


> +/* Ignore __attribute__ if not using GNU CC */
> +#ifndef __GNUC__
> +#define __attribute__(a)
> +#endif
> +

As mentioned, __GNUC__ isn't the issue here.





More information about the Bogofilter mailing list