SCL: impossible to propagate empty string parameter through `__VARARGS__`
@version: current
block destination second(...) {
# something useful with an empty string parameter
};
block destination first(...) {
second(`__VARARGS__`);
};
log {
destination{ first(some-param("")) };
};
In /home/anno/dev/axo/syslog/install/etc/syslog-ng.conf:9:28-9:29:
4
5 #Start Block block destination first() at /home/anno/dev/axo/syslog/install/etc/syslog-ng.conf:8
6 ## some_param=
7 @line "/home/anno/dev/axo/syslog/install/etc/syslog-ng.conf" 8 30
8
9-----> second(some_param() );
9-----> ^
10
11 #End Block block destination first() at /home/anno/dev/axo/syslog/install/etc/syslog-ng.conf:8
12
https://github.com/syslog-ng/syslog-ng/pull/2088#issuecomment-396034252 says the following:
As "" is not mapped into "" anymore, this is a problem needs to be addressed. Luckily, we could break the cycle here, do not need to find another symbol that would be mapped to "", of which again find a symbol that maps to the underlying symbol etc. This can be addressed by modifying such scl. I show an example for this:
Unfortunately, this is not so lucky with varargs. With the current implementation, it is impossible to pass an empty string parameter through varargs.
Remainder from #254
The real resolution of this problem might be the reimplementation of syslog-ng/syslog-ng#2088 in a way that checks mandatory parameters without overriding the meaning of the "" symbol.
SCL declarations could still use the "" syntax to mark the parameter optional, but that should be differentiated from passing "" to this parameter from outside by adding more state to the block generator.