Codebase list libmawk / a8c8f483-bda4-4dcb-b181-d7b9964ade2c/main tools / unwarn.sh
a8c8f483-bda4-4dcb-b181-d7b9964ade2c/main

Tree @a8c8f483-bda4-4dcb-b181-d7b9964ade2c/main (Download .tar.gz)

unwarn.sh @a8c8f483-bda4-4dcb-b181-d7b9964ade2c/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"