summaryrefslogtreecommitdiff
path: root/scripts/gcc-wrapper.py
diff options
context:
space:
mode:
authorShadab Naseem <snaseem@codeaurora.org>2019-02-20 12:57:27 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2019-03-29 04:31:05 -0700
commit1dca5a048f4fb04ba1c87a8351f50573324b8915 (patch)
tree706aa627a6bb61bb20d668c672a68c6772749665 /scripts/gcc-wrapper.py
parent2fe82d10f2fee3c05c31071a1e832d3753b332d5 (diff)
scripts: gcc-wrapper: Route the GCC errors to stderr
The GCC wrapper writes any error message from GCC to stdout along with the messages from the wrapper itself. This is okay for most case, but when GCC is used with -print-xxx flags, the stdout output is supposed to be taken as input to some other build command, so putting error messages in there is pretty bad. Fix this by writing error messages to stderr. Change-Id: I4656033f11ba5212fdcc884cc588f8b9d2c23419 Signed-off-by: Shadab Naseem <snaseem@codeaurora.org>
Diffstat (limited to 'scripts/gcc-wrapper.py')
-rwxr-xr-xscripts/gcc-wrapper.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/gcc-wrapper.py b/scripts/gcc-wrapper.py
index 8a0e0af1c39a..76fb91c57264 100755
--- a/scripts/gcc-wrapper.py
+++ b/scripts/gcc-wrapper.py
@@ -55,7 +55,7 @@ def interpret_warning(line):
line = line.rstrip('\n')
m = warning_re.match(line)
if m and m.group(2) not in allowed_warnings:
- print "error, forbidden warning:", m.group(2)
+ print >> sys.stderr, "error, forbidden warning:", m.group(2)
# If there is a warning, remove any object if it exists.
if ofile:
@@ -80,17 +80,17 @@ def run_gcc():
try:
proc = subprocess.Popen(args, stderr=subprocess.PIPE)
for line in proc.stderr:
- print line,
+ print >> sys.stderr, line,
interpret_warning(line)
result = proc.wait()
except OSError as e:
result = e.errno
if result == errno.ENOENT:
- print args[0] + ':',e.strerror
- print 'Is your PATH set correctly?'
+ print >> sys.stderr, args[0] + ':',e.strerror
+ print >> sys.stderr, 'Is your PATH set correctly?'
else:
- print ' '.join(args), str(e)
+ print >> sys.stderr, ' '.join(args), str(e)
return result