[classad-users] compiling classads 0.9.6


Date: Mon, 12 Sep 2005 16:58:57 +0200
From: Jan Just Keijser <janjust@xxxxxxxxx>
Subject: [classad-users] compiling classads 0.9.6
hi all,

just started working with Condor, ClassAds, gLite, Globus etc etc ...
one of the first things I want to do is a full compile of all tools using some gcc debugging options. So I added
-O -Wuninitialized
to the Makefile for ClassAds and look what it gave me:


g++ -fno-implicit-templates -DUSE_POSIX_REGEX -Wall -g -DCLASSAD_DISTRIBUTION -Wuninitialized -O -c classad.C
classad.C: In member function `bool ClassAd::CopyFrom(const ClassAd&)':
classad.C:89: warning: `bool succeeded' might be used uninitialized in this function
g++ -fno-implicit-templates -DUSE_POSIX_REGEX -Wall -g -DCLASSAD_DISTRIBUTION -Wuninitialized -O -c collectionBase.C
collectionBase.C: In member function `bool ClassAdCollection::PlayClassAdOp(int, ClassAd*)':
collectionBase.C:607: warning: `ClassAd*newAd' might be used uninitialized in this function
g++ -fno-implicit-templates -DUSE_POSIX_REGEX -Wall -g -DCLASSAD_DISTRIBUTION -Wuninitialized -O -c fnCall.C
fnCall.C: In member function `virtual bool FunctionCall::SameAs(const ExprTree*) const':
fnCall.C:219: warning: `bool is_same' might be used uninitialized in this function
fnCall.C: In function `static bool FunctionCall::convTime(const char*, const ArgumentList&, EvalState&, Value&)':
fnCall.C:1899: warning: `int arg2num' might be used uninitialized in this function
g++ -fno-implicit-templates -DUSE_POSIX_REGEX -Wall -g -DCLASSAD_DISTRIBUTION -Wuninitialized -O -c query.C
query.C: In member function `bool LocalCollectionQuery::Query(const std::string&, ExprTree*)':
query.C:65: warning: `const ClassAd*parent' might be used uninitialized in this function
g++ -fno-implicit-templates -DUSE_POSIX_REGEX -Wall -g -DCLASSAD_DISTRIBUTION -Wuninitialized -O -c source.C
source.C: In member function `bool ClassAdParser::parseShiftExpression(ExprTree*&)':
source.C:636: warning: `Operation::OpKind op' might be used uninitialized in this function
source.C: In member function `bool ClassAdParser::parseMultiplicativeExpression(ExprTree*&)':
source.C:714: warning: `Operation::OpKind op' might be used uninitialized in this function
g++ -fno-implicit-templates -DUSE_POSIX_REGEX -Wall -g -DCLASSAD_DISTRIBUTION -Wuninitialized -O -c value.C
value.C: In member function `bool Value::SameAs(const Value&) const':
value.C:276: warning: `bool is_same' might be used uninitialized in this function
value.C: In function `bool convertValueToRealValue(Value, Value&)':
value.C:367: warning: `bool could_convert' might be used uninitialized in this function
value.C:375: warning: `Value::NumberFactor nf' might be used uninitialized in this function
value.C: In function `bool convertValueToIntegerValue(Value, Value&)':
value.C:451: warning: `bool could_convert' might be used uninitialized in this function
value.C: In function `bool convertValueToStringValue(Value, Value&)':
value.C:534: warning: `bool could_convert' might be used uninitialized in this function
g++ -fno-implicit-templates -DUSE_POSIX_REGEX -Wall -g -DCLASSAD_DISTRIBUTION -Wuninitialized -O -c xmlLexer.C
xmlLexer.C: In member function `bool XMLLexer::GrabToken()':
xmlLexer.C:216: warning: `int character' might be used uninitialized in this function


should this worry me? I looked at the very first warning:
84 bool ClassAd::
85 CopyFrom( const ClassAd &ad )
86 {
87 AttrList::const_iterator itr;
88 ExprTree *tree;
89 bool succeeded;
90
91 if (this == &ad) {
92 succeeded = false;
93 } else {
94 Clear( );
95 ExprTree::CopyFrom(ad);
96 chained_parent_ad = ad.chained_parent_ad;
97
98 DisableDirtyTracking();
99 for( itr = ad.attrList.begin( ); itr != ad.attrList.end( ); itr++ ) {
100 if( !( tree = itr->second->Copy( ) ) ) {
101 Clear( );
102 CondorErrno = ERR_MEM_ALLOC_FAILED;
103 CondorErrMsg = "";
104 return( false );
105 }
106 tree->SetParentScope(this); // ajr
107 attrList[itr->first] = tree;
108 }
109 EnableDirtyTracking();
110 }
111 return succeeded;
112 }


and the warning does look valid to me (e.g. if this != &ad then we return an undefined value).

regards,

JJ Keijser
NIKHEF
[← Prev in Thread] Current Thread [Next in Thread→]