[Bug]: `invalid CPU number '(null)', falling back to CPU 1` although the default value is 1
What happened?
Hello,
(I consider this as a bug, but it is subject to discussion)
When running Conky, I get the following message:
[2026-09-05 17:32:59.428] [warn ] [src/core.cc:459] invalid CPU number '(null)', falling back to CPU 1A warning: it looks like something could be improved in my configuration of Conky.
First suggestion: include in the warning message which configuration variable is causing this warning.
Looking at the source code, the message is emitted for the variable freq_g.
I use this variable in my configuration of Conky:
${color grey}Frequency:$color $freq_g ${color grey}GHzSo, indeed, I don't provide any CPU index as parameter to freq_g. But the documentation says the default value is 1, so not providing a parameter should be fine, not triggering a warning.
I never noticed this warning before, and indeed it comes from a recent commit 28f2dcdf1 which restores some warnings.
Second suggestion: do not emit a warning when no parameter is provided and a default value is defined. One could just remove the log instructions, but we want to still catch really invalid values.
I can try to make a patch for these two suggestions, but which fix do you prefer? Removing the log instructions, decreasing the verbosity which displays these messages, changing the logic to distinguish not providing a parameter and providing a bogus parameter, ...?
Version
1.24.2
Which OS/distro are you seeing the problem on?
Debian
Conky config
Stack trace
Relevant log output
Source: brndnmtthws/conky