Fix Maximus BBS linking - change extern to extrn for global variables#6
Conversation
The Maximus BBS now compiles, links, and runs successfully! This completes
the modernization effort for the max/ directory on GCC 14.2/modern Linux.
Changes:
- max_v.h: Changed ~132 variables from extern → extrn for proper initialization
- prm, usr, origusr, bstats, linebuf, local, do_timecheck, no_dcd_check,
cls, display_line, display_col, current_line, current_col, and 120+ more
- Kept comp_date, comp_time, lam, laf as extern (defined in other sources)
- max_msg.h: Changed message globals from extern → extrn
- sq, msgeof, last_msg, direction, orig_msgid, netnode, isareply, isachange, mtm
- max_area.h: Changed area globals from extern → extrn
- haf, ham, mah, fah
- max_edit.h: Changed editor globals from extern → extrn
- jumpto, screen, num_lines, max_lines, usrwidth
Result:
- max executable (705KB) links successfully with all undefined references resolved
- Test installation to /tmp/maxtest completed successfully
- All executables run and display help/version information
- Verified: max, squish, mex, maid, silt all operational
Technical Details:
The Maximus codebase uses an extrn macro that becomes blank when MAX_INITIALIZE
is defined (in static.c), turning declarations into definitions. When not defined,
extrn becomes extern. Variables incorrectly using extern were never getting defined,
causing linker errors. Fixed by systematically converting extern → extrn in headers
for all global variables that should be initialized in static.c.
Updated README.md to reflect complete build success.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Code Review: Fix Maximus BBS linking - change extern to extrn for global variablesSummaryThis PR successfully resolves the linking phase for the Maximus BBS by systematically converting ~132 global variable declarations from Technical Analysis✅ Correct Understanding of the
|
The Maximus BBS now compiles, links, and runs successfully! This completes the modernization effort for the max/ directory on GCC 14.2/modern Linux.
Changes:
Result:
Technical Details:
The Maximus codebase uses an extrn macro that becomes blank when MAX_INITIALIZE is defined (in static.c), turning declarations into definitions. When not defined, extrn becomes extern. Variables incorrectly using extern were never getting defined, causing linker errors. Fixed by systematically converting extern → extrn in headers for all global variables that should be initialized in static.c.
Updated README.md to reflect complete build success.
🤖 Generated with Claude Code