Bug 1155181 - Lots of compilation warnings on OSX. We should probably fix them.
Summary: Lots of compilation warnings on OSX. We should probably fix them.
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: GlusterFS
Classification: Community
Component: build
Version: mainline
Hardware: x86_64
OS: Mac OS
low
low
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
: 1408784 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-21 14:08 UTC by Justin Clift
Modified: 2020-03-12 12:50 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-12 12:50:49 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)
Configure and compile log for OSX 10.8 (116.16 KB, text/plain)
2014-10-21 14:08 UTC, Justin Clift
no flags Details

Description Justin Clift 2014-10-21 14:08:25 UTC
Created attachment 948969 [details]
Configure and compile log for OSX 10.8

Description of problem:

  When compiling GlusterFS (git master head) on OSX 10.8, many warnings show
  up which aren't seem on EL6.

  Most of these warnings are likely of little consequence, but some may be
  signs of potential problems.

  We should probably look over all of these warnings, and resolve them (in
  order of importance).


Version-Release number of selected component (if applicable):

  GlusterFS git master branch head, as of Tue 21st October 2014.


Full compile and make -j3 log is attached to this BZ, and I'll also cut-n-paste the more obvious bits below for easier initial look-over.

Compile options were:

  $ ./configure --prefix=/usr/local/Cellar/glusterfs/HEAD --with-mountutildir=/usr/local/Cellar/glusterfs/HEAD/sbin --with-initdir=/usr/local/etc --with-launchddir=/usr/local/Cellar/glusterfs/HEAD/Library/LaunchDaemons/ --disable-systemtap --enable-glupy

*************************************************************************
  CC       libglusterfs_la-common-utils.lo
common-utils.c:70:9: warning: 'MD5' is deprecated [-Wdeprecated-declarations]
        MD5(data, len, scratch);
        ^
/usr/include/openssl/md5.h:116:16: note: 'MD5' declared here
unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
               ^
1 warning generated.
  CC       libglusterfs_la-checksum.lo
checksum.c:64:9: warning: 'MD5' is deprecated [-Wdeprecated-declarations]
        MD5(data, len, md5);
        ^
/usr/include/openssl/md5.h:116:16: note: 'MD5' declared here
unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
               ^
1 warning generated.
  CC       libglusterfs_la-syncop.lo
syncop.c:298:13: warning: 'swapcontext' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
        if (swapcontext (&task->ctx, &task->proc->sched) < 0) {
            ^
/usr/include/ucontext.h:40:6: note: 'swapcontext' declared here
int  swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0);
     ^
syncop.c:434:13: warning: 'getcontext' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
        if (getcontext (&newtask->ctx) < 0) {
            ^
/usr/include/ucontext.h:37:6: note: 'getcontext' declared here
int  getcontext(ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0);
     ^
syncop.c:451:9: warning: 'makecontext' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
        makecontext (&newtask->ctx, (void (*)(void)) synctask_wrap, 2, newtask);
        ^
/usr/include/ucontext.h:38:6: note: 'makecontext' declared here
void makecontext(ucontext_t *, void (*)(), int, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0);
     ^
syncop.c:580:13: warning: 'swapcontext' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
        if (swapcontext (&task->proc->sched, &task->ctx) < 0) {
            ^
/usr/include/ucontext.h:40:6: note: 'swapcontext' declared here
int  swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0);
     ^
4 warnings generated.
  CC       libglusterfs_la-event-epoll.lo
  CC       libglusterfs_la-execinfo.lo
  CCLD     libglusterfs.la
/usr/bin/ranlib: file: .libs/libglusterfs.a(libglusterfs_la-event-epoll.o) has no symbols
/usr/bin/ranlib: file: .libs/libglusterfs.a(libglusterfs_la-execinfo.o) has no symbols
ranlib: file: .libs/libglusterfs.a(libglusterfs_la-event-epoll.o) has no symbols
ranlib: file: .libs/libglusterfs.a(libglusterfs_la-execinfo.o) has no symbols
Making all in src
  CC       rpcsvc.lo
rpcsvc.c:943:54: warning: format specifies type 'unsigned int' but the argument has type 'u_long' (aka 'unsigned long') [-Wformat]
                        "xid (%" GF_PRI_RPC_XID ")", xid);
                                                     ^~~
../../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
rpcsvc.c:943:54: warning: format specifies type 'unsigned int' but the argument has type 'u_long' (aka 'unsigned long') [-Wformat]
                        "xid (%" GF_PRI_RPC_XID ")", xid);
                              ~~~                    ^~~
../../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
2 warnings generated.
Making all in src
  CC       socket.lo
socket.c:186:19: warning: 'ERR_get_error' is deprecated [-Wdeprecated-declarations]
        while ((errnum = ERR_get_error())) {
                         ^
/usr/include/openssl/err.h:266:15: note: 'ERR_get_error' declared here
unsigned long ERR_get_error(void) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
              ^
socket.c:187:3: warning: 'ERR_error_string' is deprecated [-Wdeprecated-declarations]
                ERR_error_string(errnum,errbuf);
                ^
/usr/include/openssl/err.h:279:7: note: 'ERR_error_string' declared here
char *ERR_error_string(unsigned long e,char *buf) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
      ^
socket.c:224:11: warning: 'SSL_get_error' is deprecated [-Wdeprecated-declarations]
                switch (SSL_get_error(priv->ssl_ssl,r)) {
                        ^
/usr/include/openssl/ssl.h:1501:5: note: 'SSL_get_error' declared here
int     SSL_get_error(const SSL *s,int ret_code) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:274:18: warning: 'SSL_new' is deprecated [-Wdeprecated-declarations]
        priv->ssl_ssl = SSL_new(priv->ssl_ctx);
                        ^
/usr/include/openssl/ssl.h:1481:7: note: 'SSL_new' declared here
SSL *   SSL_new(SSL_CTX *ctx) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:280:19: warning: 'BIO_new_socket' is deprecated [-Wdeprecated-declarations]
        priv->ssl_sbio = BIO_new_socket(priv->sock,BIO_NOCLOSE);
                         ^
/usr/include/openssl/bio.h:685:6: note: 'BIO_new_socket' declared here
BIO *BIO_new_socket(int sock, int close_flag) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
     ^
socket.c:286:2: warning: 'SSL_set_bio' is deprecated [-Wdeprecated-declarations]
        SSL_set_bio(priv->ssl_ssl,priv->ssl_sbio,priv->ssl_sbio);
        ^
/usr/include/openssl/ssl.h:1375:6: note: 'SSL_set_bio' declared here
void    SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:289:9: warning: 'SSL_accept' is deprecated [-Wdeprecated-declarations]
                ret = ssl_accept_one(this);
                      ^
socket.c:259:68: note: expanded from macro 'ssl_accept_one'
#define ssl_accept_one(t)    ssl_do((t),NULL,0,(SSL_trinary_func *)SSL_accept)
                                                                   ^
/usr/include/openssl/ssl.h:1491:6: note: 'SSL_accept' declared here
int     SSL_accept(SSL *ssl) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:292:9: warning: 'SSL_connect' is deprecated [-Wdeprecated-declarations]
                ret = ssl_connect_one(this);
                      ^
socket.c:258:68: note: expanded from macro 'ssl_connect_one'
#define ssl_connect_one(t)   ssl_do((t),NULL,0,(SSL_trinary_func *)SSL_connect)
                                                                   ^
/usr/include/openssl/ssl.h:1492:6: note: 'SSL_connect' declared here
int     SSL_connect(SSL *ssl) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:301:6: warning: 'SSL_get_verify_result' is deprecated [-Wdeprecated-declarations]
        if (SSL_get_verify_result(priv->ssl_ssl) != X509_V_OK) {
            ^
/usr/include/openssl/ssl.h:1584:6: note: 'SSL_get_verify_result' declared here
long SSL_get_verify_result(const SSL *ssl) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
     ^
socket.c:304:9: warning: 'SSL_get_peer_certificate' is deprecated [-Wdeprecated-declarations]
        peer = SSL_get_peer_certificate(priv->ssl_ssl);
               ^
/usr/include/openssl/ssl.h:1450:8: note: 'SSL_get_peer_certificate' declared here
X509 *  SSL_get_peer_certificate(const SSL *s) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:310:2: warning: 'X509_NAME_get_text_by_NID' is deprecated [-Wdeprecated-declarations]
        X509_NAME_get_text_by_NID(X509_get_subject_name(peer),
        ^
/usr/include/openssl/x509.h:1098:7: note: 'X509_NAME_get_text_by_NID' declared here
int             X509_NAME_get_text_by_NID(X509_NAME *name, int nid,
                ^
socket.c:310:28: warning: 'X509_get_subject_name' is deprecated [-Wdeprecated-declarations]
        X509_NAME_get_text_by_NID(X509_get_subject_name(peer),
                                  ^
/usr/include/openssl/x509.h:1013:13: note: 'X509_get_subject_name' declared here
X509_NAME *     X509_get_subject_name(X509 *a) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
                ^
socket.c:321:2: warning: 'SSL_free' is deprecated [-Wdeprecated-declarations]
        SSL_free(priv->ssl_ssl);
        ^
/usr/include/openssl/ssl.h:1490:6: note: 'SSL_free' declared here
void    SSL_free(SSL *ssl) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:331:9: warning: 'SSL_shutdown' is deprecated [-Wdeprecated-declarations]
        SSL_shutdown(priv->ssl_ssl);
        ^
/usr/include/openssl/ssl.h:1532:5: note: 'SSL_shutdown' declared here
int SSL_shutdown(SSL *s) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
    ^
socket.c:332:9: warning: 'SSL_clear' is deprecated [-Wdeprecated-declarations]
        SSL_clear(priv->ssl_ssl);
        ^
/usr/include/openssl/ssl.h:1353:5: note: 'SSL_clear' declared here
int     SSL_clear(SSL *s) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:333:9: warning: 'SSL_free' is deprecated [-Wdeprecated-declarations]
        SSL_free(priv->ssl_ssl);
        ^
/usr/include/openssl/ssl.h:1490:6: note: 'SSL_free' declared here
void    SSL_free(SSL *ssl) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:350:9: warning: 'SSL_read' is deprecated [-Wdeprecated-declarations]
                ret = ssl_read_one (this, opvector->iov_base, opvector->iov_len);
                      ^
socket.c:260:69: note: expanded from macro 'ssl_read_one'
#define ssl_read_one(t,b,l)  ssl_do((t),(b),(l),(SSL_trinary_func *)SSL_read)
                                                                    ^
/usr/include/openssl/ssl.h:1493:6: note: 'SSL_read' declared here
int     SSL_read(SSL *ssl,void *buf,int num) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:499:11: warning: 'SSL_write' is deprecated [-Wdeprecated-declarations]
                                ret = ssl_write_one(this,
                                      ^
socket.c:261:69: note: expanded from macro 'ssl_write_one'
#define ssl_write_one(t,b,l) ssl_do((t),(b),(l),(SSL_trinary_func *)SSL_write)
                                                                    ^
/usr/include/openssl/ssl.h:1495:6: note: 'SSL_write' declared here
int     SSL_write(SSL *ssl,const void *buf,int num) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:1758:35: warning: implicit conversion from enumeration type 'sp_rpcfrag_vectored_reply_accepted_state_t' to different enumeration type 'sp_rpcfrag_vectored_reply_status_state_t' [-Wenum-conversion]
                                = SP_STATE_ACCEPTED_REPLY_INIT;
                                ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
socket.c:1889:41: warning: comparison of constant 42 with expression of type 'msg_type_t' (aka 'enum msg_type') is always false [-Wtautological-constant-out-of-range-compare]
                } else if (in->msg_type == GF_UNIVERSAL_ANSWER) {
                           ~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~
socket.c:1907:39: warning: implicit conversion from enumeration type 'sp_rpcrecord_state_t' to different enumeration type 'sp_rpcfrag_state_t' [-Wenum-conversion]
                        frag->state = SP_STATE_NADA;
                                    ~ ^~~~~~~~~~~~~
socket.c:2230:41: warning: implicit conversion from enumeration type 'glusterfs_event_t' to different enumeration type 'rpc_transport_event_t' [-Wenum-conversion]
                                event = GF_EVENT_POLLERR;
                                      ~ ^~~~~~~~~~~~~~~~
socket.c:3773:3: warning: 'SSL_library_init' is deprecated [-Wdeprecated-declarations]
                SSL_library_init();
                ^
/usr/include/openssl/ssl.h:1553:5: note: 'SSL_library_init' declared here
int SSL_library_init(void ) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
    ^
socket.c:3774:3: warning: 'SSL_load_error_strings' is deprecated [-Wdeprecated-declarations]
                SSL_load_error_strings();
                ^
/usr/include/openssl/ssl.h:1416:6: note: 'SSL_load_error_strings' declared here
void    SSL_load_error_strings(void ) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:3775:34: warning: 'TLSv1_method' is deprecated [-Wdeprecated-declarations]
                priv->ssl_meth = (SSL_METHOD *)TLSv1_method();
                                               ^
/usr/include/openssl/ssl.h:1519:13: note: 'TLSv1_method' declared here
SSL_METHOD *TLSv1_method(void) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;           /* TLSv1.0 */
            ^
socket.c:3776:19: warning: 'SSL_CTX_new' is deprecated [-Wdeprecated-declarations]
                priv->ssl_ctx = SSL_CTX_new(priv->ssl_meth);
                                ^
/usr/include/openssl/ssl.h:1346:10: note: 'SSL_CTX_new' declared here
SSL_CTX *SSL_CTX_new(SSL_METHOD *meth) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
         ^
socket.c:3778:21: warning: 'SSL_CTX_set_cipher_list' is deprecated [-Wdeprecated-declarations]
                if (SSL_CTX_set_cipher_list(priv->ssl_ctx, cipher_list) == 0) {
                    ^
/usr/include/openssl/ssl.h:1345:5: note: 'SSL_CTX_set_cipher_list' declared here
int     SSL_CTX_set_cipher_list(SSL_CTX *,const char *str) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:3784:8: warning: 'SSL_CTX_use_certificate_chain_file' is deprecated [-Wdeprecated-declarations]
                if (!SSL_CTX_use_certificate_chain_file(priv->ssl_ctx,
                     ^
/usr/include/openssl/ssl.h:1403:5: note: 'SSL_CTX_use_certificate_chain_file' declared here
int     SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER; /* PEM type */
        ^
socket.c:3791:8: warning: 'SSL_CTX_use_PrivateKey_file' is deprecated [-Wdeprecated-declarations]
                if (!SSL_CTX_use_PrivateKey_file(priv->ssl_ctx,
                     ^
/usr/include/openssl/ssl.h:1401:5: note: 'SSL_CTX_use_PrivateKey_file' declared here
int     SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
        ^
socket.c:3799:8: warning: 'SSL_CTX_load_verify_locations' is deprecated [-Wdeprecated-declarations]
                if (!SSL_CTX_load_verify_locations(priv->ssl_ctx,
                     ^
/usr/include/openssl/ssl.h:1571:5: note: 'SSL_CTX_load_verify_locations' declared here
int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,
    ^
socket.c:3811:3: warning: 'SSL_CTX_set_session_id_context' is deprecated [-Wdeprecated-declarations]
                SSL_CTX_set_session_id_context(priv->ssl_ctx,
                ^
/usr/include/openssl/ssl.h:1478:5: note: 'SSL_CTX_set_session_id_context' declared here
int     SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx,
        ^
socket.c:3815:3: warning: 'SSL_CTX_set_verify' is deprecated [-Wdeprecated-declarations]
                SSL_CTX_set_verify(priv->ssl_ctx,SSL_VERIFY_PEER,0);
                ^
/usr/include/openssl/ssl.h:1458:6: note: 'SSL_CTX_set_verify' declared here
void SSL_CTX_set_verify(SSL_CTX *ctx,int mode,
     ^
32 warnings generated.
  CCLD     libgfapi.la

*** Warning: Linking the shared library libgfapi.la against the
*** static library ../../contrib/argp-standalone/libargp.a is not portable!
  CCLD     api.la
  CC       afr-self-heald.lo
afr-self-heald.c:1198:25: warning: comparison of constant -1 with expression of type 'unsigned char' is always false [-Wtautological-constant-out-of-range-compare]
                if (priv->child_up[i] == -1)
                    ~~~~~~~~~~~~~~~~~ ^  ~~
1 warning generated.
  CC       dht-common.lo
dht-common.c:1833:44: warning: comparison of constant 2 with expression of type 'gf_boolean_t' (aka 'enum _gf_boolean') is always false [-Wtautological-constant-out-of-range-compare]
                if ((conf->search_unhashed == GF_DHT_LOOKUP_UNHASHED_AUTO) &&
                     ~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~
dht-common.c:3812:43: warning: comparison of constant 2 with expression of type 'gf_boolean_t' (aka 'enum _gf_boolean') is always false [-Wtautological-constant-out-of-range-compare]
                if (conf->search_unhashed == GF_DHT_LOOKUP_UNHASHED_AUTO) {
                    ~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC       ec-common.lo
ec-common.c:1068:13: warning: variable 'lock' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        if ((ctx != NULL) && !list_empty(&ctx->inode_locks))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ec-common.c:1079:13: note: uninitialized use occurs here
        if (lock != NULL)
            ^~~~
ec-common.c:1068:9: note: remove the 'if' if its condition is always true
        if ((ctx != NULL) && !list_empty(&ctx->inode_locks))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ec-common.c:1068:13: warning: variable 'lock' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
        if ((ctx != NULL) && !list_empty(&ctx->inode_locks))
            ^~~~~~~~~~~~~
ec-common.c:1079:13: note: uninitialized use occurs here
        if (lock != NULL)
            ^~~~
ec-common.c:1068:13: note: remove the '&&' if its condition is always true
        if ((ctx != NULL) && !list_empty(&ctx->inode_locks))
            ^~~~~~~~~~~~~~~~
ec-common.c:999:21: note: initialize the variable 'lock' to silence this warning
    ec_lock_t * lock;
                    ^
                     = NULL
2 warnings generated.
  CC       ec-combine.lo
ec-combine.c:79:20: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_ino, src->ia_ino, dst->ia_nlink, src->ia_nlink,
                   ^~~~~~~~~~~
../../../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
ec-combine.c:79:33: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_ino, src->ia_ino, dst->ia_nlink, src->ia_nlink,
                                ^~~~~~~~~~~
../../../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
ec-combine.c:81:20: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_rdev, src->ia_rdev, dst->ia_size, src->ia_size,
                   ^~~~~~~~~~~~
../../../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
ec-combine.c:81:34: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_rdev, src->ia_rdev, dst->ia_size, src->ia_size,
                                 ^~~~~~~~~~~~
../../../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
ec-combine.c:81:48: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_rdev, src->ia_rdev, dst->ia_size, src->ia_size,
                                               ^~~~~~~~~~~~
../../../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
ec-combine.c:81:62: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_rdev, src->ia_rdev, dst->ia_size, src->ia_size,
                                                             ^~~~~~~~~~~~
../../../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
ec-combine.c:79:20: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_ino, src->ia_ino, dst->ia_nlink, src->ia_nlink,
                   ^~~~~~~~~~~
../../../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
ec-combine.c:79:33: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_ino, src->ia_ino, dst->ia_nlink, src->ia_nlink,
                                ^~~~~~~~~~~
../../../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
ec-combine.c:81:20: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_rdev, src->ia_rdev, dst->ia_size, src->ia_size,
                   ^~~~~~~~~~~~
../../../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
ec-combine.c:81:34: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_rdev, src->ia_rdev, dst->ia_size, src->ia_size,
                                 ^~~~~~~~~~~~
../../../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
ec-combine.c:81:48: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_rdev, src->ia_rdev, dst->ia_size, src->ia_size,
                                               ^~~~~~~~~~~~
../../../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
ec-combine.c:81:62: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
                   dst->ia_rdev, src->ia_rdev, dst->ia_size, src->ia_size,
                                                             ^~~~~~~~~~~~
../../../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
12 warnings generated.
  CC       server-helpers.lo
server-helpers.c:60:57: warning: passing 'gid_t [65535]' to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign]
        ret = getgrouplist (result->pw_name, root->gid, mygroups, &ngroups);
                                                        ^~~~~~~~
/usr/include/unistd.h:688:43: note: passing argument to parameter here
int      getgrouplist(const char *, int, int *, int *);
                                              ^
1 warning generated.
  CC       barrier.lo
barrier.c:356:37: warning: comparison of constant -1 with expression of type 'gf_boolean_t' (aka 'enum _gf_boolean') is always false [-Wtautological-constant-out-of-range-compare]
                if (barrier_enabled == -1) {
                    ~~~~~~~~~~~~~~~ ^  ~~
1 warning generated.
  CC       coroutine-ucontext.lo
../../../../contrib/qemu/coroutine-ucontext.c:139:9: warning: 'getcontext' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
    if (getcontext(&uc) == -1) {
        ^
/usr/include/ucontext.h:37:6: note: 'getcontext' declared here
int  getcontext(ucontext_t *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0);
     ^
../../../../contrib/qemu/coroutine-ucontext.c:159:5: warning: 'makecontext' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
    makecontext(&uc, (void (*)(void))coroutine_trampoline,
    ^
/usr/include/ucontext.h:38:6: note: 'makecontext' declared here
void makecontext(ucontext_t *, void (*)(), int, ...) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0);
     ^
../../../../contrib/qemu/coroutine-ucontext.c:164:9: warning: 'swapcontext' is deprecated: first deprecated in OS X 10.6 [-Wdeprecated-declarations]
        swapcontext(&old_uc, &uc);
        ^
/usr/include/ucontext.h:40:6: note: 'swapcontext' declared here
int  swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_5, __MAC_10_6, __IPHONE_2_0, __IPHONE_2_0);
     ^
3 warnings generated.
  CC       json-lexer.lo
../../../../contrib/qemu/qobject/json-lexer.c:110:18: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
        ['\\'] = IN_DQ_STRING_ESCAPE,
                 ^~~~~~~~~~~~~~~~~~~
../../../../contrib/qemu/qobject/json-lexer.c:108:24: note: previous initialization is here
        [1 ... 0xBF] = IN_DQ_STRING,
                       ^~~~~~~~~~~~
../../../../contrib/qemu/qobject/json-lexer.c:111:17: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
        ['"'] = JSON_STRING,
                ^~~~~~~~~~~
../../../../contrib/qemu/qobject/json-lexer.c:108:24: note: previous initialization is here
        [1 ... 0xBF] = IN_DQ_STRING,
                       ^~~~~~~~~~~~
../../../../contrib/qemu/qobject/json-lexer.c:150:18: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
        ['\\'] = IN_SQ_STRING_ESCAPE,
                 ^~~~~~~~~~~~~~~~~~~

[tonnes of repeats here snipped due to 64k comment max length]

80 warnings generated.
  CC       snapview-server-helpers.lo
snapview-server-helpers.c:123:63: warning: too many arguments in call to 'svs_inode_new'
                        svs_inode = svs_inode_new (this, inode);
                                    ~~~~~~~~~~~~~             ^
snapview-server-helpers.c:246:38: warning: too many arguments in call to 'svs_fd_new'
        svs_fd = svs_fd_new (this, fd);
                 ~~~~~~~~~~          ^
2 warnings generated.
  CC       glusterd_la-glusterd-handler.lo
glusterd-handler.c:667:55: warning: implicit conversion from enumeration type 'enum glusterd_op_sm_event_type_' to different enumeration type 'glusterd_op_t' (aka 'enum glusterd_op_') [-Wenum-conversion]
        glusterd_op_t                   op          = GD_OP_EVENT_LOCK;
                                        ~~            ^~~~~~~~~~~~~~~~
  CC       glusterd_la-glusterd-utils.lo
glusterd-utils.c:5402:47: warning: incompatible pointer types passing 'time_t *' (aka 'long *') to parameter of type 'int64_t *' (aka 'long long *') [-Wincompatible-pointer-types]
        ret = dict_get_int64 (peer_data, buf, &snap->time_stamp);
                                              ^~~~~~~~~~~~~~~~~
../../../../libglusterfs/src/dict.h:203:69: note: passing argument to parameter 'val' here
GF_MUST_CHECK int dict_get_int64 (dict_t *this, char *key, int64_t *val);
                                                                    ^
1 warning generated.
1 warning generated.
  CC       glusterd_la-glusterd-snapshot.lo
glusterd-snapshot.c:1090:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
        if ((value < 0) || (value > max_limit)) {
             ~~~~~ ^ ~
glusterd-snapshot.c:1174:41: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                        if ((soft_limit < 0) || (soft_limit > max_limit)) {
                             ~~~~~~~~~~ ^ ~
glusterd-snapshot.c:6604:60: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
                snprintf (key, sizeof (key), "volname%ld", i);
                                                     ~~~   ^
                                                     %lld
/usr/include/secure/_stdio.h:56:62: note: expanded from macro 'snprintf'
  __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                             ^
3 warnings generated.
  CC       cli.o
cli.c:363:38: warning: comparison of constant -1 with expression of type 'gf_loglevel_t' is always false [-Wtautological-constant-out-of-range-compare]
                if (state->log_level == -1)
                    ~~~~~~~~~~~~~~~~ ^  ~~
1 warning generated.
  CC       cli-cmd-parser.o
cli-cmd-parser.c:2445:46: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                if (blk_size < 0)
                                    ~~~~~~~~ ^ ~
cli-cmd-parser.c:2460:43: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                if (count < 0)
                                    ~~~~~ ^ ~
2 warnings generated.
  CCLD     glfsheal

*** Warning: Linking the executable glfsheal against the loadable module
*** afr.so is not portable!
*** Warning: lib afr.so is a module, not a shared library
Making all in contrib/umountd
  CC       umountd-umountd.o
umountd.c:54:53: warning: data argument not used by format string [-Wformat-extra-args]
                        "Cannot access %s\n", path, strerror (errno));
                        ~~~~~~~~~~~~~~~~~~~~        ^
../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
umountd.c:54:53: warning: data argument not used by format string [-Wformat-extra-args]
                        "Cannot access %s\n", path, strerror (errno));
                        ~~~~~~~~~~~~~~~~~~~~        ^
../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
umountd.c:67:55: warning: data argument not used by format string [-Wformat-extra-args]
                        "Cannot access %s\n", parent, strerror (errno));
                        ~~~~~~~~~~~~~~~~~~~~          ^
../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
umountd.c:67:55: warning: data argument not used by format string [-Wformat-extra-args]
                        "Cannot access %s\n", parent, strerror (errno));
                        ~~~~~~~~~~~~~~~~~~~~          ^
../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
umountd.c:159:39: warning: data argument not used by format string [-Wformat-extra-args]
                                path, strerror (errno));
                                      ^
../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
umountd.c:159:39: warning: data argument not used by format string [-Wformat-extra-args]
                                path, strerror (errno));
                                      ^
../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
umountd.c:169:41: warning: format specifies type 'long long' but the argument has type 'dev_t' (aka 'int') [-Wformat]
                                        dev, stbuf.st_dev, path);
                                        ^~~
../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
umountd.c:169:46: warning: format specifies type 'long long' but the argument has type 'dev_t' (aka 'int') [-Wformat]
                                        dev, stbuf.st_dev, path);
                                             ^~~~~~~~~~~~
../../libglusterfs/src/logging.h:260:27: note: expanded from macro 'gf_log'
                FMT_WARN (fmt);                                         \
                          ^
../../libglusterfs/src/logging.h:211:46: note: expanded from macro 'FMT_WARN'
#define FMT_WARN(fmt...) do { if (0) printf (fmt); } while (0)
                                             ^
umountd.c:169:41: warning: format specifies type 'long long' but the argument has type 'dev_t' (aka 'int') [-Wformat]
                                        dev, stbuf.st_dev, path);
                                        ^~~
../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
umountd.c:169:46: warning: format specifies type 'long long' but the argument has type 'dev_t' (aka 'int') [-Wformat]
                                        dev, stbuf.st_dev, path);
                                             ^~~~~~~~~~~~
../../libglusterfs/src/logging.h:262:34: note: expanded from macro 'gf_log'
                         levl, ##fmt);                                  \
                                 ^
umountd.c:240:13: warning: 'daemon' is deprecated: first deprecated in OS X 10.5 [-Wdeprecated-declarations]
        if (daemon (0, 0) != 0)
            ^
/usr/include/stdlib.h:292:6: note: 'daemon' declared here
int      daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0);
         ^
11 warnings generated.
  CCLD     umountd

Comment 1 Dennis Schafroth 2014-10-26 09:20:08 UTC
Many of them are related/duplicates and can be removed by adding -Wno-deprecated-declarations to the clang setup in configure.ac:

diff --git a/configure.ac b/configure.ac
index 583f500..c13f93e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -798,7 +798,7 @@ AC_COMPILE_IFELSE(
 AC_MSG_RESULT([$CLANG])
 
 if test "x$CLANG" = "xyes"; then
-   GF_COMPILER_FLAGS="-Wno-gnu"
+   GF_COMPILER_FLAGS="-Wno-gnu -Wno-deprecated-declarations"
 fi
 
 if test "x$ac_cv_header_execinfo_h" = "xno"; then

It will hide that some APIs is deprecated (ucontext, MD5) on OS X, but until there is an alternative, it's noise.

Comment 2 Justin Clift 2014-10-27 18:40:10 UTC
Ahhh cool.  Do you reckon we should make that an OSX specific thing (in configure.ac), or add it for everything using clang?

Comment 3 Harshavardhana 2014-10-27 19:09:16 UTC
There was a reason behind having "warnings" - is for my own benefit as a reminder to get them fixed, if we turn them off - they will potentially even might mask potential bugs. 

The real reason for so many warnings is gcc which is perhaps blatantly ignorant of some of those things

ec-common.c:1068:13: warning: variable 'lock' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

^^ this is a potential bug on a distributed system. 

Realistically we have enough bugs in OSX functionality alone rather than making compilation look beautiful, i think its okay to have these "warnings" and let people open Bugzilla for each one of them. 

NOTE: If our SSL code was modular enough we could have just did '--disable-ssl' on OSX.

Comment 4 Dennis Schafroth 2014-10-27 19:21:40 UTC
Only disable warning where it is a problem. 

I do agree, that "just" hiding warnings is not the right way, but I would rather hide the "innocent" ones to be sure that we spot the bad ones (like the one you points out). 

Yes modulizing/wrap ucontext and SSL stuff would mean we only see the warning one time instead of on every usage, would prob. be a cleaner solution. It would cost an extra function call.

The MD5 should be very easy to replace with the CC_MD5 from CommonCrypt, but I have not spotted replacements for the SSL methods.

Comment 5 Justin Clift 2014-10-27 19:26:22 UTC
As a side thought, if we could replace MD5 with something "better" that would be good.  Aside from the general security problems with it, MD5 isn't FIPS compliant so is probably a blocker for usage in FIPS compliant environments.

Comment 6 Harshavardhana 2014-10-27 19:40:11 UTC
(In reply to Justin Clift from comment #5)
> As a side thought, if we could replace MD5 with something "better" that
> would be good.  Aside from the general security problems with it, MD5 isn't
> FIPS compliant so is probably a blocker for usage in FIPS compliant
> environments.

Yes that would be another bug :-)

Comment 7 Anand Avati 2015-02-01 10:57:39 UTC
REVIEW: http://review.gluster.org/9520 (Fixing compiler warnings on OSX: - Ignore deprecated APIs warning on OSX:) posted (#1) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 8 Anand Avati 2015-02-01 11:05:46 UTC
REVIEW: http://review.gluster.org/9520 (Fixing compiler warnings on OSX: - Ignore deprecated APIs warning on OSX) posted (#2) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 9 Anand Avati 2015-02-01 13:44:02 UTC
REVIEW: http://review.gluster.org/9522 (Fix compiler warnings on OSX - Tautologicals) posted (#1) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 10 Anand Avati 2015-02-02 19:35:47 UTC
REVIEW: http://review.gluster.org/9545 (Fix clang warnings on OS X: - Wrong format spec) posted (#1) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 11 Anand Avati 2015-02-02 21:24:58 UTC
REVIEW: http://review.gluster.org/9549 (Fix clang warnings: Code should be functional unchanged.) posted (#1) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 12 Anand Avati 2015-02-03 19:21:33 UTC
REVIEW: http://review.gluster.org/9549 (Fix clang warnings: Code should be functional unchanged.) posted (#2) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 13 Anand Avati 2015-02-03 22:59:07 UTC
REVIEW: http://review.gluster.org/9549 (Fix clang warnings: Code should be functional unchanged.) posted (#3) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 14 Anand Avati 2015-02-03 23:30:30 UTC
REVIEW: http://review.gluster.org/9549 (Fix clang warnings: Code should be functional unchanged.) posted (#4) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 15 Anand Avati 2015-02-04 01:10:55 UTC
REVIEW: http://review.gluster.org/9549 (Fix clang warnings: Code should be functional unchanged.) posted (#5) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 16 Anand Avati 2015-02-04 01:53:07 UTC
REVIEW: http://review.gluster.org/9549 (Fix clang warnings: Code should be functional unchanged.) posted (#6) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 17 Anand Avati 2015-02-28 08:23:16 UTC
REVIEW: http://review.gluster.org/9545 (Fix clang warnings on OS X: - Wrong format spec) posted (#2) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 18 Anand Avati 2015-02-28 08:49:18 UTC
REVIEW: http://review.gluster.org/9522 (Fix compiler warnings on OSX - Tautologicals) posted (#2) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 19 Anand Avati 2015-02-28 08:59:46 UTC
REVIEW: http://review.gluster.org/9549 (Fix clang warnings: Code should be functional unchanged.) posted (#7) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 20 Anand Avati 2015-02-28 09:10:26 UTC
REVIEW: http://review.gluster.org/9522 (Fix compiler warnings on OSX - Tautologicals) posted (#3) for review on master by Dennis Schafroth (dennis@schafroth.com)

Comment 22 Amar Tumballi 2018-10-08 10:08:13 UTC
I see the patches didn't get the right attention then!

Marking the bug back to NEW. will see if we can do anything about it.

Comment 23 Amar Tumballi 2019-05-07 13:59:33 UTC
Good for someone new to GlusterFS to pick this and fix it. Keeping this open.

Comment 24 Amar Tumballi 2019-05-09 20:34:39 UTC
*** Bug 1408784 has been marked as a duplicate of this bug. ***

Comment 25 Worker Ant 2020-03-12 12:50:49 UTC
This bug is moved to https://github.com/gluster/glusterfs/issues/961, and will be tracked there from now on. Visit GitHub issues URL for further details


Note You need to log in before you can comment on or make changes to this bug.