gcc version 4.1.2 20070502 on Fedora Core 7, Dell D600. Build arguments were: g++ -c -O3 -g -Wall -Wextra -Wno-unused-parameter -Wundef -Woverloaded-virtual -DPLATFORM_X86 -o Configuration.o Configuration.cpp
We have multiple versions of a method called writeEntry, one that takes a boolean as its second value, and one that takes a string. When using "question mark" syntax (as in the removed line below), the method recurses rather than calling the string version of the method. When using a more traditional "if" syntax (the code added), the method does the right thing and calls the string variant of the method. void Configuration::writeEntry(string key, string value) { pthread_mutex_lock(&configMutex); settingsChanged = true; keyValue[key] = value; pthread_mutex_unlock(&configMutex); } void Configuration::writeEntry(string key, bool value) { - writeEntry(key, (value == true? "yes":"no")); + if (value == true) + writeEntry(key, "yes"); + else + writeEntry(key, "no"); }