diff options
Diffstat (limited to 'tool/transform_mjit_header.rb')
-rw-r--r-- | tool/transform_mjit_header.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tool/transform_mjit_header.rb b/tool/transform_mjit_header.rb index 1565d5fcfd..33e5ede824 100644 --- a/tool/transform_mjit_header.rb +++ b/tool/transform_mjit_header.rb @@ -83,9 +83,14 @@ module MJITHeader f.close cmd = "#{cc} #{cflags} #{f.path}" unless system(cmd, err: File::NULL) - STDERR.puts "error in #{stage} header file:" - system(cmd) - exit false + out = IO.popen(cmd, err: [:child, :out], &:read) + STDERR.puts "error in #{stage} header file:\n#{out}" + + if match = out.match(/error: conflicting types for '(?<name>[^']+)'/) + unless (related_lines = code.lines.grep(/#{match[:name]}/)).empty? + STDERR.puts "possibly related lines:\n#{related_lines.join("\n")}" + end + end end end end |