Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Aug 20, 2026. It is now read-only.
fix: add the missing #pragma once to every unguarded header - #48
Merged
Conversation
Eight of this repo's twelve headers had neither an include guard nor a `#pragma once`: distance_spline.h, posdef.h, pushpull.h, reg_field.h, reg_flow.h, resize.h, restrict.h and splinc.h. Unlike the umbrella headers in `kernels`, all eight contain real code (88-2519 non-comment lines each), so a second inclusion would be a hard redefinition error rather than a harmless no-op. The defect is currently masked only because each of these is included exactly once, from its matching cuda-lib translation unit. Any future header that pulls in two of them -- or a single TU that includes one both directly and transitively -- would break the build for no good reason. distance_euclidean.h, distance_l1.h, distance_mesh.h and utils.h already open with `#pragma once`; this just makes the other eight match. No functional change: each file gains one line and nothing else. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
Submodule staleness (non-blocking -- fastfields-lib#15)
|
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Eight of this repo's twelve headers had neither an include guard nor a
#pragma once. This adds#pragma onceto each, matching the four that already have it.The audit
Checked every header rather than assuming:
distance_euclidean.hdistance_l1.hdistance_mesh.hutils.hdistance_spline.hposdef.hpushpull.hreg_field.hreg_flow.hresize.hrestrict.hsplinc.hUnlike the umbrella headers over in
kernels, none of these eight is a thin re-export — every one carries real code (88 to 2519 non-comment lines), so a second inclusion is a hard redefinition error, not a harmless no-op.The defect is latent today only because each header happens to be included exactly once, from its matching
cuda-libtranslation unit. Any future header pulling in two of them, or one TU including a header both directly and transitively, breaks the build for no reason worth debugging.Convention
The four already-guarded headers all open with a bare
#pragma onceon line 1 — no#ifndefmacro-name convention exists in this repo — so that is what the other eight now use.Verification
git diff --summaryshows no mode changes and no content edits beyond the eight added lines.#pragma once.make -C . -j2 CXX=clang++ CXXFLAGS="-std=c++14 -O1"onfastfields-cuda-libagainst this branch (the repo's CI invocation — there is no GPU in CI, so compile+link is the accepted bar for this layer).🤖 Generated with Claude Code
https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
Generated by Claude Code