Files
qt-creator/scripts/gcc2tasks.pl
Christian Stenger dd2d05a772 Scripts: Fix permissions
Broke with a7956df3ca.

Change-Id: I072ea34183aedf2fd693af1bb589660aa06b9e1c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-29 09:32:13 +00:00

31 lines
812 B
Perl
Executable File

#!/usr/bin/perl -w
# Copyright (C) 2016 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
=head1 NAME
msvc2tasks.pl - Convert GCC warnings into Qt Creator task files.
=head1 SYNOPSIS
gcc2tasks.pl < logfile > taskfile
=cut
use strict;
while (my $line = <STDIN> ) {
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|error): (.*)$/) {
my $fileName = $1;
my $lineNumber = $2;
my $type = $3 eq 'warning' ? 'warn' : 'err';
my $text = $4;
$fileName =~ s|\\|/|g;
print $fileName, "\t", $lineNumber, "\t", $type, "\t", $text,"\n";
}
}