Skip to content

Fix build warnings exposed by newer GCC (-Werror)#458

Merged
carlgsmith merged 1 commit into
alliedtelesis:masterfrom
sparlane:fix_building_with_gcc_16
Jun 5, 2026
Merged

Fix build warnings exposed by newer GCC (-Werror)#458
carlgsmith merged 1 commit into
alliedtelesis:masterfrom
sparlane:fix_building_with_gcc_16

Conversation

@sparlane

@sparlane sparlane commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

These are pre-existing latent issues only flagged as errors by newer GCC (CI uses GCC 11; they surface on GCC 16). They block building the tree at all, so fix them first:

  • hashtree.h: header guard #define did not match the #ifndef token (_HASHTREE_H_H vs HASHTREE_H), tripping -Wheader-guard.
  • config.c, apteryx.c: strrchr/strstr on a const char* were assigned to char*, discarding const (-Wdiscarded-qualifiers). Use const pointers; the values are only read.
  • apteryx.c handle_index(): drop the write-only loop counter i (-Wunused-but-set-variable).

No functional change.

These are pre-existing latent issues only flagged as errors by newer
GCC (CI uses GCC 11; they surface on GCC 16). They block building the
tree at all, so fix them first:

- hashtree.h: header guard #define did not match the #ifndef token
  (_HASHTREE_H_H vs _HASHTREE_H_), tripping -Wheader-guard.
- config.c, apteryx.c: strrchr/strstr on a const char* were assigned to
  char*, discarding const (-Wdiscarded-qualifiers). Use const pointers;
  the values are only read.
- apteryx.c handle_index(): drop the write-only loop counter i
  (-Wunused-but-set-variable).

No functional change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@carlgsmith
carlgsmith merged commit 6b3cf4c into alliedtelesis:master Jun 5, 2026
1 check passed
@sparlane
sparlane deleted the fix_building_with_gcc_16 branch June 5, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants