Re: String concatenation problem in dtc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 3/30/19 8:11 PM, Pavel Machek wrote:
On Sat 2019-03-30 19:52:06, Jacek Anaszewski wrote:
On 3/29/19 10:01 PM, Jacek Anaszewski wrote:
Hi,

I tried to create a macro for automatic composition of "-N" suffixed LED
functions (where N is a number). Unfortunately, the preprocessor
of the dtc compiler seems not to accept string concatenation.
I.e. it is not possible to to the following assignment:

s/to to/to do/


function = "hdd""-1"

To clarify - "function" is a new property to be introduced in the common
LED bindings. And in fact, probably the preprocessor has nothing to do
with that string concatenation it's just Device Tree compiler
shortcoming.

Stack overflow says:

Concatenation of adjacent string litterals isn't a feature of the
preprocessor, it is a feature of the core languages (both C and
C++). You could write:

And that's accurate, AFAICT. Looks like dtc does not have that
feature.

									Pavel

https://stackoverflow.com/questions/5106280/string-concatenation-using-preprocessor#5106345

Thanks for the reference. So I will be probably off with
function-enumerator property.

--
Best regards,
Jacek Anaszewski



[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux