Codebase list libmawk / f694964d-46cb-42e8-af1b-824470af934a/main tools / unwarn.sh
f694964d-46cb-42e8-af1b-824470af934a/main

Tree @f694964d-46cb-42e8-af1b-824470af934a/main (Download .tar.gz)

unwarn.sh @f694964d-46cb-42e8-af1b-824470af934a/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"