Details

    • Type: Task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: None
    • Security Level: Public
    • Labels:
      None
    • Environment:
      git describe:
      1.1.5-8-gf7b3b70

      cc --version:
      Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
      Target: x86_64-apple-darwin12.4.0
      Thread model: posix

      Description

      With my nice new compiler, we now get some compilation warnings on php-ext-couchbase. None look critical, but should be reviewed.

      cc -I. -I/Users/ingenthr/src/php-ext-couchbase -DPHP_ATOM_INC -I/Users/ingenthr/src/php-ext-couchbase/include -I/Users/ingenthr/src/php-ext-couchbase/main -I/Users/ingenthr/src/php-ext-couchbase -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /Users/ingenthr/src/php-ext-couchbase/replica.c -fno-common -DPIC -o .libs/replica.o
      /Users/ingenthr/src/php-ext-couchbase/replica.c:41:9: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
      free(ret->data.v.v0.key);
      ^~~~~~~~~~~~~~~~~~
      /usr/include/stdlib.h:160:18: note: passing argument to parameter here
      void free(void *);
      ^
      /Users/ingenthr/src/php-ext-couchbase/replica.c:42:9: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
      free(ret->data.v.v0.bytes);
      ^~~~~~~~~~~~~~~~~~~~
      /usr/include/stdlib.h:160:18: note: passing argument to parameter here
      void free(void *);
      ^
      /Users/ingenthr/src/php-ext-couchbase/replica.c:46:10: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
      memcpy(ret->data.v.v0.key, r->v.v0.key, ret->data.v.v0.nkey);
      ^~~~~~~~~~~~~~~~~~
      /usr/include/secure/_string.h:55:30: note: expanded from macro 'memcpy'
      ? _builtin__memcpy_chk (dest, src, len, __darwin_obsz0 (dest)) \
      ^
      /Users/ingenthr/src/php-ext-couchbase/replica.c:46:10: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
      memcpy(ret->data.v.v0.key, r->v.v0.key, ret->data.v.v0.nkey);
      ^~~~~~~~~~~~~~~~~~
      /usr/include/secure/_string.h:56:27: note: expanded from macro 'memcpy'
      : __inline_memcpy_chk (dest, src, len))
      ^
      /usr/include/secure/string.h:59:28: note: passing argument to parameter '_dest' here
      _inline_memcpy_chk (void *dest, const void *_src, size_t __len)
      ^
      /Users/ingenthr/src/php-ext-couchbase/replica.c:47:10: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
      memcpy(ret->data.v.v0.bytes, r->v.v0.bytes, ret->data.v.v0.nbytes);
      ^~~~~~~~~~~~~~~~~~~~
      /usr/include/secure/_string.h:55:30: note: expanded from macro 'memcpy'
      ? _builtin__memcpy_chk (dest, src, len, __darwin_obsz0 (dest)) \
      ^
      /Users/ingenthr/src/php-ext-couchbase/replica.c:47:10: warning: passing 'const void *' to parameter of type 'void *'
      discards qualifiers [-Wincompatible-pointer-types]
      memcpy(ret->data.v.v0.bytes, r->v.v0.bytes, ret->data.v.v0.nbytes);
      ^~~~~~~~~~~~~~~~~~~~
      /usr/include/secure/_string.h:56:27: note: expanded from macro 'memcpy'
      : __inline_memcpy_chk (dest, src, len))
      ^
      /usr/include/secure/string.h:59:28: note: passing argument to parameter '_dest' here
      _inline_memcpy_chk (void *dest, const void *_src, size_t __len)
      ^
      /Users/ingenthr/src/php-ext-couchbase/replica.c:142:32: warning: passing 'const char *' to parameter of type 'char *'
      discards qualifiers [-Wincompatible-pointer-types]
      add_assoc_string(r, "error", lcb_strerror(NULL, e->error), 1);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /usr/include/php/Zend/zend_API.h:371:111: note: expanded from macro 'add_assoc_string'
      ..._key, __str, __duplicate) add_assoc_string_ex(arg, __key, strlen(_key)+1, __str, __duplicate)
      ^
      /usr/include/php/Zend/zend_API.h:362:82: note: passing argument to parameter 'str' here
      ZEND_API int add_assoc_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate);
      ^
      /Users/ingenthr/src/php-ext-couchbase/replica.c:358:56: warning: passing 'lcb_get_replica_cmd_t **'
      (aka 'struct lcb_get_replica_cmd_st **') to parameter of type 'const lcb_get_replica_cmd_t *const *' (aka 'const
      struct lcb_get_replica_cmd_st *const *') discards qualifiers in nested pointer types [-Wincompatible-pointer-types]
      retval = lcb_get_replica(instance, &cookie, num_docs, commands);
      ^~~~~~~~
      /usr/local/include/libcouchbase/couchbase.h:314:69: note: passing argument to parameter 'commands' here
      const lcb_get_replica_cmd_t *const *commands);
      ^

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        ingenthr Matt Ingenthron created issue -
        trond Trond Norbye made changes -
        Field Original Value New Value
        Priority Major [ 3 ] Minor [ 4 ]
        trond Trond Norbye made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Show
        trond Trond Norbye added a comment - http://review.couchbase.org/28531
        trond Trond Norbye made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s .next [ 11022 ]
        Resolution Fixed [ 1 ]
        brett19 Brett Lawson made changes -
        Workflow jira [ 28563 ] Couchbase SDK Workflow [ 44441 ]

          People

          • Assignee:
            trond Trond Norbye
            Reporter:
            ingenthr Matt Ingenthron
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes