Skip to content

Instantly share code, notes, and snippets.

@zbyhoo
Created January 10, 2011 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zbyhoo/772958 to your computer and use it in GitHub Desktop.
Save zbyhoo/772958 to your computer and use it in GitHub Desktop.
Ruby script converting gcc output to msvc compatible one (go to line when error appears).
result = 0
while (line = gets)
index = line.index(/\.[ch]pp\:[0-9]/)
if (index == nil)
puts line
else
path_end = line.index(":", index)
linenr_end = line.index(":", path_end + 1)
filepath = line[0,path_end]
linenr = line[(path_end+1)...linenr_end]
message = line[(linenr_end+2)..line.length]
puts "#{filepath}(#{linenr}) : #{message}"
result = 1
end
end
exit result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment