Menu

mod_qos compile error

2023-04-05
2023-04-17
  • Eero Hanninen

    Eero Hanninen - 2023-04-05

    In upcoming FreeBSD 14 is compiling bit more restrictive, so one warning before has become error now.

    (cd /wrkdirs/usr/ports/www/mod_qos/work/mod_qos-11.73/apache2 && /usr/local/sbin/apxs -c  -o mod_qos.la mod_qos.c)
    /usr/local/share/apr/build-1/libtool --silent --mode=compile cc -prefer-pic -O2 -pipe -DLIBICONV_PLUG -fstack-protector-strong -fno-strict-aliasing    -I/usr/local/include/apache24  -I/usr/local/include/apr-1   -I/usr/local/include/apr-1 -I/usr/include -I/usr/local/include -I/usr/local/include/db18  -c -o mod_qos.lo mod_qos.c && touch mod_qos.slo
    mod_qos.c:1915:12: error: incompatible pointer to integer conversion assigning to 'unsigned int' from 'apr_os_thread_t' (aka 'struct pthread *') [-Wint-conversion]
        id.tid = apr_os_thread_current();
               ^ ~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    

    Quick, but not beautiful fix for this is

    --- mod_qos.c.orig      2023-03-07 20:42:41 UTC
    +++ mod_qos.c
    @@ -1912,7 +1912,7 @@ static const char *qos_unique_id(request_rec *r, const
         id.request_time = r->request_time;
         id.in_addr = m_unique_id.in_addr;
     #if APR_HAS_THREADS
    -    id.tid = apr_os_thread_current();
    +    id.tid = (uintptr_t)apr_os_thread_current();
     #else
         id.tid = 0;
     #endif
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.