cpp.req: fix for cpp 4.8.x output

Adapt cpp output parser to handle cpp 4.8.x output properly.

  $ cpp-4.7 /dev/null
  # 1 "/dev/null"
  # 1 "<command-line>"
  # 1 "/dev/null"
  $ cpp-4.8 /dev/null
  # 1 "/dev/null"
  # 1 "<command-line>"
  # 1 "/usr/include/stdc-predef.h" 1 3 4
  # 1 "<command-line>" 2
  # 1 "/dev/null"
This commit is contained in:
Дмитрий Левин 2014-02-15 02:47:04 +00:00
parent 24478642d6
commit f1dc627616

View File

@ -140,7 +140,7 @@ CppReq()
fi fi
# Keep only linemarks and includes, strip filename quotes. # Keep only linemarks and includes, strip filename quotes.
sed -ni '/^# .* "\//{s/"//g;p};/^#i.* ["<]/{s/[<">]//g;p}' $tmpdir/out sed -ni '/^# .* "\(\/\|<command-line>"\)/{s/"//g;p};/^#i.* ["<]/{s/[<">]//g;p}' $tmpdir/out
# Prepare the list of files in cpp output which are packaged in this subpackage. # Prepare the list of files in cpp output which are packaged in this subpackage.
awk '$1=="#" && $4==1 { print $3 }' <$tmpdir/out | awk '$1=="#" && $4==1 { print $3 }' <$tmpdir/out |
@ -188,7 +188,7 @@ CppReq()
Stack[++SP] = f Stack[++SP] = f
} }
function Pop(f) { function Pop(f) {
if (f != Stack[--SP]) if (f != Stack[--SP] && f != "<command-line>")
printf "%s: %s: expected pop %s, got pop %s\n", printf "%s: %s: expected pop %s, got pop %s\n",
prog, hdr, Stack[SP], f >"/dev/stderr" prog, hdr, Stack[SP], f >"/dev/stderr"
if (SPmark > SP) if (SPmark > SP)