8000 Add FORTIFY config setting by attipaci · Pull Request #143 · Smithsonian/SuperNOVAS · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add FORTIFY config setting #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ jobs:
runs-on: ubuntu-latest
env:
CC: gcc
CFLAGS: -Os -Wall -Wextra -Werror -std=c99
CFLAGS: -Os -Wall -Werror
CSTANDARD: c99
WEXTRA: 1
FORTIFY: 3
steps:
- uses: actions/checkout@v4

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
runs-on: ubuntu-latest
env:
CC: gcc
FORTIFY: 3
steps:

- uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ calculations.
epoch, and new `make_cat_object_sys()` and `make_redshifted_object_sys()` to make it simpler to define ICRS catalog
sources in the coordinate system of choice.

- #143: Added `FORTIFY` build configuration setting to enable gcc source code fortification checking by setting the
`_FORTIFY_SOURCE` macro to the specified value. It is now used with a value of 3 in the build and test CIs.

- Added `example-time.c` and `example-rise-set.c` under `examples/`, for demonstrating date/time handling functions
and rise, set, and transit time calculations.

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ Additionally, you may set number of environment variables to futher customize th

- `WEXTRA`: If set to 1, `-Wextra` is added to `CFLAGS` automatically.

- `FORTIFY`: If set it will set the `_FORTIFY_SOURCE` macro to the specified value (`gcc` supports values 1
through 3). It affords varying levels of extra compile time / runtime checks.

- `LDFLAGS`: Extra linker flags (default is _not set_). Note, `-lm -lxchange` will be added automatically.

- `CHECKEXTRA`: Extra options to pass to `cppcheck` for the `make check` target
Expand Down
5 changes: 5 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ ifeq ($(WEXTRA), 1)
CFLAGS += -Wextra
endif

# Add source code fortification checks
ifdef FORTIFY
CFLAGS += -D_FORTIFY_SOURCE=$(FORTIFY)
endif

# Specific Doxygen to use if not the default one
#DOXYGEN ?= /opt/bin/doxygen

Expand Down
0