Print

Print


On 24 Jun 2015, at 04:37, xrootd-dev <[log in to unmask]<mailto:[log in to unmask]>> wrote:

I corrected all of the warnings.However, these seem to be already corrected in get head (what version are you compiling?):

In the subject 4.2.1


Users/mato/Development/ROOT/build.v5-34-00-patches/XROOTD-prefix/src/XROOTD/src/XrdFileCache/XrdFileCacheFactory.cc<http://xrdfilecachefactory.cc/><http://XrdFileCacheFactory.cc<http://xrdfilecachefactory.cc/>>:273:55: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
loff += snprintf(&buff[loff], strlen(buff2), buff2);
^~~~~
/Users/mato/Development/ROOT/build.v5-34-00-patches/XROOTD-prefix/src/XROOTD/src/XrdFileCache/XrdFileCacheFactory.cc<http://xrdfilecachefactory.cc/><http://XrdFileCacheFactory.cc<http://xrdfilecachefactory.cc/>>:284:58: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
loff += snprintf(&buff[loff], strlen(unameBuff), unameBuff);

****** and the following seems like a compiler bug:

prefix/src/XROOTD/src/XrdHttp/XrdHttpProtocol.cc<http://xrdhttpprotocol.cc/><http://XrdHttpProtocol.cc<http://xrdhttpprotocol.cc/>>:558:13: warning: taking the absolute value of unsigned type 'bool' has no effect [-Wabsolute-value]
if (abs((time(0) - tim) > 600)) {

time() and tim and declared time_t which is a long. So, the compiler seems to not know what it is doing.

This is a real bug in your code. The parenthesis is badly placed and is really doing the abs() of a bool.
Cheers,

Pere


-------------------------------------------------------------
Pere Mato  CERN, PH Department, CH 1211 Geneva 23, Switzerland
e-mail: [log in to unmask]<mailto:[log in to unmask]> tel:   +41 22 76 78696
fax:  +41 22 76 68792 gsm: +41 76 48 70855



---
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/issues/245#issuecomment-114749782

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1