@amadio commented on this pull request.


In src/XrdPosix/XrdPosixAdmin.cc:

> @@ -51,7 +51,7 @@ XrdCl::URL *XrdPosixAdmin::FanOut(int &num)
    XrdCl::URL                    *uVec;
    XrdNetAddr netLoc;
    const char *hName;
-   unsigned int i;
+   unsigned long i;

It's not clang that needs it, it just warns that the condition i > std::numeric_limits<ptrdiff_t>::max() / sizeof(XrdCl::URL) in the if below is never going to trigger because std::numeric_limits<ptrdiff_t>::max() / sizeof(XrdCl::URL) is much larger than the largest int. We are checking there that we are not trying to allocate more memory (i.e. i * sizeof(XrdCl::URL)) than std::numeric_limits<ptrdiff_t>::max() bytes, but we can only do so if i can actually hold up to that value itself. The "solution" is to make i big enough for that.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <xrootd/xrootd/pull/1997/review/1388036659@github.com>

[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/xrootd/xrootd/pull/1997#discussion_r1168679117", "url": "https://github.com/xrootd/xrootd/pull/1997#discussion_r1168679117", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

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