CFLAGS 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // SPDX-License-Identifier: GPL-3.0-or-later
  2. // Copyright © 2018-2019 Ariadne Devos
  3. // sHT -- recommended extensive warnings and errror flags for GCC 6.3.0
  4. # First, a lot of unsorted warnings. Later, some have been categorised.
  5. # > ./configure CFLAGS="$(sed '/^[*/#]/d' CFLAGS | tr \\n \ )"
  6. -Wformat=2 -Wignored-attributes -Wno-unused-parameter
  7. -Wstrict-aliasing=1 -Wstrict-overflow=5
  8. -Wsuggest-attribute=pure -Wsuggest-attribute=const
  9. -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Warray-bounds=2 -Wdiscarded-qualifiers
  10. -Werror=enum-compare -Werror=attributes
  11. -Werror=endif-labels
  12. -Werror=empty-body -Werror=logical-not-parentheses
  13. -Werror=missing-field-initializers -Werror=multichar -Werror=override-init
  14. -Werror=override-init-side-effects -Werror=nested-externs -Werror=volatile-register-var
  15. -Werror=pointer-sign -Werror=designated-init -Wunused-macros -Wstrict-prototypes
  16. -Wold-style-declaration -Wold-style-definition -Wno-long-long -Wdiscarded-qualifiers -Wno-traditional
  17. -Wno-traditional-conversion -Wno-declaration-after-statement -Wno-shadow -Wno-cast-qual
  18. -Wno-jump-misses-init -Wno-aggregate-return -Wno-cast-align
  19. -Wunsafe-loop-optimizations -Waggressive-loop-optimizations -Winline -Wstack-protector -Werror=chkp
  20. -Werror=double-promotion -Werror=format -Werror=format-zero-length -Werror=format-nonliteral
  21. -Werror=nonnull-compare -Werror=null-dereference -Werror=init-self -Werror=implicit-int
  22. -Werror=ignored-qualifiers -Werror=main
  23. -Werror=missing-include-dirs
  24. -Werror=return-local-addr
  25. -Werror=return-type
  26. -Werror=switch
  27. -Werror=switch-bool
  28. -Werror=unused-but-set-parameter
  29. -Werror=bool-compare -Werror=duplicated-cond -Werror=frame-address
  30. -Werror=int-conversion -Werror=tautological-compare
  31. -Werror=float-equal -Werror=free-nonheap-object -Werror=undef -Werror=bad-function-cast
  32. -Werror=write-strings -Werror=sign-compare -Werror=float-conversion -Werror=sizeof-pointer-memaccess
  33. -Werror=sizeof-array-argument
  34. -Wno-builtin-macro-redefined -Werror=packed-bitfield-compat
  35. -Werror=type-limits -Werror=clobbered -Werror=strict-aliasing
  36. -Werror=pointer-arith
  37. -Werror=cast-align
  38. -Werror=address
  39. -Werror=int-to-pointer-cast
  40. -Wsizeof-array-argument -Waddress
  41. -Wall -Wextra
  42. -Werror=pointer-to-int-cast
  43. * Syntax issues
  44. -Werror=misleading-indentation -Werror=missing-braces -Werror=parentheses
  45. -Werror=trigraphs -Werror=comment -Werror=missing-declarations
  46. -Werror=normalized=nfc
  47. * Pointer issues
  48. -Werror=strict-overflow -Werror=array-bounds -Werror=strict-aliasing -Werror=overflow
  49. -Werror=incompatible-pointer-types
  50. * Bad API usage
  51. -Werror=memset-transposed-args -Werror=sync-nand -Werror=unknown-pragmas
  52. -Werror=invalid-memory-model -Werror=format-security -Werror=format-signedness
  53. -Werror=format-y2k -Werror=nonnull
  54. * Complicated assembly
  55. -Werror=vla -Werror=varargs -Werror=trampolines -Wstack-usage=256
  56. -Wframe-larger-than=256
  57. * Undefined arithmetic
  58. -Werror=shift-count-negative -Werror=shift-count-overflow -Werror=shift-negative-value
  59. -Werror=shift-overflow=2 -Werror=div-by-zero -Werror=sequence-point
  60. * Reproducable code
  61. -Werror=date-time
  62. * Missing code
  63. -Werror=maybe-uninitialized -Werror=implicit-function-declaration
  64. * Pointless code
  65. -Werror=unused-but-set-variable -Werror=unused-function -Werror=unused-label
  66. -Werror=unused-local-typedefs -Werror=unused-result -Werror=unused-variable
  67. -Werror=unused-const-variable=2 -Werror=unused-variable -Werror=uninitialized