Hello,
I am trying to create a TString of the following format:
double mass = 0.140;
TString myString = Form("FirstPionMomentum/%f * (event % 2 == 0) + SecondPionMomentum/%f * (event % 2 == 1)", mass, mass);
However, since the %
symbol enters here as both Form
format specifier and the integer division remainder operator, I get the following warning:
development/test.C:5:59: warning: invalid conversion specifier ' ' [-Wformat-invalid-specifier]
TString myString = Form("FirstPionMomentum/%f * (event % 2 == 0) + SecondPionMomentum/%f * (event % 2 == 1)", mass, mass);
~~~^
development/test.C:5:102: warning: invalid conversion specifier ' ' [-Wformat-invalid-specifier]
TString myString = Form("FirstPionMomentum/%f * (event % 2 == 0) + SecondPionMomentum/%f * (event % 2 == 1)", mass, mass);
~~~^
However, the string itself seems to be created correctly:
FirstPionMomentum/0.140000 * (event % 2 == 0) + SecondPionMomentum/0.140000 * (event % 2 == 1)
Is there a simple workaround to prevent this warning?
ROOT Version: 6.26/14
Platform: linuxx8664gcc
Compiler: g++ (GCC) 14.1.0