FWIW I am getting this error with gcc (GCC) 16.2.1 20260810 on arch linux
against head (commit b3802782de3eff2c0f1eda9e7c0befd8cd142162)

src/read.c:3068:23: error: initialization discards ‘const’ qualifier from
pointer target type [-Werror=discarded-qualifiers]
 3068 |       char *userend = strchr (name + 1, '/');


The code in tilde_expand() is doing this;
      char *userend = strchr (name + 1, '/');
      if (userend != 0)
        *userend = '\0';

"name" appears to be a const and the code is essentially bypassing this
with "userend."

As I undo this going upwards it causes quite a lot of nuisance but I assume
we need to be very careful about changing behavior - where e.g.
makefilenames are permanently altered - so the correct behavior is to call
a spade a spade and "un-const" things.

I can post a patch but someone else might prefer to do this.

Regards,

Tim

Reply via email to