String Formatting Warning

ROOT Version: 6.24/04
Platform: lxplus/ RHEL 7
Compiler: c++ (GCC) 4.8.5 20150623

I am trying to automatically include histogram names in the legend by using GetName functionality for histograms and I am facing this. It does show to include β€œ%s” but how do I use it? I am confused since I am not directly using a string.

pltnomsys.C:232:49: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
pltnomsys.C:232:49: note: treat the string as an argument to avoid this

GetName() already returns the correct type, so there’s no need to use Format there.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.