Send inn-workers mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/inn-workers
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of inn-workers digest..."


Today's Topics:

   1. mmap on AIX 7.1 (Julien ?LIE)
   2. Re: mmap on AIX 7.1 (Russ Allbery)
   3. Re: mmap on AIX 7.1 (Julien ?LIE)


----------------------------------------------------------------------

Message: 1
Date: Mon, 22 Sep 2014 19:27:24 +0200
From: Julien ?LIE <[email protected]>
To: "[email protected]" <[email protected]>
Subject: mmap on AIX 7.1
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

When building INN on AIX 7.1 with large files support, the following error 
occurs:

../include/portable/mmap.h:27:0: warning: "mmap" redefined
 #define mmap(s, l, p, f, d, o) (void *) mmap((s), (l), (p), (f), (d), (o))
 ^
In file included from ../include/portable/mmap.h:14:0,
                 from dbz.c:72:
/usr/include/sys/mman.h:87:0: note: this is the location of the previous 
definition
 #define mmap  mmap64
 ^


According to AIX documentation:
    
http://www-01.ibm.com/support/knowledgecenter/#!/ssw_aix_71/com.ibm.aix.basetrf1/mmap.htm

"The mmap64 subroutine is identical to the mmap subroutine except that the 
starting
offset for the file mapping is specified as a 64-bit value.  This permits file
mappings which start beyond OFF_MAX.
In the large file enabled programming environment, mmap is redefined to be 
mmap64."




What would the best way be to fix that?


--- include/portable/mmap.h     (r?vision 9705)
+++ include/portable/mmap.h     (copie de travail)
@@ -24,7 +24,9 @@
 /* Solaris 8 (at least) prototypes munmap, msync, and madvise as taking char *
    (actually a caddr_t, which is a typedef for a char *) instead of void * as
    is required by the standard.  These macros add casts that silences compiler
    warnings on Solaris 8 without adversely affecting other platforms.  (ISO C
    allows macro definitions of this sort; this macro is not recursive.) */
-#define mmap(s, l, p, f, d, o) (void *) mmap((s), (l), (p), (f), (d), (o))
+#ifndef mmap
+# define mmap(s, l, p, f, d, o)       (void *) mmap((void *)(s), (l), (p), 
(f), (d), (o))
+#endif
 #define munmap(p, l)            munmap((void *)(p), (l))


Shouldn't (void *) also be for (s) in mmap?  (as suggested in the change)
Is the "#ifndef mmap" check enough?  At least, it works fine on AIX and
also my Debian but I wonder whether it is the right fix.

-- 
Julien ?LIE

? Pour Rome, la direction importe peu, car tous les chemins y
  m?nent. ? (Ast?rix)


------------------------------

Message: 2
Date: Mon, 22 Sep 2014 11:34:16 -0700
From: Russ Allbery <[email protected]>
To: [email protected]
Subject: Re: mmap on AIX 7.1
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

Julien ?LIE <[email protected]> writes:

> When building INN on AIX 7.1 with large files support, the following
> error occurs:

> ../include/portable/mmap.h:27:0: warning: "mmap" redefined
>  #define mmap(s, l, p, f, d, o) (void *) mmap((s), (l), (p), (f), (d), (o))
>  ^
> In file included from ../include/portable/mmap.h:14:0,
>                  from dbz.c:72:
> /usr/include/sys/mman.h:87:0: note: this is the location of the previous 
> definition
>  #define mmap  mmap64
>  ^

> What would the best way be to fix that?

> --- include/portable/mmap.h     (r?vision 9705)
> +++ include/portable/mmap.h     (copie de travail)
> @@ -24,7 +24,9 @@
>  /* Solaris 8 (at least) prototypes munmap, msync, and madvise as taking char 
> *
>     (actually a caddr_t, which is a typedef for a char *) instead of void * as
>     is required by the standard.  These macros add casts that silences 
> compiler
>     warnings on Solaris 8 without adversely affecting other platforms.  (ISO C
>     allows macro definitions of this sort; this macro is not recursive.) */
> -#define mmap(s, l, p, f, d, o) (void *) mmap((s), (l), (p), (f), (d), (o))
> +#ifndef mmap
> +# define mmap(s, l, p, f, d, o)       (void *) mmap((void *)(s), (l), (p), 
> (f), (d), (o))
> +#endif
>  #define munmap(p, l)            munmap((void *)(p), (l))

I suggest just deleting that code.  Solaris 8 is pretty rare these days,
and the only downside is (harmless) compiler warnings.  Any modern
platform should have the right prototype.  This is the sort of fix that,
as soon as it starts causing actual problems, should probably just be
dropped in favor of living with the warnings on (now rare) platforms.

-- 
Russ Allbery ([email protected])              <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


------------------------------

Message: 3
Date: Mon, 22 Sep 2014 21:21:33 +0200
From: Julien ?LIE <[email protected]>
To: [email protected]
Subject: Re: mmap on AIX 7.1
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed

Hi Russ,

>> When building INN on AIX 7.1 with large files support, the following
>> error occurs:
>
>> ../include/portable/mmap.h:27:0: warning: "mmap" redefined
>>   #define mmap(s, l, p, f, d, o) (void *) mmap((s), (l), (p), (f), (d), (o))
>>   ^
>
> I suggest just deleting that code.  Solaris 8 is pretty rare these days,
> and the only downside is (harmless) compiler warnings.  Any modern
> platform should have the right prototype.  This is the sort of fix that,
> as soon as it starts causing actual problems, should probably just be
> dropped in favor of living with the warnings on (now rare) platforms.

Yep, you're right.  I've just deleted that define.

-- 
Julien ?LIE

? Pour Rome, la direction importe peu, car tous les chemins y
   m?nent. ? (Ast?rix)


------------------------------

_______________________________________________
inn-workers mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/inn-workers

End of inn-workers Digest, Vol 64, Issue 13
*******************************************

Reply via email to