From a7c495529da5b17b5df4d6cab640f851a6c4303d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 20 Jan 2014 12:43:38 +0100 Subject: Add gcc2tasks.pl for converting GCC warning logs into .tasks files. Change-Id: I408d2170575c99a690af53d32b08318e6060f525 Reviewed-by: Tobias Hunger --- scripts/gcc2tasks.pl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 scripts/gcc2tasks.pl (limited to 'scripts') diff --git a/scripts/gcc2tasks.pl b/scripts/gcc2tasks.pl new file mode 100644 index 0000000000..d2563a8a1b --- /dev/null +++ b/scripts/gcc2tasks.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl -w + +=head1 NAME + +msvc2tasks.pl - Convert GCC warnings into Qt Creator task files. + +=head1 SYNOPSIS + + gcc2tasks.pl < logfile > taskfile + +=cut + +use strict; + +while (my $line = ) { + chomp($line); + # --- extract file name based matching: + # file.cpp:214:37: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] + if ($line =~ /^([^:]+):(\d+):\d*:? warning: (.*)$/) { + my $fileName = $1; + my $lineNumber = $2; + my $text = $3; + $fileName =~ s|\\|/|g; + print $fileName, "\t", $lineNumber, "\twarn\t", $text,"\n"; + } +} -- cgit v1.2.1