Codebase list libmawk / d9f30b5e-7ff9-4ae9-856b-e12b904bb243/main tools / unwarn.sh
d9f30b5e-7ff9-4ae9-856b-e12b904bb243/main

Tree @d9f30b5e-7ff9-4ae9-856b-e12b904bb243/main (Download .tar.gz)

unwarn.sh @d9f30b5e-7ff9-4ae9-856b-e12b904bb243/mainraw · history · blame

#!/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"