+ # Clear out the comments.
+ while ($res =~ m@(/\*.*?\*/)@) {
+ substr($res, $-[1], $+[1] - $-[1]) = ' ' x ($+[1] - $-[1]);
+ }
+ if ($res =~ m@(/\*.*)@) {
+ substr($res, $-[1], $+[1] - $-[1]) = ' ' x ($+[1] - $-[1]);
+ }
+ if ($res =~ m@^.(.*\*/)@) {
+ substr($res, $-[1], $+[1] - $-[1]) = ' ' x ($+[1] - $-[1]);
+ }
+
+ # The pathname on a #include may be surrounded by '<' and '>'.
+ if ($res =~ /^.#\s*include\s+\<(.*)\>/) {
+ my $clean = 'X' x length($1);
+ $res =~ s@\<.*\>@<$clean>@;
+
+ # The whole of a #error is a string.
+ } elsif ($res =~ /^.#\s*(?:error|warning)\s+(.*)\b/) {
+ my $clean = 'X' x length($1);
+ $res =~ s@(#\s*(?:error|warning)\s+).*@$1$clean@;
+ }
+