Build Elektra using the commands below:
mkdir build
cmake -G Ninja -B build
cmake --build build
The last command does not print any warning or error messages.
The command cmake --build build prints the following warning messages:
Generating ../../../../include/gen/templates.hpp
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
awk: cmd. line:12: warning: regexp escape sequence `\"' is not a known regexp operator
master2.1.0.5As far as I can tell the problem is the line:
. Looks like we should remove the \ before the first ". I am not sure that is the right option though, since I do not understand why the character set ([]) contains multiple double and single quotes.
Thank you for reporting the problem!
I do not know if this is a "good first issue" if you are not sure yourself what is meant?
I do not know if this is a "good first issue" if you are not sure yourself what is meant?
I am pretty sure it would be a “good first issue“ for an awk programmer 😊. Anyway, I removed the label for now.
since I do not understand why the character set ([]) contains multiple double and single quotes.
The line in question is part of a single quoted string in a shell script. Therefore the sequence '"'"' closes the single quoted string ', opens a double quoted one ", adds a single quote to the double quoted string ', closes the double quoted string " and opens a single quoted string '. Together this just adds the a single quote to the single quoted string.
The double quote before that is there to add a double quote to the character set.
It seems the warning wants us to replace \" with ". If we do that we need to make sure that it still works with both gawk and mawk. Sometimes they disagree. The POSIX standard says \" is correct. (here the table under Regular Expressions)
If the POSIX standard says contrary to the warning it might be better to ignore the warning.
If the POSIX standard says contrary to the warning it might be better to ignore the warning.
While following POSIX sounds good, at least the awk implementations I tested (nawk, gawk, bioawk, and mawk) seem to have no problem with unescaped double quotes. At least the script
#!/usr/bin/env sh
# BWK awk/nawk/
# One true awk gawk
set -- /usr/bin/awk /usr/local/bin/awk bioawk mawk
for awk; do
printf '"bla\nblubb' | "$awk" '$0 ~ /["].*/ { print $0 }'
done
prints the same line:
"bla
four times on my machine. I already removed the backslash locally and will probably open a pull request that contains this minor “fix” and some other minor improvements in the next days.
We are really spending a lot of time on a very unimportant issue. There are many other important issues :wink:
I already removed the backslash locally and will probably open a pull request that contains this minor “fix” and some other minor improvements in the next days.
Good! :sparkle: