Dear ROOTers
The following code fragments have worked since many many years on Mac, Linux and WinXP (using VC++)
for all versions of ROOT up to version root_5.22.00:
TString MyFunctions(const char *name)
{
DoSomething();
if (something) return isType ? name : 0;
if (something else) return name;
return 0;
}
These type of functions are scattered all over my program, especially “return 0”.
However, with root_5.24.00 I get suddenly the following types of errors:
XPSUtils.cxx: In function 'TString SubString(const char*, char, char, Bool_t)':
XPSUtils.cxx:4364: error: operands to ?: have different types
XPSBase.cxx: In member function 'TString XTreeSet::FindTree(const char*)':
XPSBase.cxx:1145: error: conversion from 'int' to 'TString' is ambiguous
/Volumes/CoreData/ROOT/root/include/TString.h:231: note: candidates are: TString::TString(char)
/Volumes/CoreData/ROOT/root/include/TString.h:228: note: TString::TString(const char*)
These errors occur whenever I “return 0;” for TString.
Why is it no longer possible to “return 0;” for TString?
In principle I could do everywhere ‘return “”;’ but for every C++ class it must be possible to return 0.
Best regards
Christian