mc-cflags.m4 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. dnl @synopsis mc_CHECK_CFLAGS
  2. dnl
  3. dnl Check flags supported by C compiler
  4. dnl
  5. dnl @author Slava Zanko <slavazanko@gmail.com>
  6. dnl @modified by Andrew Borodin <aborodin@vmail.ru>
  7. dnl @version 2021-09-19
  8. dnl @license GPL
  9. dnl @copyright Free Software Foundation, Inc.
  10. AC_DEFUN([mc_CHECK_CFLAGS],[
  11. AC_LANG_PUSH(C)
  12. mc_configured_cflags=""
  13. dnl Sorted -f options:
  14. case "$CC" in
  15. gcc*)
  16. AX_APPEND_COMPILE_FLAGS([-fdiagnostics-show-option], [mc_configured_cflags])
  17. dnl AX_APPEND_COMPILE_FLAGS([-fno-stack-protector], [mc_configured_cflags])
  18. ;;
  19. *)
  20. ;;
  21. esac
  22. dnl Sorted -W options:
  23. AX_APPEND_COMPILE_FLAGS([-Wassign-enum], [mc_configured_cflags], [$EXTRA_OPTION])
  24. AX_APPEND_COMPILE_FLAGS([-Wbad-function-cast], [mc_configured_cflags], [$EXTRA_OPTION])
  25. AX_APPEND_COMPILE_FLAGS([-Wcomment], [mc_configured_cflags], [$EXTRA_OPTION])
  26. AX_APPEND_COMPILE_FLAGS([-Wconditional-uninitialized], [mc_configured_cflags], [$EXTRA_OPTION])
  27. AX_APPEND_COMPILE_FLAGS([-Wdeclaration-after-statement], [mc_configured_cflags], [$EXTRA_OPTION])
  28. AX_APPEND_COMPILE_FLAGS([-Wfloat-conversion], [mc_configured_cflags], [$EXTRA_OPTION])
  29. AX_APPEND_COMPILE_FLAGS([-Wfloat-equal], [mc_configured_cflags], [$EXTRA_OPTION])
  30. AX_APPEND_COMPILE_FLAGS([-Wformat], [mc_configured_cflags], [$EXTRA_OPTION])
  31. AX_APPEND_COMPILE_FLAGS([-Wformat-security], [mc_configured_cflags], [$EXTRA_OPTION])
  32. AX_APPEND_COMPILE_FLAGS([-Wformat-signedness], [mc_configured_cflags], [$EXTRA_OPTION])
  33. AX_APPEND_COMPILE_FLAGS([-Wimplicit], [mc_configured_cflags], [$EXTRA_OPTION])
  34. AX_APPEND_COMPILE_FLAGS([-Wimplicit-fallthrough], [mc_configured_cflags], [$EXTRA_OPTION])
  35. AX_APPEND_COMPILE_FLAGS([-Wignored-qualifiers], [mc_configured_cflags], [$EXTRA_OPTION])
  36. AX_APPEND_COMPILE_FLAGS([-Wlogical-not-parentheses], [mc_configured_cflags], [$EXTRA_OPTION])
  37. AX_APPEND_COMPILE_FLAGS([-Wmaybe-uninitialized], [mc_configured_cflags], [$EXTRA_OPTION])
  38. AX_APPEND_COMPILE_FLAGS([-Wmissing-braces], [mc_configured_cflags], [$EXTRA_OPTION])
  39. AX_APPEND_COMPILE_FLAGS([-Wmissing-declarations], [mc_configured_cflags], [$EXTRA_OPTION])
  40. AX_APPEND_COMPILE_FLAGS([-Wmissing-field-initializers], [mc_configured_cflags], [$EXTRA_OPTION])
  41. AX_APPEND_COMPILE_FLAGS([-Wmissing-format-attribute], [mc_configured_cflags], [$EXTRA_OPTION])
  42. AX_APPEND_COMPILE_FLAGS([-Wmissing-parameter-type], [mc_configured_cflags], [$EXTRA_OPTION])
  43. AX_APPEND_COMPILE_FLAGS([-Wmissing-prototypes], [mc_configured_cflags], [$EXTRA_OPTION])
  44. AX_APPEND_COMPILE_FLAGS([-Wmissing-variable-declarations], [mc_configured_cflags], [$EXTRA_OPTION])
  45. AX_APPEND_COMPILE_FLAGS([-Wnested-externs], [mc_configured_cflags], [$EXTRA_OPTION])
  46. AX_APPEND_COMPILE_FLAGS([-Wno-long-long], [mc_configured_cflags], [$EXTRA_OPTION])
  47. AX_APPEND_COMPILE_FLAGS([-Wno-unreachable-code], [mc_configured_cflags], [$EXTRA_OPTION])
  48. AX_APPEND_COMPILE_FLAGS([-Wparentheses], [mc_configured_cflags], [$EXTRA_OPTION])
  49. AX_APPEND_COMPILE_FLAGS([-Wpointer-arith], [mc_configured_cflags], [$EXTRA_OPTION])
  50. AX_APPEND_COMPILE_FLAGS([-Wpointer-sign], [mc_configured_cflags], [$EXTRA_OPTION])
  51. AX_APPEND_COMPILE_FLAGS([-Wredundant-decls], [mc_configured_cflags], [$EXTRA_OPTION])
  52. AX_APPEND_COMPILE_FLAGS([-Wreturn-type], [mc_configured_cflags], [$EXTRA_OPTION])
  53. AX_APPEND_COMPILE_FLAGS([-Wsequence-point], [mc_configured_cflags], [$EXTRA_OPTION])
  54. AX_APPEND_COMPILE_FLAGS([-Wshadow], [mc_configured_cflags], [$EXTRA_OPTION])
  55. AX_APPEND_COMPILE_FLAGS([-Wsign-compare], [mc_configured_cflags], [$EXTRA_OPTION])
  56. dnl AX_APPEND_COMPILE_FLAGS([-Wstrict-aliasing], [mc_configured_cflags], [$EXTRA_OPTION])
  57. AX_APPEND_COMPILE_FLAGS([-Wstrict-prototypes], [mc_configured_cflags], [$EXTRA_OPTION])
  58. AX_APPEND_COMPILE_FLAGS([-Wswitch], [mc_configured_cflags], [$EXTRA_OPTION])
  59. AX_APPEND_COMPILE_FLAGS([-Wswitch-default], [mc_configured_cflags], [$EXTRA_OPTION])
  60. AX_APPEND_COMPILE_FLAGS([-Wtype-limits], [mc_configured_cflags], [$EXTRA_OPTION])
  61. AX_APPEND_COMPILE_FLAGS([-Wundef], [mc_configured_cflags], [$EXTRA_OPTION])
  62. AX_APPEND_COMPILE_FLAGS([-Wuninitialized], [mc_configured_cflags], [$EXTRA_OPTION])
  63. AX_APPEND_COMPILE_FLAGS([-Wunreachable-code], [mc_configured_cflags], [$EXTRA_OPTION])
  64. AX_APPEND_COMPILE_FLAGS([-Wunused-but-set-variable], [mc_configured_cflags], [$EXTRA_OPTION])
  65. AX_APPEND_COMPILE_FLAGS([-Wunused-function], [mc_configured_cflags], [$EXTRA_OPTION])
  66. AX_APPEND_COMPILE_FLAGS([-Wunused-label], [mc_configured_cflags], [$EXTRA_OPTION])
  67. AX_APPEND_COMPILE_FLAGS([-Wunused-parameter], [mc_configured_cflags], [$EXTRA_OPTION])
  68. AX_APPEND_COMPILE_FLAGS([-Wunused-result], [mc_configured_cflags], [$EXTRA_OPTION])
  69. AX_APPEND_COMPILE_FLAGS([-Wunused-value], [mc_configured_cflags], [$EXTRA_OPTION])
  70. AX_APPEND_COMPILE_FLAGS([-Wunused-variable], [mc_configured_cflags], [$EXTRA_OPTION])
  71. AX_APPEND_COMPILE_FLAGS([-Wwrite-strings], [mc_configured_cflags], [$EXTRA_OPTION])
  72. AC_LANG_POP()
  73. ])