1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/sh # This file is placed in the Public Domain. # Comment all #warnings in a file given as $1. # Useful on systems with CC with no support for #warning. sed ' /^#[ \t]*warning.*/ { s@^@/*@ s@$@*/@ } ' < "$1" > "$1.tmp" && mv "$1.tmp" "$1"