/alternatives/c99

http://github.com/brinkman83/bashrc · Shell · 24 lines · 13 code · 4 blank · 7 comment · 1 complexity · aa80579d73b66c41e169b80f5fbc9324 MD5 · raw file

  1. #! /bin/sh
  2. # Call the appropriate C compiler with options to accept ANSI/ISO C
  3. # The following options are the same (as of gcc-3.3):
  4. # -std=c99
  5. # -std=c9x
  6. # -std=iso9899:1999
  7. # -std=iso9899:199x
  8. extra_flag=-std=c99
  9. for i; do
  10. case "$i" in
  11. -std=c9[9x]|-std=iso9899:199[9x])
  12. extra_flag=
  13. ;;
  14. -std=*|-ansi)
  15. echo >&2 "`basename $0` called with non ISO C99 option $i"
  16. exit 1
  17. ;;
  18. esac
  19. done
  20. exec gcc $extra_flag ${1+"$@"}