This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][PING^2] Skip preprocessor directives in mklog
- From: Yury Gribov <y dot gribov at samsung dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Trevor Saunders <tbsaunde at mozilla dot com>, Diego Novillo <dnovillo at google dot com>, Tom de Vries <Tom_deVries at mentor dot com>, Jeff Law <law at redhat dot com>
- Date: Tue, 12 May 2015 18:19:24 +0300
- Subject: [PATCH][PING^2] Skip preprocessor directives in mklog
- Authentication-results: sourceware.org; auth=none
- References: <553633FB dot 3050206 at samsung dot com> <5541EFCE dot 3070004 at samsung dot com>
On 04/30/2015 12:03 PM, Yury Gribov wrote:
On 04/21/2015 02:26 PM, Yury Gribov wrote:
Hi all,
Contrib/mklog is currently faked by preprocessor directives inside
functions to produce invalid ChangeLog. The attached patch fixes this.
Tested with my local mklog testsuite and http://paste.debian.net/167999/
. Ok to commit?
Ping.
commit 23a738d05393676e72db82cb527d5fb1b3060e2f
Author: Yury Gribov <y.gribov@samsung.com>
Date: Tue Apr 21 14:17:23 2015 +0300
2015-04-21 Yury Gribov <y.gribov@samsung.com>
* mklog: Ignore preprocessor directives.
diff --git a/contrib/mklog b/contrib/mklog
index f7974a7..455614b 100755
--- a/contrib/mklog
+++ b/contrib/mklog
@@ -131,7 +131,6 @@ sub is_unified_hunk_start {
}
# Check if line is a top-level declaration.
-# TODO: ignore preprocessor directives except maybe #define ?
sub is_top_level {
my ($function, $is_context_diff) = (@_);
if (is_unified_hunk_start ($function)
@@ -143,7 +142,7 @@ sub is_top_level {
} else {
$function =~ s/^.//;
}
- return $function && $function !~ /^[\s{]/;
+ return $function && $function !~ /^[\s{#]/;
}
# Read contents of .diff file