www/firefox broken if DEBUG is enabled

John Baldwin jhb at freebsd.org
Fri Sep 6 14:46:42 UTC 2013


Compile error is:

/usr/ports/www/firefox/work/mozilla-release/netwerk/wifi/nsWifiScannerFreeBSD.cpp:127:13: error: 
      invalid operands to binary expression ('const char *' and 'const char *')
            << "SSID: " << ssid << ", "
            ^  ~~~~~~~~
../../../netwerk/wifi/nsWifiMonitor.h:27:61: note: expanded from macro 'LOG'    
#define LOG(args)     PR_LOG(gWifiMonitorLog, PR_LOG_DEBUG, args)
                                                            ^
/usr/local/include/nspr/prlog.h:178:19: note: expanded from macro 'PR_LOG'      
      PR_LogPrint _args;         \
                  ^
1 error generated.                                                              

If you look at the the prlog.h header, you can see that PR_LOG() expects to
get printf-style args, but the code in nsWifiScannerFreeBSD.cpp is trying to
use C++ iostreams:

+      // log the data
+      LOG(( "FreeBSD access point: "
+            << "SSID: " << ssid << ", "
+            << "MAC: " << isr->isr_bssid << ", "
+            << "Strength: " << isr->isr_rssi ", "
+            << "Channel: " << isr->isr_freq << "MHz" ));

(This code is in files/patch-bug893397 in the port.)

I think the fix is to just change this to use printf style, but I punted and
built firefox without debugging for now.  This should likely be fixed upstream
as well (if not already).

-- 
John Baldwin


More information about the freebsd-gecko mailing list