Skip to content

Fix: expat fallthrough attribute for MSVC compatibility#61

Closed
dcliftreaves wants to merge 20 commits into
gopro:masterfrom
dcliftreaves:fix/expat-fallthrough
Closed

Fix: expat fallthrough attribute for MSVC compatibility#61
dcliftreaves wants to merge 20 commits into
gopro:masterfrom
dcliftreaves:fix/expat-fallthrough

Conversation

@dcliftreaves

Copy link
Copy Markdown

Replace raw __attribute((fallthrough)) in xmltok.c and xmltok_impl.c with the FALL_THROUGH macro already defined in internal.h. The macro expands to __attribute__((fallthrough)) on GCC/Clang and ((void)0) on MSVC.

Without this fix, MSVC produces: error C2065: 'fallthrough': undeclared identifier

2 files changed, 4 substitutions. Credit: approach from #51 by @keenanjohnson.

🤖 Generated with Claude Code

farhadabed and others added 20 commits June 21, 2018 16:26
fixed 3 potential memory leaks when function PrepareCodebooks
Fixed file handle leaks in read_from_file() and write_to_file()
Mac build and run instructions
Removed an incorrect cast.
Add Linux instructions ('make' vs 'make .')
…ll' after 'make' so 'gpr_tools' executable is available system-wide.
…ke install' after 'make' so 'gpr_tools' executable is available system-wide."

This reverts commit 7a3a1cb.
Add Hero5 Black GPR Sample Raw Photo
clean unused var and made for loop more readable
* make __attribute__((fallthrough)) more portable for GCC (>= 7) and CLANG (>= 10)
Replace raw __attribute((fallthrough)) with the FALL_THROUGH macro
already defined in expat_lib/internal.h. The macro expands to
__attribute__((fallthrough)) on GCC/Clang and ((void)0) on MSVC.

Without this fix, MSVC produces:
  error C2065: 'fallthrough': undeclared identifier

Credit: approach from gopro#51 by @keenanjohnson

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dcliftreaves dcliftreaves force-pushed the fix/expat-fallthrough branch from 189b4c6 to c10883c Compare May 13, 2026 14:40
@dcliftreaves dcliftreaves deleted the fix/expat-fallthrough branch June 5, 2026 02:42
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.

9 participants