You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Julian Foad <ju...@btopenworld.com> on 2004/11/13 21:19:52 UTC

[PATCH] Fix 'apr_private.h:714:5: warning: "BEOS" is not defined'

I get this warning frequently when building Subversion against APR.  This patch 
appears to be the correct fix (rather than ensuring that BEOS is always 
defined) because the symbol is always tested in this way elsewhere in APR.

I have just subscribed to this mailing list.  Please let me know if there is 
anything else I can do to get this into APR.

- Julian


Index: acconfig.h
===================================================================
RCS file: /home/cvspublic/apr/acconfig.h,v
retrieving revision 1.67
diff -u -3 -p -d -r1.67 acconfig.h
--- acconfig.h  17 Nov 2003 14:25:35 -0000      1.67
+++ acconfig.h  13 Nov 2004 19:43:30 -0000
@@ -19,7 +19,7 @@
  #undef ssize_t

  /* switch this on if we have a BeOS version below BONE */
-#if BEOS && !HAVE_BONE_VERSION
+#if defined(BEOS) && !HAVE_BONE_VERSION
  #define BEOS_R5 1
  #else
  #define BEOS_BONE 1

[PATCH] Fix 'warning: "APR_HAS_SIGACTION" is not defined'

Posted by Julian Foad <ju...@btopenworld.com>.
Judging by usage elsewhere in the same and other files, the wrong symbol was 
being tested.

Index: threadproc/unix/signals.c
===================================================================
RCS file: /home/cvspublic/apr/threadproc/unix/signals.c,v
retrieving revision 1.59
diff -u -3 -p -d -r1.59 signals.c
--- threadproc/unix/signals.c   22 Apr 2004 08:23:23 -0000      1.59
+++ threadproc/unix/signals.c   13 Nov 2004 21:24:24 -0000
@@ -427,7 +427,7 @@ APR_DECLARE(apr_status_t) apr_setup_sign

  APR_DECLARE(apr_status_t) apr_signal_block(int signum)
  {
-#if APR_HAS_SIGACTION
+#if APR_HAVE_SIGACTION
      sigset_t sig_mask;
      int rv;

@@ -454,7 +454,7 @@ APR_DECLARE(apr_status_t) apr_signal_blo

  APR_DECLARE(apr_status_t) apr_signal_unblock(int signum)
  {
-#if APR_HAS_SIGACTION
+#if APR_HAVE_SIGACTION
      sigset_t sig_mask;
      int rv;

- Julian

[PATCH] Fix 'apr_private.h:714:5: warning: "BEOS" is not defined'

Posted by Julian Foad <ju...@btopenworld.com>.
Julian Foad wrote:
>> apr-util/misc/apr_queue.c:15:5: warning: "APR_HAVE_STDIO_H" is not defined
>> apr-util/misc/apr_queue.c:18:5: warning: "APR_HAVE_STDLIB_H" is not defined
>> apr-util/misc/apr_queue.c:21:5: warning: "APR_HAVE_UNISTD_H" is not defined

Judgind by another file in the same directory, this needs to include "apr.h" 
which defines the symbols that it is testing.

Index: misc/apr_queue.c
===================================================================
RCS file: /home/cvspublic/apr-util/misc/apr_queue.c,v
retrieving revision 1.14
diff -u -3 -p -d -r1.14 apr_queue.c
--- misc/apr_queue.c    29 Sep 2004 18:02:08 -0000      1.14
+++ misc/apr_queue.c    13 Nov 2004 21:31:22 -0000
@@ -12,6 +12,9 @@
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
+
+#include "apr.h"
+
  #if APR_HAVE_STDIO_H
  #include <stdio.h>
  #endif

Please tell me if I should do anything more or different to help get this fixed.

- Julian

Re: [PATCH] Fix 'apr_private.h:714:5: warning: "BEOS" is not defined'

Posted by Julian Foad <ju...@btopenworld.com>.
I also get the following warnings from similar inconsistencies in other APR files:

> apr/file_io/unix/pipe.c:27:5: warning: "BEOS" is not defined
> apr/file_io/unix/pipe.c:37:6: warning: "BEOS_BLOCKING" is not defined
> apr/file_io/unix/pipe.c:73:6: warning: "BEOS_BLOCKING" is not defined
> apr/file_io/unix/readwrite.c:23:6: warning: "BEOS_R5" is not defined
> apr/support/unix/waitio.c:24:6: warning: "BEOS_R5" is not defined
> apr/threadproc/unix/signals.c:430:5: warning: "APR_HAS_SIGACTION" is not defined
> apr/threadproc/unix/signals.c:457:5: warning: "APR_HAS_SIGACTION" is not defined
> apr-util/misc/apr_queue.c:15:5: warning: "APR_HAVE_STDIO_H" is not defined
> apr-util/misc/apr_queue.c:18:5: warning: "APR_HAVE_STDLIB_H" is not defined
> apr-util/misc/apr_queue.c:21:5: warning: "APR_HAVE_UNISTD_H" is not defined

- Julian

Re: [PATCH] Fix various inconsistencies and a bug

Posted by Julian Foad <ju...@btopenworld.com>.
kfogel@collab.net wrote:
> I think it would be mildly better for them to be four separate commits.

Quite right.  Seprate submissions coming up.

- Julian

Re: [PATCH] Fix various inconsistencies and a bug

Posted by kf...@collab.net.
Julian Foad <ju...@btopenworld.com> writes:
> This patch contains all of the changes I have posted so far in this
> thread, and more, now as a Subversion diff, with log messages.
> 
> The one bug fixed here is that the functions apr_signal_block and
> apr_signal_unblock were not being implemented because they were
> testing for APR_HAS_SIGACTION instead of APR_HAVE_SIGACTION.
> 
> All of the other changes are to resolve inconsistencies that I found
> from compiler warnings.  (SuSE 9.1 GNU/Linux, GCC 3.3.3 with extra
> warnings enabled).
> 
> - Julian
> 
> Fix some inconsistencies and a bug that compiler warnings alerted me to.
> 
> * apr/acconfig.h
>   Test whether "BEOS" is defined, not whether it is non-zero.
> 
> * apr/file_io/unix/tempdir.c
>   (test_tempdir): Remove "const" to avoid casting it away.
> 
> * apr/network_io/unix/sendrecv.c
>   (apr_socket_sendfile): Remove a spurious carriage return from the source.
> 
> * apr/threadproc/unix/signals.c
>   (apr_signal_block, apr_signal_unblock): Test the correct symbol, so that
>     these functions will actually be implemented on appropriate platforms.

Even though these are all "cleanups", that's basically the only thing
they have in common.  (Well, possibly 1 and 4 could be combined, but
even that's questionable).  I think it would be mildly better for them
to be four separate commits.

> [diffs for above omitted]

> Fix some inconsistencies that compiler warnings alerted me to.
> No functional change.
> 
> * apr-util/crypto/apr_md5.c
>   (apr_md5_encode): Remove unnecessary type casts that were casting away "const".
> 
> * apr-util/misc/apr_queue.c
>   Include the header that defines the symbols we are testing.

Similar sentiment applies to these.

Wow, you are Mr. Cleanup this month!  (Not complaining, mind you.)

-K

[PATCH] Fix various inconsistencies and a bug

Posted by Julian Foad <ju...@btopenworld.com>.
This patch contains all of the changes I have posted so far in this thread, and 
more, now as a Subversion diff, with log messages.

The one bug fixed here is that the functions apr_signal_block and 
apr_signal_unblock were not being implemented because they were testing for 
APR_HAS_SIGACTION instead of APR_HAVE_SIGACTION.

All of the other changes are to resolve inconsistencies that I found from 
compiler warnings.  (SuSE 9.1 GNU/Linux, GCC 3.3.3 with extra warnings enabled).

- Julian


Re: [PATCH] Fix 'apr_private.h:714:5: warning: "BEOS" is not defined'

Posted by Julian Foad <ju...@btopenworld.com>.
Julian Foad wrote:
> I get this warning frequently when building Subversion against APR.  

To be accurate, I meant "when building APR, which I do as part of a Subversion 
build".

- Julian