Skip to content

Commit

Permalink
BUILD/CONFIGURE: enforce 8KB stack threshold on compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-shalev committed Jun 19, 2024
1 parent 35dce49 commit e10a8a8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion config/m4/compiler.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,21 @@
#
# Initialize CFLAGS
#
BASE_CFLAGS="-g -Wall -Werror"
# BASE_CFLAGS sets compilation flags for GCC:
# -g: Debug information
# -O0: No optimizations
# -Wall: All common warnings
# -Werror: Treat warnings as errors
# -Wframe-larger-than=8192: Warn if stack frame size exceeds 8192 bytes (8 KB)
BASE_CFLAGS="-g -O0 -Wall -Werror -Wframe-larger-than=8192"

# To suppress -Wframe-larger-than=8192 for specific functions, use:
# #pragma GCC diagnostic push
# #pragma GCC diagnostic ignored "-Wframe-larger-than="
# void specific_function() {
# /* Function code */
# }
# #pragma GCC diagnostic pop


#
Expand Down

0 comments on commit e10a8a8

Please sign in to comment.