Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings from Clang compiler #1997

Merged
merged 7 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/XrdMacaroons/XrdMacaroonsAuthz.hh
Expand Up @@ -43,7 +43,7 @@ public:

// Macaroons don't have a concept off an "issuers"; return an empty
// list.
virtual Issuers IssuerList() {return Issuers();}
virtual Issuers IssuerList() override {return Issuers();}

private:
XrdAccPrivs OnMissing(const XrdSecEntity *Entity,
Expand Down
2 changes: 1 addition & 1 deletion src/XrdPosix/XrdPosixAdmin.cc
Expand Up @@ -51,7 +51,7 @@ XrdCl::URL *XrdPosixAdmin::FanOut(int &num)
XrdCl::URL *uVec;
XrdNetAddr netLoc;
const char *hName;
unsigned int i;
unsigned long i;
abh3 marked this conversation as resolved.
Show resolved Hide resolved

// Make sure admin is ok
//
Expand Down
2 changes: 1 addition & 1 deletion src/XrdPosix/XrdPosixFile.hh
Expand Up @@ -166,7 +166,7 @@ inline void UpdtSize(size_t newsz)

using XrdPosixObject::Who;

inline bool Who(XrdPosixFile **fileP)
inline bool Who(XrdPosixFile **fileP) override
{*fileP = this; return true;}

int Write(char *Buff, long long Offs, int Len) override;
Expand Down
4 changes: 4 additions & 0 deletions src/XrdPosix/XrdPosixPreload.cc
Expand Up @@ -28,6 +28,10 @@
/* specific prior written permission of the institution or contributor. */
/******************************************************************************/

#if defined(__clang__) && defined(_FORTIFY_SOURCE)
#undef _FORTIFY_SOURCE
#endif

#include <sys/types.h>
#include <cstdarg>
#include <unistd.h>
Expand Down
4 changes: 4 additions & 0 deletions src/XrdPosix/XrdPosixPreload32.cc
Expand Up @@ -28,6 +28,10 @@
/* specific prior written permission of the institution or contributor. */
/******************************************************************************/

#if defined(__clang__) && defined(_FORTIFY_SOURCE)
#undef _FORTIFY_SOURCE
#endif

#ifdef _LARGEFILE_SOURCE
#undef _LARGEFILE_SOURCE
#endif
Expand Down
34 changes: 17 additions & 17 deletions src/XrdPss/XrdPss.hh
Expand Up @@ -144,34 +144,34 @@ struct XrdVersionInfo;
class XrdPssSys : public XrdOss
{
public:
virtual XrdOssDF *newDir(const char *tident)
virtual XrdOssDF *newDir(const char *tident) override
{return (XrdOssDF *)new XrdPssDir(tident);}
virtual XrdOssDF *newFile(const char *tident)
virtual XrdOssDF *newFile(const char *tident) override
{return (XrdOssDF *)new XrdPssFile(tident);}

virtual void Connect(XrdOucEnv &);
virtual void Connect(XrdOucEnv &) override;

virtual void Disc(XrdOucEnv &);
virtual void Disc(XrdOucEnv &) override;

int Chmod(const char *, mode_t mode, XrdOucEnv *eP=0);
int Chmod(const char *, mode_t mode, XrdOucEnv *eP=0) override;
bool ConfigMapID();
virtual
int Create(const char *, const char *, mode_t, XrdOucEnv &, int opts=0);
void EnvInfo(XrdOucEnv *envP);
uint64_t Features() {return myFeatures;}
int Create(const char *, const char *, mode_t, XrdOucEnv &, int opts=0) override;
void EnvInfo(XrdOucEnv *envP) override;
uint64_t Features() override {return myFeatures;}
int Init(XrdSysLogger *, const char *) override {return -ENOTSUP;}
int Init(XrdSysLogger *, const char *, XrdOucEnv *envP) override;
int Lfn2Pfn(const char *Path, char *buff, int blen);
int Lfn2Pfn(const char *Path, char *buff, int blen) override;
const
char *Lfn2Pfn(const char *Path, char *buff, int blen, int &rc);
int Mkdir(const char *, mode_t mode, int mkpath=0, XrdOucEnv *eP=0);
int Remdir(const char *, int Opts=0, XrdOucEnv *eP=0);
char *Lfn2Pfn(const char *Path, char *buff, int blen, int &rc) override;
int Mkdir(const char *, mode_t mode, int mkpath=0, XrdOucEnv *eP=0) override;
int Remdir(const char *, int Opts=0, XrdOucEnv *eP=0) override;
int Rename(const char *, const char *,
XrdOucEnv *eP1=0, XrdOucEnv *eP2=0);
int Stat(const char *, struct stat *, int opts=0, XrdOucEnv *eP=0);
int Stats(char *bp, int bl);
int Truncate(const char *, unsigned long long, XrdOucEnv *eP=0);
int Unlink(const char *, int Opts=0, XrdOucEnv *eP=0);
XrdOucEnv *eP1=0, XrdOucEnv *eP2=0) override;
int Stat(const char *, struct stat *, int opts=0, XrdOucEnv *eP=0) override;
int Stats(char *bp, int bl) override;
int Truncate(const char *, unsigned long long, XrdOucEnv *eP=0) override;
int Unlink(const char *, int Opts=0, XrdOucEnv *eP=0) override;

static const int PolNum = 2;
enum PolAct {PolPath = 0, PolObj = 1};
Expand Down
2 changes: 1 addition & 1 deletion src/XrdSecgsi/XrdSecgsiGMAPFunDN.cc
Expand Up @@ -204,7 +204,7 @@ int XrdSecgsiGMAPInit(const char *parms)
if (len < 2) continue;
if (l[0] == '#') continue;
if (l[len-1] == '\n') l[len-1] = '\0';
if (sscanf(l, "%4096s %256s", val, usr) >= 2) {
if (sscanf(l, "%4095s %255s", val, usr) >= 2) {
XrdOucString stype = "matching";
char *p = &val[0];
int type = kFull;
Expand Down
2 changes: 1 addition & 1 deletion src/XrdXrootd/XrdXrootdAioBuff.hh
Expand Up @@ -48,7 +48,7 @@ XrdXrootdAioBuff* Alloc(XrdXrootdAioTask *arp);

void doneWrite() override;

virtual void Recycle();
virtual void Recycle() override;

XrdXrootdAioBuff* next;

Expand Down
2 changes: 1 addition & 1 deletion src/XrdXrootd/XrdXrootdProtocol.cc
Expand Up @@ -1501,7 +1501,7 @@ void XrdXrootdProtocol::Reset()
doTLS = tlsNot; // Assume client is not capable. This will be
ableTLS = false; // resolved during the kXR_protocol interchange.
isTLS = false; // Made true when link converted to TLS
linkAioReq = {0};
linkAioReq = 0;
pioFree = pioFirst = pioLast = 0;
isActive = isLinkWT= isNOP = isDead = false;
sigNeed = sigHere = sigRead = false;
Expand Down
20 changes: 10 additions & 10 deletions src/XrdXrootd/XrdXrootdProtocol.hh
Expand Up @@ -163,11 +163,11 @@ public:

static char *Buffer(XrdSfsXioHandle h, int *bsz); // XrdSfsXio

XrdSfsXioHandle Claim(const char *buff, int datasz, int minasz=0);// XrdSfsXio
XrdSfsXioHandle Claim(const char *buff, int datasz, int minasz=0) override;// XrdSfsXio

static int Configure(char *parms, XrdProtocol_Config *pi);

void DoIt() {(*this.*Resume)();}
void DoIt() override {(*this.*Resume)();}

int do_WriteSpan();

Expand All @@ -181,29 +181,29 @@ static int Configure(char *parms, XrdProtocol_Config *pi);

int getPathID() {return PathID;}

XrdProtocol *Match(XrdLink *lp);
XrdProtocol *Match(XrdLink *lp) override;

int Process(XrdLink *lp); // Sync: Job->Link.DoIt->Process
int Process(XrdLink *lp) override; // Sync: Job->Link.DoIt->Process

int Process2();

int ProcSig();

void Recycle(XrdLink *lp, int consec, const char *reason);
void Recycle(XrdLink *lp, int consec, const char *reason) override;

static void Reclaim(XrdSfsXioHandle h); // XrdSfsXio

int SendFile(int fildes); // XrdSfsDio
int SendFile(int fildes) override; // XrdSfsDio

int SendFile(XrdOucSFVec *sfvec, int sfvnum); // XrdSfsDio
int SendFile(XrdOucSFVec *sfvec, int sfvnum) override; // XrdSfsDio

void SetFD(int fildes); // XrdSfsDio
void SetFD(int fildes) override; // XrdSfsDio

int Stats(char *buff, int blen, int do_sync=0);
int Stats(char *buff, int blen, int do_sync=0) override;

void StreamNOP();

XrdSfsXioHandle Swap(const char *buff, XrdSfsXioHandle h=0); // XrdSfsXio
XrdSfsXioHandle Swap(const char *buff, XrdSfsXioHandle h=0) override; // XrdSfsXio

XrdXrootdProtocol *VerifyStream(int &rc, int pID, bool lok=true);

Expand Down
2 changes: 1 addition & 1 deletion tests/XrdClTests/FileCopyTest.cc
Expand Up @@ -397,7 +397,7 @@ void FileCopyTest::CopyTestFunc( bool thirdParty )
CPPUNIT_ASSERT_XRDST_NOTOK( process12.Run(0), XrdCl::errCheckSumError );
XrdCl::StatInfo *info = 0;
XrdCl::XRootDStatus status = fs.Stat( targetPath, info );
CPPUNIT_ASSERT_XRDST( status.status == XrdCl::stError && st.code == XrdCl::errNotFound );
CPPUNIT_ASSERT_XRDST( status.status == XrdCl::stError && status.code == XrdCl::errNotFound );
properties.Clear();

//--------------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions tests/common/CppUnitXrdHelpers.hh
Expand Up @@ -25,18 +25,18 @@

#define CPPUNIT_ASSERT_XRDST_NOTOK( x, err ) \
{ \
XrdCl::XRootDStatus st = x; \
XrdCl::XRootDStatus _st = x; \
std::string msg = "["; msg += #x; msg += "]: "; \
msg += st.ToStr(); \
CPPUNIT_ASSERT_MESSAGE( msg, !st.IsOK() && st.code == err ); \
msg += _st.ToStr(); \
CPPUNIT_ASSERT_MESSAGE( msg, !_st.IsOK() && _st.code == err ); \
}

#define CPPUNIT_ASSERT_XRDST( x ) \
{ \
XrdCl::XRootDStatus st = x; \
XrdCl::XRootDStatus _st = x; \
std::string msg = "["; msg += #x; msg += "]: "; \
msg += st.ToStr(); \
CPPUNIT_ASSERT_MESSAGE( msg, st.IsOK() ); \
msg += _st.ToStr(); \
CPPUNIT_ASSERT_MESSAGE( msg, _st.IsOK() ); \
}

#define CPPUNIT_ASSERT_ERRNO( x ) \
Expand Down